Sumproduct? Countifs? multiple criteria and dates (January and blank cells messing everything up)

85Sarah2005

New Member
Joined
Mar 20, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have dates in column A, (but some blanks), then column B has X, Y, or Z.

The zero's were messing up my Countif and including them in the January total, but in the end I managed to count the number of occurrences for each moth by using : =SUMPRODUCT(--(MONTH(A2:A500)=1),--(MONTH(A2:A500<>0))

But I now need to show the same data but just for criteria x, y or z. If I use =SUMPRODUCT(--(MONTH(A2:A500)=1)*(B2:B500=X) then it's just giving me all wrong numbers, but I I try and incorporate --(MONTH(A2:A500<>0 then I'm getting a spill error. What am I doing wrong?

13​

13​
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I'm not sure if this is what you want, but take a look:

mr excel questions 15.xlsm
ABCDEFG
1Date
22022-11-01Z
32022-11-01XDecJanFeb
42022-11-01YX233
52022-11-01YY181
62022-11-01ZZ511
72022-11-01Y
82022-11-01X
92022-11-01Y
102022-11-01Z
112022-11-01Z
122022-11-01X
132022-11-01Y
142022-12-01X
152022-12-01Y
162022-12-01Z
172022-12-01Z
182022-12-01Z
192022-12-01Z
202022-12-01X
212022-12-01Z
222023-01-01Y
232023-01-01Y
242023-01-01X
252023-01-01Y
262023-01-01Y
272023-01-01Y
282023-01-01Y
29Z
30X
31Y
32X
33Y
342023-02-01X
352023-02-01X
362023-02-01Z
372023-02-01X
382023-02-01Y
392023-03-01X
402023-03-01Y
412023-03-01Z
422023-03-01Z
432023-03-01Y
442023-03-01X
452023-03-01Z
462023-03-01Z
472023-03-01X
482023-03-01Y
492023-03-01X
502023-03-01X
512023-03-01X
52
Sheet18
Cell Formulas
RangeFormula
D4:F6D4=SUM((--(TEXT($A$2:$A$51,"mmm")=D$3))*(--($B$2:$B$51=$C4)))
 
Upvote 0
Welcome to the forum.
Another option. Try changing your formula to:
SUMPRODUCT((MONTH(A2:A500)=1)*(B2:B500="X")*(A2:A500<>""))
 
Upvote 0
Another option
Excel Formula:
=COUNT(FILTER(ROW(A2:A500),(MONTH(A2:A500)=1)*(B2:B500="x")*(A2:A500<>"")))
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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