# sumif, sumproduct or vlookup

#### Kmitchell

##### Active Member
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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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)``

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.

Thank you so much this is exactly what I needed!!! This saves so much time.

Much appreciated!

Replies
6
Views
197
Replies
4
Views
340
Replies
1
Views
197
Replies
3
Views
194
Replies
4
Views
492

1,218,575
Messages
6,143,313
Members
450,477
Latest member
teresab543

### 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?

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