How do a add a group of numbers in reverse until a condition is met?

Water Billing

New Member
Joined
Apr 2, 2019
Messages
1
I am trying to add a group of numbers together until I reach a 0 in a cell; however, I am starting with the last number in a column and going in reverse.

100
200
300
0
450
200
600

<tbody>
</tbody>

i.e. I would like to start with the last number (600) and add until I reach a zero (600+200+450). Can someone help me? Thank you.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Welcome to Mr Excel forum

Try


A
B
C
1
Numbers​
Formula​
2
100​
1250​
3
200​
4
300​
5
0​
6
450​
7
200​
8
600​

Formula in C2
=SUM(INDEX(A2:A8,LOOKUP(2,1/(A2:A8=0),ROW(A2:A8)-ROW(A2)+1)):A8)

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top