COUNTIF occurrences between two dates

bgrice

New Member
Joined
Feb 19, 2018
Messages
24
Hello, everyone. This is my first post so apologies if I am breaking etiquette - I mean not to and please point out if I am. I am hoping someone can help with the following:

I need a formula for the table below that will count the number of times a specified fruit is mentioned in a particular month. I have tried COUNTIF and COUNTIFS but with no luck and I have run out of ideas. So, for example, if I want it to calculate how many times 'apples' appears in the month of May, which is twice, I have been trying the following formula. Grateful for your help. Thanks, Benno.

=COUNTIFS(A:A,">=01/05/2017",A:A,"<=31/05/2017,B:B, "*apples*")
Date
Fruit
01/05/17
apples, oranges
06/05/17
apples, pears
20/06/17
pears, bananas
08/08/17
oranges, apples
11/08/17
bananas, oranges
15/10/17
grapes, apples
31/11/17
pears, grapes
20/12/17
bananas, oranges
03/01/18
bananas, pears
11/01/18
pears, apples

<tbody>
</tbody>
 

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.
This is an example. Don't copy my formula or data directly as I had to change the date formats...

Excel 2013/2016
ABCD
15/1/2017apples, oranges2
25/6/2017apples, pears
36/20/2017pears, bananas
48/8/2017oranges, apples
58/11/2017bananas, oranges
610/15/2017grapes, apples
711-31-17pears, grapes
812/20/2017bananas, oranges
91/3/2018bananas, pears
102/11/2018pears, apples

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D1=COUNTIFS(A:A,">=5/01/2017",A:A,"<=5/31/2017",B:B, "*apples*")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



But assuming that's the result you want (2), then:

=COUNTIFS(A:A,">=01/05/2017",A:A,"<=31/05/2017",B:B, "*apples*")

try that :) .

You were missing a closing parenthesis.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,457
Members
449,161
Latest member
NHOJ

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