Forum Discussion
CountIFS formula with Asterisk *
Hi all,
Would appreciate your help with this formula containing CountIFS with *
I want to count the number of cells containing "Campus" and "July" and then "CED" and July". For some reason the count keep coming up as 0 (screen shot below with formula and cells highlighted in yellow).
Any dates within the month should be counted. I've been counting them manually but want to automate the process.
Thanks in Advance
Try this one:
=COUNTIFS(B:B,"Campus",K:K,">="&DATE(2022,7,1),K:K,"<="&DATE(2022,7,31))Column K contains real dates. Excel stores dates as sequential numbers starting at 1 on January 1, 1900. Although you have formatted the date to display as shown in the picture, the cell does not contain a text like "July 2022". You need to use proper date values (lower and upper boundary) to find dates in July 2022.
Example attached.
8 Replies
- Riny_van_EekelenPlatinum Contributor
Try this one:
=COUNTIFS(B:B,"Campus",K:K,">="&DATE(2022,7,1),K:K,"<="&DATE(2022,7,31))Column K contains real dates. Excel stores dates as sequential numbers starting at 1 on January 1, 1900. Although you have formatted the date to display as shown in the picture, the cell does not contain a text like "July 2022". You need to use proper date values (lower and upper boundary) to find dates in July 2022.
Example attached.
- Sun_HCopper ContributorIs there a way I can use this formula without specifying the year?
(I want to be able to duplicate these for each year without having to fix up the formulae for each month every year...)- Riny_van_EekelenPlatinum Contributor
Sun_H You can enter the month, last day of the month and year in separate cells and refer to these rather then hard coding them in each formula.
Edit: I've now attached a file demonstrating how you could make your file more dynamic.
- Sun_HCopper ContributorOh yes that worked, thank you so much!! I thought it might have had something to do with the cell content! So very much appreciated!
- Harun24HRBronze ContributorColumn K data are texts or dates? Share a sample workbook.
- Sun_HCopper Contributor
Colum K is dates, in the given date format..
How do I attach a file please? Can't seem to find an option for it...
- Harun24HRBronze ContributorShare link by uploading to onedrive or google drive. In case of comment open full text editor. At the end of editing box you will find an option to attach file. Click browse to select file from your storage disk.