Countifs With Months

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following tables:

Book1
CDEFGHIJKLMNO
2Table 1Table 2Table 3
3BranchSales StaffDateBranchFebruaryMarchAprilBranchFebruaryMarchApril
4TexasMark8/2/2022Texas000Texas100
5MaineJavier7/2/2022Maine000Maine100
6IllinoisJuan5/4/2022Illinois000Illinois001
7IowaKenny5/3/2022Iowa000Iowa010
8VirginiaJoan9/4/2022Virginia000Virginia001
Sheet1
Cell Formulas
RangeFormula
H4:J8H4=COUNTIFS($C$4:$C$8,$G4,$E$4:$E$8,H$3)


1) Table 1 is the raw data
2) Table 2- I am trying to summarize the count of sales staffs recorded for the branch based on the month. However my current formula is not showing the correct results
3) Table 3 - This is an example of the correct result.

Appreciate any help to modify the current formula to show the desired results.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,

One way:

Book3.xlsx
CDEFGHIJ
2Table 1Table 2
3BranchSales StaffDateBranchFebruaryMarchApril
4TexasMark2/8/2022Texas100
5MaineJavier2/7/2022Maine100
6IllinoisJuan4/5/2022Illinois001
7IowaKenny3/5/2022Iowa010
8VirginiaJoan4/9/2022Virginia001
Sheet1078
Cell Formulas
RangeFormula
H4:J8H4=SUMPRODUCT(($C$4:$C$8=$G4)*(TEXT($E$4:$E$8,"mmmm")=H$3))
 
Upvote 0
Hi ,

I am getting blanks in my file. Is there any other setting or format cells I should apply ?

Book1
CDEFGHIJ
2Table 1Table 2
3BranchSales StaffDateBranchFebruaryMarchApril
4TexasMark2/8/2022Texas000
5MaineJavier2/7/2022Maine000
6IllinoisJuan4/5/2022Illinois000
7IowaKenny3/5/2022Iowa000
8VirginiaJoan4/9/2022Virginia000
Sheet1
Cell Formulas
RangeFormula
H4:J8H4=SUMPRODUCT(($C$4:$C$8=$G4)*(TEXT($E$4:$E$8,"mmmm")=H$3))
 
Upvote 0
Are your H3:J3 (February, March, etc.) Real Dates formatted to show Month, or are they just plain Text ??
 
Upvote 0
The formatting is showing as General

If they are Text, also check for leading/trailing spaces for G3:J3, and if they are Text, my formula should work, when you select any G3:J3, what do you see in the formula bar? "February" or a number?
What about your dates in Column E, are they Actual Dates, in other words, if you change their formatting to General, do you see a bunch of Numbers ??
 
Last edited:
Upvote 0
Hi,

I manually typed in the whole table in a new sheet but it still shows 0 for the result.
 
Upvote 0
Hi,

I manually typed in the whole table in a new sheet but it still shows 0 for the result.

Well, if that's the case, I'd have no idea why you're not getting the results, as it works for me.

If you want, upload your sample file to a Free hosting site (i.e. Dropbox), and post the link here, I, or someone will try to diagnose the problem.
 
Upvote 0
One more thing, are your 2 tables in the same sheet ??
Did you add Sheetname, change/adjust cell range/references accordingly ??
 
Upvote 0
Hi,

Here is a link to the file. Appreciate the help. Thanks.

 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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