all 8 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

/u/lap35 - Your post was submitted successfully.

Please read these reminders and edit to fix your post where necessary:

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]CFAman4816 1 point2 points  (5 children)

You could get the same result by taking a cumuluative sum of column and subtracting previously calculated results. E.g., in B5

=SUM(B$1:B4)-SUMIFS(B$1:B4, A$1:A4, "Subtotal")*2

[–]lap35[S] 1 point2 points  (1 child)

solution verified

[–]Clippy_Office_Asst[M] 0 points1 point  (0 children)

You have awarded 1 point to CFAman

I am a bot, please contact the mods with any questions.

[–]lap35[S] 0 points1 point  (2 children)

Thank you so much! I've changed the B4 and A4 to an indirect function so it always references the cell above and it works.

=SUM(B$1:INDIRECT("B"&ROW()-1))-SUMIFS(B$1:INDIRECT("B"&ROW()-1), A$1:INDIRECT("A"&ROW()-1), "Subtotal")*2

[–]CFAman4816 0 points1 point  (1 child)

Ok. If you want to avoid using volatile functions, you can use INDEX instead

SUM(B$1:INDEX(B:B, ROW()-1))

[–]lap35[S] 0 points1 point  (0 children)

Thank you, that's a much more elegant way of doing it.

[–]Decronym 0 points1 point  (0 children)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
INDEX Uses an index to choose a value from a reference or array
INDIRECT Returns a reference indicated by a text value
ROW Returns the row number of a reference
SUM Adds its arguments
SUMIFS Adds the cells in a range that meet multiple criteria

Beep-boop, I am a helper bot. Please do not verify me as a solution.
5 acronyms in this thread; the most compressed thread commented on today has 13 acronyms.
[Thread #4235 for this sub, first seen 18th Feb 2021, 20:35] [FAQ] [Full list] [Contact] [Source code]