Link to home
Start Free TrialLog in
Avatar of ssblue
ssblueFlag for United States of America

asked on

Excel - need to get total based on dates

Not sure the best way to get what I need.

I would like total of hours for dates in the past in column D

I would like total of hours for dates in the future (including current day) in column E

See attachment
Planning.xlsx
Avatar of Bill Prew
Bill Prew

When doing this calculation, do you want to count the current month (in range APJ5:APU5) as the "past" or the "future"?  Meaning, if you recalculated today, where would September be included?


»bp
Avatar of ssblue

ASKER

I think we should count the current month as the future.
Here you go.

I just added one more row above your month with their month number:
For Past:
=SUMPRODUCT(($APJ$5:$APU$5<MONTH(TODAY()))*($APJ7:$APU7))

Open in new window

For Future:
=SUMPRODUCT(($APJ$5:$APU$5>=MONTH(TODAY()))*($APJ7:$APU7))

Open in new window

Check in attached in Col APX & APY...
ssblue_Planning.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ssblue

ASKER

thanks!
Avatar of ssblue

ASKER

How would I adjust this is if I decided that I didn't want the current month in the future.
This would include todays month in the "past".

D6
=SUM(OFFSET($APJ6,0,0,1,MONTH(TODAY())))

Open in new window

E6
=SUM(OFFSET($APJ6,0,MONTH(TODAY()),1,12-MONTH(TODAY())))

Open in new window


»bp