ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUM of a variable range of fields (https://www.excelbanter.com/excel-worksheet-functions/80688-sum-variable-range-fields.html)

Nicolas

SUM of a variable range of fields
 
I have the following problem: I'm comparing daily statistics with prior
year but would like to do this on a month-to-date basis. This means
that I have to change the SUM range every-day for the current and prior
year in order to show the month-to-date total.
Can somebody tell me if there's a way to define the range in a way that
it will automatically increment as the days go by? The structure of my
table is somethink like this:

Days 1 2 3 4 5 6 ... Total to-date
Stats 5 8 10 3 26
Stats prior year 6 9 11 2 8 7 28

Many thanks for any help.


Bob Phillips

SUM of a variable range of fields
 
Assuming that Stats are A2:AE2 and Stats prior are A3:AE3, then sum of prior
stats could be

=SUM(A2:INDEX(A2:AE2,COUNT(A3:AE3)))

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Nicolas" wrote in message
oups.com...
I have the following problem: I'm comparing daily statistics with prior
year but would like to do this on a month-to-date basis. This means
that I have to change the SUM range every-day for the current and prior
year in order to show the month-to-date total.
Can somebody tell me if there's a way to define the range in a way that
it will automatically increment as the days go by? The structure of my
table is somethink like this:

Days 1 2 3 4 5 6 ... Total to-date
Stats 5 8 10 3 26
Stats prior year 6 9 11 2 8 7 28

Many thanks for any help.




Nicolas

SUM of a variable range of fields
 
Perfect! Great! Many thanks! I wasn't familiar with the INDEX function.
You've just saved me lots of time.
Thanks.
Nicolas



All times are GMT +1. The time now is 03:25 AM.

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