ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum a column (https://www.excelbanter.com/excel-worksheet-functions/225051-sum-column.html)

Stefanie

Sum a column
 
Col A Result of Formula
1 0 0
2 7.5 7.5
3 0 0
4 0 0
5 9 9
6 9.5 18.5
7 10 28.5
8 0 0

This is a partial list of a driver log sheet. Column A is hours driven each
day. I'm trying to create a formula that will sum the numbers in column A
backward, or up, to where the previous number is zero and then stop. I was
thinking an IF stmt, but I'm stuck on how to sum upward and then stop when
the cell value is 0.

example: IF(A1=0,"0",sum upward until Ax=0). I don't know what to do for
"sum upward until Ax=0" or if its even possible.

Thanks,
Stefanie

Elkar

Sum a column
 
For Cell B1, you'd just use =A1. Then try this, starting with Cell B2:

=IF(A2=0,0,B1+A2)

Copy down as needed.

HTH
Elkar


"Stefanie" wrote:

Col A Result of Formula
1 0 0
2 7.5 7.5
3 0 0
4 0 0
5 9 9
6 9.5 18.5
7 10 28.5
8 0 0

This is a partial list of a driver log sheet. Column A is hours driven each
day. I'm trying to create a formula that will sum the numbers in column A
backward, or up, to where the previous number is zero and then stop. I was
thinking an IF stmt, but I'm stuck on how to sum upward and then stop when
the cell value is 0.

example: IF(A1=0,"0",sum upward until Ax=0). I don't know what to do for
"sum upward until Ax=0" or if its even possible.

Thanks,
Stefanie


Stefanie

Sum a column
 
Thanks! I was trying to make it more difficult than it was. Stefanie

"Elkar" wrote:

For Cell B1, you'd just use =A1. Then try this, starting with Cell B2:

=IF(A2=0,0,B1+A2)

Copy down as needed.

HTH
Elkar


"Stefanie" wrote:

Col A Result of Formula
1 0 0
2 7.5 7.5
3 0 0
4 0 0
5 9 9
6 9.5 18.5
7 10 28.5
8 0 0

This is a partial list of a driver log sheet. Column A is hours driven each
day. I'm trying to create a formula that will sum the numbers in column A
backward, or up, to where the previous number is zero and then stop. I was
thinking an IF stmt, but I'm stuck on how to sum upward and then stop when
the cell value is 0.

example: IF(A1=0,"0",sum upward until Ax=0). I don't know what to do for
"sum upward until Ax=0" or if its even possible.

Thanks,
Stefanie



All times are GMT +1. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com