sumif, sumproduct or vlookup

Kmitchell

Active Member
Joined
Feb 27, 2007
Messages
353
There is a table of which you can select the month and the department and I need it to do the following:

If J9=Appletree then go to sheet1! and find appletree in M4:M4575 and sum up these dates.

Once the formula finds appletree (which will be numerous counts of this cell) it needs to then sum up a rolling 12 month history of data which sits in E4:E4575.

Basically when you select the current month in D5, D6 will compute the month that is 12 months behind. The formula will read sumproduct or sumif(e4:e4575) if greater than D6 and less than D5.

Am I trying to do too much in one formula or can this be done?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Well, You need to specify which range you want to SUM.

so far you have
which range contains the NAMES like appletree M4:M4575
and which range contains the DATES E4:E4575

We need which range you want to SUM based on those criteria...for my example I used N4:N4575

Code:
=SUMPRODUCT(--(sheet1!M4:M4575=J9),--(sheet1!E4:E4575<D5),--(sheet1!E4:M4575>D6),sheet1!N4:N4575)
 

hedgie

Board Regular
Joined
Jun 23, 2004
Messages
173
Office Version
  1. 365
Platform
  1. Windows
I think you need to give more data. What do you mean sum up the dates in sheet1? The first part sounds like a simple =if(j9="appletree",sumif(sheet1!m4:m4575,"appletree",{range of dates- maybe the e4:e4575?}),{no detail given for possibility that j9<>="appletree")

I have no idea what you mean with the D5 and D6 cells.
 

Kmitchell

Active Member
Joined
Feb 27, 2007
Messages
353
Thank you so much this is exactly what I needed!!! This saves so much time.

Much appreciated!
 

Forum statistics

Threads
1,181,719
Messages
5,931,660
Members
436,797
Latest member
fullmetalpogi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top