SUM of a variable range of fields

N

Nicolas

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.
 
B

Bob Phillips

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)
 
N

Nicolas

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top