sum automatically from last 12 months based on current date

C

CDSchomaker

I have a database consisting of monthly hours covering the last 10 years.
Occassionally, I need to sum up the hours from the last 12 months. Which
Excel function do I use so that a cell will automatically show the sum of
hours from the last 12 months based on the current date?
 
D

Don Guillett

assuming valid dates in col A, try

=SUMPRODUCT((A1:A40>=EDATE(TODAY(),-12))*(A1:A40<=TODAY())*B1:B40)
 

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