Write an excel 'sum' formula for a certain # of columns

C

ctante

I am trying to build a rolling spreadsheet based on days. I want to have a
total for the trailing 30 days, but keep all the information that is older
than 30 days. If I lock the formula, and add new days it keeps the original
30 day calculation, instead of adding on 1 new day and dropping off the
oldest day of the 30.
 
L

Lars-Åke Aspelin

I am trying to build a rolling spreadsheet based on days. I want to have a
total for the trailing 30 days, but keep all the information that is older
than 30 days. If I lock the formula, and add new days it keeps the original
30 day calculation, instead of adding on 1 new day and dropping off the
oldest day of the 30.


Please give some more information about the layout of your
spreadsheet.
Is there one row per day, or one column per day?
Do you have data for every day, or can there be gaps in the dates?
If there are gaps, what do you mean by trailing 30 days?
Is it the 30 last dates, or all dates higher than the highest date
minus 30 days?

Lars-Åke
 
M

Mike H

Hmm,

What's a 'trailing' day? I think your saying you want to sum the last 30
entries of data. This sums the last 30 entries in column A and is dynamic so
as new entries are added it stills sums the last 30

=SUM(OFFSET(A1,COUNTA(A:A)-30,):OFFSET(A1,COUNTA(A:A),))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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