Sumproduct with multiple criteria, month and year

Danzrox

New Member
Joined
Sep 2, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello. I would appreciate some help.
What I am trying to do is to calculate the sum of the values that have the criteria needed.

Example:

1599021951443.png


As you can see the answer is 4 but it should be 1 (only for door, open, in jan-19).
 

Attachments

  • 1599021837222.png
    1599021837222.png
    19.1 KB · Views: 88

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Here is one way. Notice that I put Open and Door into separate columns.
Book1
ABCDEFG
1itemdatestatusOpenDoor
2Door1/1/2019open1/1/20191
3Cab4/5/2019closed
4Drawer2/7/2019open
5Door5/1/2019closed
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(--($A$2:$A$5=$G$1),--($C$2:$C$5=$F$1),--(MONTH($B$2:$B$5)=MONTH($E$2)),--(YEAR($B$2:$B$5)=YEAR($E$2)))
 
Upvote 0
Hello I tried to solve it. I am stuck while incorporating the date criteria, I hope someone will help customizing it too. Rather than that I posting the formula for criteria- door & open- I hope it help.
Book1
ABCDEFG
1itemdatestatusCRITERIA 1CRITERIA 2CALCULATED NO.
2Door01-01-2019openDoorOpen1
3Cabinet04-05-2019closed
4Drawer02-07-2019open
5Door05-01-2019closed
6
Sheet1
Cell Formulas
RangeFormula
G2G2=COUNTIFS($A$2:$A$5,$E$2,$C$2:$C$5,$F$2)
 
Upvote 0
Here is one way. Notice that I put Open and Door into separate columns.
Book1
ABCDEFG
1itemdatestatusOpenDoor
2Door1/1/2019open1/1/20191
3Cab4/5/2019closed
4Drawer2/7/2019open
5Door5/1/2019closed
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(--($A$2:$A$5=$G$1),--($C$2:$C$5=$F$1),--(MONTH($B$2:$B$5)=MONTH($E$2)),--(YEAR($B$2:$B$5)=YEAR($E$2)))

Thanks Ahoy but it ended up looking at only open cells at 01/01/19. I need it to look up every open cell in the month of jan-19.
 
Upvote 0
I'm not sure ER_Neha. Column E should be Jan-19, Feb-19, Mar-19 OR could be 1, 2, 3, 4.
It is a spreadsheet with 4000 rows
Hello I used a Helper column and I have made the calculation dynamic according to the criteria kindly have a look and please reply if it worked for you
Book1
ABCDEFGHI
1itemdatestatusHelper ColumnCRITERIA 1CRITERIA 2CRITERIA 3CALCULATED NO.
2Door01-01-2019openJan-19DoorOpenJan-191
3Cabinet04-05-2019closedMay-19
4Drawer02-07-2019openJul-19
5Door05-01-2019closedJan-19
6
Sheet1
Cell Formulas
RangeFormula
I2I2=COUNTIFS($A$2:$A$5,$F$2,$C$2:$C$5,$G$2,$D$2:$D$5,$H$2)
D2:D5D2=TEXT(MONTH(B2)&"-"&YEAR(B2),"mmm-yy")
Cells with Data Validation
CellAllowCriteria
H2List=$D$2:$D$5
 
Upvote 0
Danzrox - in your example there is only 1 open door in Jan. You will need to change the ranges in my formula to match your data.
Er_Neha - The example below also shows using COUNTIFS with a date range. Note: my dates are formatted as "m/d/y". The date in cell F2 was entered as 1/1/19 and then formatted as "mmm-yy".

Book1
ABCDEFG
1itemdatestatusOpenDoor
2Door1/1/2019open1/1/20191
3Cab5/4/2019closed1
4Drawer7/2/2019open
5Door1/5/2019closed
Sheet2
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT(--($A$2:$A$5=$G$1),--($C$2:$C$5=$F$1),--(MONTH($B$9:$B$12)=MONTH($E$2)),--(YEAR($B$9:$B$12)=YEAR($E$2)))
F3F3=COUNTIFS($A$2:$A$5,$G$1,$C$2:$C$5,$F$1,$B$2:$B$5,">="&$E$2,$B$2:$B$5,"<="&EOMONTH($E$2,0))
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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