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.
IDReasonTimingDate
CRQ145074

<tbody>
</tbody>
Successful

<tbody>
</tbody>
Standard

<tbody>
</tbody>
9/1/2017 17:00

<tbody>
</tbody>
CRQ141919

<tbody>
</tbody>
Successful with Issues

<tbody>
</tbody>
Emergency

<tbody>
</tbody>
6/4/2017 11:15

<tbody>
</tbody>
CRQ153749

<tbody>
</tbody>
Backed Out

<tbody>
</tbody>
Normal

<tbody>
</tbody>
6/8/2017 13:20

<tbody>
</tbody>
CRQ161487

<tbody>
</tbody>
Successful

<tbody>
</tbody>
Standard

<tbody>
</tbody>
7/12/2017 8:21

<tbody>
</tbody>

<tbody>
</tbody>

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

JanFebMarApr
Successful
Successful with Issues

<tbody>
</tbody>

Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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

Count of IDColumn Labels
Row LabelsJanFebMarAprMayJunJulAugSepDecGrand Total
Backed Out2122121112
Successful21111118
Successful with Issues132219
Grand Total333333333229

<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>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,838
Members
449,193
Latest member
MikeVol

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