Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum up a column from a specific row down

It seem simple but I cannot find a way to define a range that goes up to the end of the column in an Excel formula.

For instance I can use this equation SUM(C:C) to sum all number found on the column C. However, given that the top of the page has titles and column headers, I would like to start my range at line 6. I thought SUM(C6:C) would do it but it does not work in Excel.

This is required so my SUM is always right no matter how many lines of data I add to my document in the future.

Thanks.

like image 368
jmbouffard Avatar asked Jan 22 '14 14:01

jmbouffard


People also ask

How do I sum an entire column except for certain rows?

Save the code and close the window, then type this formula =SumColumn(A1) (A1 is the first cell in the list column) into the first cell of list column, press Enter button, then the list except the header is summed up.

How do I sum specific rows and columns in Excel?

If you need to sum a column or row of numbers, let Excel do the math for you. Select a cell next to the numbers you want to sum, click AutoSum on the Home tab, press Enter, and you're done.

How do you sum data from one column based on another column?

(1) Select the column name that you will sum based on, and then click the Primary Key button; (2) Select the column name that you will sum, and then click the Calculate > Sum. (3) Click the Ok button.

How do I sum only certain cells in a row?

Just organize your data in table (Ctrl + T) or filter the data the way you want by clicking the Filter button. After that, select the cell immediately below the column you want to total, and click the AutoSum button on the ribbon. A SUBTOTAL formula will be inserted, summing only the visible cells in the column.


2 Answers

=Sum(C:C)-Sum(C1:C5) 

Sum everything then remove the sum of the values in the cells you don't want, no Volatile Offset's, Indirect's, or Array's needed.

Just for fun if you don't like that method you could also use:

=SUM($C$6:INDEX($C:$C,MATCH(9.99999999999999E+307,$C:$C)) 

The above formula will Sum only from C6 through the last cell in C:C where a match of a number is found. This is also non-volatile, but I believe more costly and sloppy. Just added it in case you'd prefer this anyways.

If you would like to do function like CountA for text using the last text value in a column you could use.

=COUNTIF(C6:INDEX($C:$C,MATCH(REPT("Z",255),$C:$C)),"T") 

you could also use other combinations like:

=Sum($C$6:$C$65536)  

or

=CountIF($C$6:$C$65536,"T")  

The above would do what you ask in Excel 2003 and lower

=Sum($C$6:$C$1048576)  

or

=CountIF($C$6:$C$1048576,"T") 

Would both work for Excel 2007+

All above functions would simply ignore all the blank values under the last value.

like image 68
user2140261 Avatar answered Oct 02 '22 17:10

user2140261


You all seem to love complication. Just click on column(to select entire column), press and hold CTRL and click on cells that you want to exclude(C1 to C5 in you case). Now you have selected entire column C (right to the end of sheet) without starting cells. All you have to do now is to rightclick and "Define Name" for your selection(ex. asdf ). In formula you use SUM(asdf). And now you're done. Good luck

Allways find the easyest way ;)

like image 21
Bogdan Horascu Avatar answered Oct 02 '22 16:10

Bogdan Horascu