Compare date and count if meets specific criteria

aldea187

New Member
Joined
Apr 4, 2014
Messages
42
Hello All,

Ive been trying a few things in other threads, but just cant seem to get this working. I have specific conditions that need to be counted per month.[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Reason[/TD]
[TD]Timing[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD][TABLE="width: 177"]
<tbody>[TR]
[TD="width: 177"]CRQ145074[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 183"]
<tbody>[TR]
[TD="width: 183"]Successful[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 137"]
<tbody>[TR]
[TD="width: 137"]Standard[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 149"]
<tbody>[TR]
[TD="class: xl65, width: 149, align: right"]9/1/2017 17:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 177"]
<tbody>[TR]
[TD="width: 177"]CRQ141919[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 183"]
<tbody>[TR]
[TD="width: 183"]Successful with Issues[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 137"]
<tbody>[TR]
[TD="width: 137"]Emergency[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 149"]
<tbody>[TR]
[TD="class: xl65, width: 149, align: right"]6/4/2017 11:15[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 177"]
<tbody>[TR]
[TD="width: 177"]CRQ153749[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 183"]
<tbody>[TR]
[TD="width: 183"]Backed Out[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 137"]
<tbody>[TR]
[TD="width: 137"]Normal[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 149"]
<tbody>[TR]
[TD="class: xl65, width: 149, align: right"]6/8/2017 13:20[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 177"]
<tbody>[TR]
[TD="width: 177"]CRQ161487[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 183"]
<tbody>[TR]
[TD="width: 183"]Successful[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 137"]
<tbody>[TR]
[TD="width: 137"]Standard[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 149"]
<tbody>[TR]
[TD="class: xl65, width: 149, align: right"]7/12/2017 8:21[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

I would like to have a count of the reason column broken down by date.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[/TR]
[TR]
[TD]Successful[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Successful with Issues[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Let A:D house the data.

Let F:J house the output.

In G2 enter, copy across, and down:

=SUMPRODUCT(--($B$2:$B$5=$F2),--($D$2:$D$5>=(1&G$1)+0),--($D$2:$D$5<=EOMONTH(1&G$1,0)))
 
Upvote 0
Use a PivotTable.

Create Pivot Table
.. Select range: $A$1:$D$5
.. New Worksheet
.. Ok

Drag the REASON column to the Rows box.

Drag the ID column to the Values box and set to 'COUNT'

Drag the Date column to the Columns box.

Then GROUP the date field and select only MONTHS

[TABLE="width: 718"]
<colgroup><col width="167" style="width:125pt"> <col width="136" style="width:102pt"> <col width="35" style="width:26pt"> <col width="36" style="width:27pt"> <col width="34" style="width:26pt"> <col width="38" style="width:29pt"> <col width="35" style="width:26pt"> <col width="30" style="width:23pt"> <col width="37" style="width:28pt"> <col width="36" style="width:27pt" span="2"> <col width="98" style="width:74pt"> </colgroup><tbody>[TR]
[TD="width: 167"]Count of ID[/TD]
[TD="width: 136"]Column Labels[/TD]
[TD="width: 35"][/TD]
[TD="width: 36"][/TD]
[TD="width: 34"][/TD]
[TD="width: 38"][/TD]
[TD="width: 35"][/TD]
[TD="width: 30"][/TD]
[TD="width: 37"][/TD]
[TD="width: 36"][/TD]
[TD="width: 36"][/TD]
[TD="width: 98"][/TD]
[/TR]
[TR]
[TD]Row Labels[/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD]May[/TD]
[TD]Jun[/TD]
[TD]Jul[/TD]
[TD]Aug[/TD]
[TD]Sep[/TD]
[TD]Dec[/TD]
[TD]Grand Total[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Backed Out[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]12[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Successful[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]8[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Successful with Issues[/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent, align: right"]3[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent, align: right"]2[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]1[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent, align: right"]9[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]29[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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