简体   繁体   中英

Excel: Formula or function to sum up the column values starting from a certain row

Is there a way (formula or function) in Excel (using AB or RC format) to sum the column values from a certain row (say row 5) and beyond?

I am trying to place a totals row (say on row 2) above the header (which is on row 4), and each column in the totals row displays the sum of the respective column - all rows from row 5 (which is after the header).

Your help is appreciated.

Does SUBTOTAL solve your issue?

=SUBTOTAL(9, B5:B1000)

9 code for SUM

B5 is the the first cell after the header

Assuming I understand your question, so why don't you just write (in location X2 , ie column X row 2)

=SUM(X5:X25)

Which will give you the sum of column X rows 5 to 25

It's unclear why a simple SUM function won't work here. If you want to be fancy, try something like the following.

=sum(a5:index(a:a, match(1e99, a:a)))

Fill right as necessary.

You can use the offset function for things like this

=SUM(OFFSET(A2,3,0,995))

where the 995 is the number of rows you want to sum. You can use a count() or something instead of hardcoding it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM