SUMIF formula if another field falls between a date range

benchris

New Member
Joined
Feb 10, 2016
Messages
24
Office Version
  1. 2019
Platform
  1. Windows
What I am trying to do is find total dollars sold by a certain value, but the date value of another field has to be less then or equal to a date.

I have a table where a sumif is working pulling in the sum of certain values:

The formula is: =SUMIF(H:H,Z7,P:P)
H:H = the column that has all of the item group's
Z7 = item group number
P:P is the column of the value to be returned

There is also another field that shows the date the transaction took place. I am looking to create a formula that would state if the date range is less than or equal to <this field>, then the sumif statement would give back the results where the date column is equal or less than the date in the field.

For example

Col A Col B Col C
Date Item Group Value
02/04/2016 115 $1999
02/23/2015 116 $100
01/31/2016 115 $500

Field AA7 =SUMIF(B:B,Z7,C:C) and Z7 has value 115 in it and it would return $2449
Field AA8 = =SUMIF(B:B,Z8,C:C) and Z8 has value 116 in it and it would return $100

What I am trying to figure out is how to have a static date field and then a formula that would say that if the date is "<=" than the date stated in field Z10 then include the results from that row in the results.

Does this make sense? Any ideas on how I can accomplish this?

I appreciate the help. I have been reading here a lot, but finally registered today.

Thanks
Ben
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
maybe this (untested)...
=SUMIF(P:P,H:H,Z7,A:A,">="cell-with-start-date",A:A,"<="cell-with-end-date"
 
Upvote 0
It is stating I have entered too many arguments for this function.

Is there a way that a formula can lookup by dates logically in a column and know numerically if the date is less than or equal to the one it is looking up against? Or does the date have to be in a range?
 
Upvote 0
grrrr HUGE apologies, I left out a letter...
=SUMIFS(P:P,H:H,Z7,A:A,">="cell-with-start-date",A:A,"<="cell-with-end-date")
 
Upvote 0
Thanks. When I put the date fields in that have the start date and the end date I had to write the formula like this to get it to show up as a formula, but then I got zero results

=SUMIFS(P:P,H:H,Z7,F:F,">=" &AB41,F:F,"<=" &AA41)

Column F is the actual column of where the dates are held
 
Upvote 0
Are your dates real dates?

Test with =ISNUMBER(cell-ref) FALSE indicates they are text, not dates
 
Upvote 0
See if this helps...
A​
B​
C​
D​
E​
1​
CodeDateValueaa
2​
aa
2/1/2016​
1​
Start
2/3/2016​
3​
bb
2/2/2016​
2​
End
2/10/2016​
4​
cc
2/3/2016​
3​
Amount
21​
5​
aa
2/4/2016​
4​
6​
bb
2/5/2016​
5​
7​
cc
2/6/2016​
6​
8​
aa
2/7/2016​
7​
9​
bb
2/8/2016​
8​
10​
cc
2/9/2016​
9​
11​
aa
2/10/2016​
10​
12​
bb
2/11/2016​
11​
13​
cc
2/12/2016​
12​
14​
aa
2/13/2016​
13​
15​
bb
2/14/2016​
14​
16​
cc
2/15/2016​
15​
17​
aa
2/16/2016​
16​
18​
bb
2/17/2016​
17​
19​
cc
2/18/2016​
18​
20​
aa
2/19/2016​
19​
21​
bb
2/20/2016​
20​
22​
cc
2/21/2016​
21​
E4=SUMIFS(C:C,A:A,E1,B:B,">="&E2,B:B,"<="&E3)
 
Upvote 0
Do the values in the date column have to be in descending order, or can they be mixed up?
 
Upvote 0
Should not matter if they are mixed
A​
B​
C​
D​
E​
1​
CodeDateValueaa
2​
aa
2/1/2016​
1​
Start
2/3/2016​
3​
bb
2/3/2016​
2​
End
2/10/2016​
4​
cc
2/15/2016​
3​
Amount
21​
5​
aa
2/4/2016​
4​
6​
bb
2/5/2016​
5​
7​
cc
2/6/2016​
6​
8​
aa
2/7/2016​
7​
9​
bb
2/8/2016​
8​
10​
cc
2/9/2016​
9​
11​
aa
2/10/2016​
10​
12​
bb
2/11/2016​
11​
13​
cc
2/12/2016​
12​
14​
aa
2/13/2016​
13​
15​
bb
2/14/2016​
14​
16​
cc
2/2/2016​
15​
17​
aa
2/16/2016​
16​
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,260
Members
449,149
Latest member
mwdbActuary

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
Back
Top