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.
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,409
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,876
Messages
5,598,607
Members
414,248
Latest member
Tirali

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
Top