count how many times a word occurs per year

chrisbland1

New Member
Joined
Apr 10, 2021
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
Hi. I have series of dates in column A and associated data in column B. I need to know how many times the word 'fail' appears per month. I have attached a simple demo file. It is the date aspect that has stumped me

Thank you in advance for any help.
 

Attachments

  • Screenshot 2021-04-10 at 13.31.27.png
    Screenshot 2021-04-10 at 13.31.27.png
    113.8 KB · Views: 4

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDE
1
2
3
4
5
601/04/202101/05/2021
720/04/2021pass31
821/04/2021fail
922/04/2021pass
1023/04/2021pass
1124/04/2021pass
1225/04/2021fail
1326/04/2021pass
1427/04/2021pass
1528/04/2021pass
1629/04/2021pass
1730/04/2021fail
1801/05/2021pass
1902/05/2021pass
2003/05/2021pass
2104/05/2021fail
2205/05/2021pass
2306/05/2021pass
2407/05/2021pass
2508/05/2021pass
26
Data
Cell Formulas
RangeFormula
D7:E7D7=COUNTIFS($B:$B,"fail",$A:$A,">="&D6,$A:$A,"<="&EOMONTH(D6,0))
 
Upvote 0
Solution
Another possibility

21 04 10.xlsm
ABCDE
1
2
3
4
5
61/04/20211/05/2021
720/04/2021pass31
821/04/2021fail
922/04/2021pass
1023/04/2021pass
1124/04/2021pass
1225/04/2021fail
1326/04/2021pass
1427/04/2021pass
1528/04/2021pass
1629/04/2021pass
1730/04/2021fail
181/05/2021pass
192/05/2021pass
203/05/2021pass
214/05/2021fail
225/05/2021pass
236/05/2021pass
247/05/2021pass
258/05/2021pass
26
Count
Cell Formulas
RangeFormula
D7:E7D7=SUM(($A$7:$A$25-DAY($A$7:$A$25)+1=D6)*($B$7:$B$25="Fail"))
 
Upvote 0
Another possibility

21 04 10.xlsm
ABCDE
1
2
3
4
5
61/04/20211/05/2021
720/04/2021pass31
821/04/2021fail
922/04/2021pass
1023/04/2021pass
1124/04/2021pass
1225/04/2021fail
1326/04/2021pass
1427/04/2021pass
1528/04/2021pass
1629/04/2021pass
1730/04/2021fail
181/05/2021pass
192/05/2021pass
203/05/2021pass
214/05/2021fail
225/05/2021pass
236/05/2021pass
247/05/2021pass
258/05/2021pass
26
Count
Cell Formulas
RangeFormula
D7:E7D7=SUM(($A$7:$A$25-DAY($A$7:$A$25)+1=D6)*($B$7:$B$25="Fail"))
Thankyou so much! If I also have to show how many by the year, (as in 2021, 2022 etc) how would I adapt this?
 
Upvote 0
Two options
+Fluff 1.xlsm
ABCD
1
2
3
4
5Year
601/01/20212021
720/04/2021pass44
821/04/2021fail
922/04/2021pass
1023/04/2021pass
1124/04/2021pass
1225/04/2021fail
1326/04/2021pass
1427/04/2021pass
1528/04/2021pass
1629/04/2021pass
1730/04/2021fail
1801/05/2021pass
1902/05/2021pass
2003/05/2021pass
2104/05/2021fail
2205/05/2021pass
2306/05/2021pass
2407/05/2021pass
2508/05/2021pass
Data
Cell Formulas
RangeFormula
C7C7=COUNTIFS($B:$B,"fail",$A:$A,">="&C6,$A:$A,"<="&EOMONTH(C6,12))
D7D7=SUM((YEAR(A7:A25)=D6)*(B7:B25="Fail"))
 
Upvote 0
Yet another option (for both your questions) is to use a Pivot Table with the dates
.. grouped by month as shown here

1618104279660.png


.. or grouped by year

1618104391991.png
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,755
Members
449,187
Latest member
hermansoa

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