Count if based off of a date range in another column

Lea

Board Regular
Joined
Oct 1, 2007
Messages
133
Office Version
  1. 365
Platform
  1. Windows
Hello,
I hope to get some help with a formula. The part I can get is this-
=COUNTIF(C:C,"*Philip*")

The part I can't figure out is how to do that based off of a date range in column B.
I would like the formula to count how many times *Philip* appears in column C for the month of January which is in column B.
The date format is 01/01/2023

Thank you for any help,
Lea
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
This uses matrix math. but answers your question, i think:
mr excel questions 21.xlsm
ABCDE
1DateNames
22023-01-01TomName:Philip
32023-01-01PhilipDate:2023-01-01
42023-02-01Mary
52023-03-01BobCount:3
62023-01-01Philip
72023-02-01Carol
82023-03-01Alice
92023-04-01Philip
102023-01-01Philip
Sheet7
Cell Formulas
RangeFormula
E5E5=SUM((--(E2=$C$2:$C$10))*(--(E3=$B$2:$B$10)))
 
Upvote 0
if you want wildcard name search use this:

mr excel questions 21.xlsm
DE
6Count w Name Wildcard:3
Sheet7
Cell Formulas
RangeFormula
E6E6=SUM((--(ISNUMBER(FIND(E2,$C$2:$C$10))))*(--(E3=$B$2:$B$10)))
 
Upvote 0
note: the above are using Excel 365, if you are using something else, you may need to change the SUM functions to SUMPRODUCT or Use CNTL-SHFT-ENTER to enter the formulas.
 
Upvote 0
Another option....
Book1
BCDE
1HDR1HDR2
201/01/2023Philip SmithPhilip in January =6
304/01/2023I'm Philip
407/01/2023Jones
510/01/2023Philip Smith
613/01/2023Philip
716/01/2023Adam
819/01/2023Eve
922/01/2023Philip
1025/01/2023Adam
1128/01/2023Eve
1231/01/2023I'm Philip
1303/02/2023I'm Philip
1406/02/2023I'm Philip
1509/02/2023Jack
1612/02/2023Philip Jones
Sheet1
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(1*(MONTH(B2:B1000)=1)*(ISNUMBER(SEARCH("Philip",C2:C1000))))
 
Upvote 1
=SUMPRODUCT(1*(MONTH(B2:B1000)=1)*(ISNUMBER(SEARCH("Philip",C2:C1000))))
My apologies to all- I am in the lab by myself tonight and I got very busy with samples. I will try the suggestions out tomorrow. I thank you for the replies and assistance. I really appreciate it!
Lea
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option is
Excel Formula:
=COUNTIFS(B:B,">="&DATE(2023,1,1),B:B,"<"&DATE(2023,2,1),C:C,"*Philip*")
 
Upvote 0
Solution
Another option....
Book1
BCDE
1HDR1HDR2
201/01/2023Philip SmithPhilip in January =6
304/01/2023I'm Philip
407/01/2023Jones
510/01/2023Philip Smith
613/01/2023Philip
716/01/2023Adam
819/01/2023Eve
922/01/2023Philip
1025/01/2023Adam
1128/01/2023Eve
1231/01/2023I'm Philip
1303/02/2023I'm Philip
1406/02/2023I'm Philip
1509/02/2023Jack
1612/02/2023Philip Jones
Sheet1
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(1*(MONTH(B2:B1000)=1)*(ISNUMBER(SEARCH("Philip",C2:C1000))))
Hi kevin9999,

Thank you for the help. Your formula worked for me. I thank you for your time.

Kind regards- Lea
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option is
Excel Formula:
=COUNTIFS(B:B,">="&DATE(2023,1,1),B:B,"<"&DATE(2023,2,1),C:C,"*Philip*")
Hello Fluff,

Your formula worked as well as kevin9999. And thank you for the tip about updating my profile. I have done as you suggested.

Kind regards- Lea
 
Upvote 0
This uses matrix math. but answers your question, i think:
mr excel questions 21.xlsm
ABCDE
1DateNames
22023-01-01TomName:Philip
32023-01-01PhilipDate:2023-01-01
42023-02-01Mary
52023-03-01BobCount:3
62023-01-01Philip
72023-02-01Carol
82023-03-01Alice
92023-04-01Philip
102023-01-01Philip
Sheet7
Cell Formulas
RangeFormula
E5E5=SUM((--(E2=$C$2:$C$10))*(--(E3=$B$2:$B$10)))
Hello awoohaw,

Thank you for your taking your time to help me. I was having difficulty making your formula work for me as I am really a novice at this. I saw it worked in your example, but I don't have the excel skills to adapt it to my spreadsheet.
I appreciate your help.

Lea
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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