Sumif or Sumproduct with 3 conditions or criteria

Jbooze

Board Regular
Joined
Sep 1, 2005
Messages
59
I have searched this forum and not found a formulat that will work. I need to check 3 conditions and if all three are true sum the values in a range of cells. One formula I have tried is:

=SUMPRODUCT((Configuration!A3:A370=B11)*(Configuration!C3:C370>=(T3)*(Configuration!C3:C370<=(U3)*(Configuration!D3:D370))))

Where B11 is the day of week (Monday, Tuesday, etc.), T3 is the starting date in the range and U3 is the end date in the range. If all 3 are true in columns A and the two conditions for C, then sum cells for True rows in Configuration!D3:D370

Any ideas?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I have searched this forum and not found a formulat that will work. I need to check 3 conditions and if all three are true sum the values in a range of cells. One formula I have tried is:

=SUMPRODUCT((Configuration!A3:A370=B11)*(Configuration!C3:C370>=(T3)*(Configuration!C3:C370<=(U3)*(Configuration!D3:D370))))

Where B11 is the day of week (Monday, Tuesday, etc.), T3 is the starting date in the range and U3 is the end date in the range. If all 3 are true in columns A and the two conditions for C, then sum cells for True rows in Configuration!D3:D370

Any ideas?

What do you have in A3:A370? are they days of the week or actual dates formatted as days,Monday, Tuesday, etc? For arguments sake, are you looking for all Mondays greater than the start date and earlier than the end date to have their corresponding values in column D? Whatevers in your A column will determine what way to go with the formula, also what version of Excel are you using?
 
Upvote 0
Sorry. Yes, column A has the day of week in it and is checked against B11 in the tab that the formula resides in.
 
Upvote 0
I possibly never phrased the question properley SUMPRODUCT((Configuration!A3:A370=B11)*(Configuration!C3:C370>=(T3)*(Configuration!C3:C370<=(U3)*(Configuration!D3:D370)))) do the days of the week in column A3:A370 have any direct relationship with with the actual dates in column C?

For example if the date in C3 is todays date, would A3 be the same as today as in Wednesday? If it is, is A3=C3? if not then you don't actually need that column included in your formula to count how many weekdays are in a range greater or less than and = a weekday

again, which version of Excel?
 
Upvote 0
I am sorting by day of week in the sum that I need and then by a date range that will be entered in cells T3 and U3. A3's text value is derived from the same source as c3 with formula: =IF(C3=0,"",TEXT('Paste Data'!L2,"dddd")). It is the day of the date in C3. I am using Excel 2010.

Thanks.
 
Upvote 0
Ok, this assumes your using office 2007 or later. Eitherway you can discount the days in column A, the weekday function used on your dates column will suffice to work out what days of the week are. Hope this helps

Excel Workbook
GHIJK
3Saturday01/01/20117,727.00Start Date01/01/2011
4Sunday02/01/20113,305.00End Date08/02/2011
5Monday03/01/20116,784.00WeekdayMonday
6Tuesday04/01/20118,895.00Total31,998.00
7Wednesday05/01/20115,733.00
8Thursday06/01/20113,408.00
9Friday07/01/20114,821.00
10Saturday08/01/20117,880.00
11Sunday09/01/20115,827.00
12Monday10/01/20116,863.00
13Tuesday11/01/20116,701.00
14Wednesday12/01/20111,005.00
15Thursday13/01/20112,502.00
16Friday14/01/20117,181.00
17Saturday15/01/20113,044.00
18Sunday16/01/20111,314.00
19Monday17/01/20114,712.00
20Tuesday18/01/20112,041.00
21Wednesday19/01/20115,040.00
22Thursday20/01/20116,285.00
23Friday21/01/20118,398.00
24Saturday22/01/20115,949.00
25Sunday23/01/2011409.00
26Monday24/01/20117,708.00
27Tuesday25/01/20111,140.00
28Wednesday26/01/20113,559.00
29Thursday27/01/2011701.00
30Friday28/01/20111,687.00
31Saturday29/01/20115,553.00
32Sunday30/01/20112,756.00
33Monday31/01/20114,486.00
34Tuesday01/02/20112,397.00
35Wednesday02/02/20116,989.00
36Thursday03/02/20117,434.00
37Friday04/02/20111,264.00
38Saturday05/02/20115,213.00
39Sunday06/02/20114,049.00
40Monday07/02/20111,445.00
Sheet1


You could also use the Sumifs function in 2007 or layer
 
Upvote 0
Thanks for the reply. I am getting a 0 value for the answer when the range has values. My dates don't have the zero place holder (1/17/2011 instead of 01/17/2011). Would this cause the 0 answer?
 
Upvote 0
My formula looks like this now: =SUMPRODUCT(--(WEEKDAY(Configuration!C3:C370,2)=1),--(Configuration!C3:C370>=K3),--(Configuration!C3:C370<=M4),Configuration!D3:D370)
 
Upvote 0
Thanks for the reply. I am getting a 0 value for the answer when the range has values. My dates don't have the zero place holder (1/17/2011 instead of 01/17/2011). Would this cause the 0 answer?

are your dates imported? try in A1 =isnumber(B11) and see if you get a TRUE or FALSE, if its true then try the same on the dates in your Column C and the cells containing your date criteria. If any of them return False then your dates are Text and not real dates, but we can adjust for that. When you used the Weekday(function did the option appear as you were typing it into the Formula? if not then you need to add the analysis toolpack add in but i thought it was there as standard in 2010, the only other posible for it showing as 0 would be the sums to value, also can be checked with
isnumber
 
Upvote 0
My formula looks like this now: =SUMPRODUCT(--(WEEKDAY(Configuration!C3:C370,2)=B11),--(Configuration!C3:C370>=K3),--(Configuration!C3:C370<=M4),Configuration!D3:D370)

The formula typed as is is only looking for Mondays, that was for my example, if you were checking against mondays and there were no values to sum then check against a day where there is sum values. In your formula, you had B11 as the source of the weekday to check, replace B11 Contents with a cell that has any number from 1 through to 7. 1 = monday, 2 tuesday 3 wednesday etc etc
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

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