Count no of items between dates when dates are in a column

St Vitus Dance

New Member
Joined
May 17, 2014
Messages
15
Hello Everyone,

I am trying to count the no of items between two dates (say from 01/Oct/2017 to 31/Dec/2017) using criteria in column a. Each item has a date in a row in the format dd/mmm/yyyy. I'd rather not have to enter the dates in separate cells and rather have them in the formula so that they use the dates in column c. Also, id like to be able to use a wild card within the formula to be able to count anything with 'HOUSE' and anything with 'CAR'

My data would look like this... appreciate any help folks, thanks for your time.

NAMETYPEDATE
ANEW HOUSE01/Oct/2017
BEXISTING HOUSE01/Jan/2017
CNEW CAR31/Dec/2017
AEXISTING CAR29/Nov/2017

<tbody>
</tbody>
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
A
B
C
D
E
F
G
1
NAMETYPEDATEHOUSECAR
2
ANEW HOUSE
01/Oct/2017​
A
1​
1​
3
BEXISTING HOUSE
01/Jan/2017​
B
0​
0​
4
CNEW CAR
31/Dec/2017​
C
0​
1​
5
AEXISTING CAR
29/Nov/2017​

<tbody>
</tbody>


F2=COUNTIFS($A$2:$A$5,$E2,$B$2:$B$5,"*"&F$1&"*",$C$2:$C$5,">="&$C$2,$C$2:$C$5,"<="&$C$4) copy across and down
 
Upvote 0
=SUM(COUNTIFS(A:A,"A",B:B,"*"&{"HOUSE","CAR"}&"*",C:C,">="&DATE(2017,10,1),C:C,"<="&DATE(2017,12,31)))

This counts records with either HOUSE or CAR together.

If you want to count these partial items separately...

=COUNTIFS(A:A,"A",B:B,"*"&"HOUSE"&"*",C:C,">="&DATE(2017,10,1),C:C,"<="&DATE(2017,12,31))

=COUNTIFS(A:A,"A",B:B,"*"&"CAR"&"*",C:C,">="&DATE(2017,10,1),C:C,"<="&DATE(2017,12,31))
 
Upvote 0
Hello Everyone,

I am trying to count the no of items between two dates (say from 01/Oct/2017 to 31/Dec/2017) using criteria in column a. Each item has a date in a row in the format dd/mmm/yyyy. I'd rather not have to enter the dates in separate cells and rather have them in the formula so that they use the dates in column c. Also, id like to be able to use a wild card within the formula to be able to count anything with 'HOUSE' and anything with 'CAR'

My data would look like this... appreciate any help folks, thanks for your time.

NAMETYPEDATE
ANEW HOUSE01/Oct/2017
BEXISTING HOUSE01/Jan/2017
CNEW CAR31/Dec/2017
AEXISTING CAR29/Nov/2017

<tbody>
</tbody>

Maybe this:

Normal Formula (use Enter to enter the formula)

In E2 and copy down: =IFERROR(INDEX($A$2:$A$5,MATCH(0,INDEX(COUNTIF($E$1:$E1,$A$2:$A$5),0),)),"")

Array Formula (use Ctrl+Shift+Enter to enter the formula)

In F2 and copy down and to right: =COUNT(SEARCH(" "&F$1&" "," "&IF($A$2:$A$5=$E2,$B$2:$B$5)&" "))

ABCDEFG
1NAMETYPEDATENAMEHOUSECAR
2ANEW HOUSE01/Oct/2017A11
3BEXISTING HOUSE01/jan/2017B10
4CNEW CAR31/Dec/2017C01
5AEXISTING CAR29/nov/2017
***********************************************************

<tbody>
</tbody>

Markmzz
 
Upvote 0
You can try this too (Array Formula - use Ctrl+Shift+Enter to enter the formula):

=COUNT(SEARCH(" "&F$1&" "," "&IF($A$2:$A$5=$E2,IF($C$2:$C$5>=--"1/10/2017",IF($C$2:$C$5<=--"31/12/2017",$B$2:$B$5)))&" "))

Markmzz
 
Last edited:
Upvote 0
One small modification (Array Formula - use Ctrl+Shift+Enter to enter the formula):

=COUNT(SEARCH(" "&F$1&" ",IF($A$2:$A$5=$E2,IF($C$2:$C$5>=--"1/10/2017",IF($C$2:$C$5<=--"31/12/2017"," "&$B$2:$B$5&" ")))))

Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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