Countif / Sum including a date range

djjamesp

New Member
Joined
Oct 21, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to get the following (sample data set) to complete a count per month: The data I need to extract is how many jobs each name from column B has issued an abort code (column H) and how many jobs they've been able to save per month (also from column H)

I was able to get the following formulae to work, but this only gives me a rolling total - when I try to add the date range it returns a zero value

=COUNTIFS(B2:B1500,"Bryan", H2:H1500,"<>saved")
=COUNTIFS(B2:B1500,"Bryan", H2:H1500,"saved")

But there has to be a better way with more logic built in, sadly, I cannot find a way through many hours or searching and testing

Please help!

1729542393674.png


Just a quick edit- this is only a sample data set, I realise the two different spellings of Bryan / Brian, this is all correct in the real data
 
Last edited by a moderator:

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.
Hi @djjamesp Welcome to the MrExcel forum. Please accept my warmest greetings.


I'm trying to get the following (sample data set) to complete a count per month: The data I need to extract is how many jobs each name from column B has issued an abort code (column H) and how many jobs they've been able to save per month (also from column H)
From your original request I see that you need to count by month, by name, by job aborted and by job saved. In reality they are several combinations of counts.

But there has to be a better way with more logic built in
I suggest you create a pivot table. There you can dynamically count on the different concepts that you need.
I show you some examples:

First, create a pivot table.
- Select your data
- then select Insert > Table from the ribbon.
- In the Create PivotTable dialog box, select where to place the PivotTable
- Click OK
- Move fields: Drag a field to the target area to move it from one area to another. Look at the image below:
1729560143474.png


In Excel, a slicer is a tool that allows you to filter data in a PivotTable:
To add a slicer
Click anywhere in the PivotTable, then select Insert Slicer from the PivotTable tab.
Select fields, In the Insert Slicers dialog box, check boxes Months fields. Look at image below:

1729560393804.png


Now, you can count by jobs Saved:
1729560492379.png


By month:
1729560533702.png


By Saved, Month and Tech:
1729560641380.png


By two-month period, Not Save, all Tech:
1729560904708.png


This way, you can count by the combinations you want.

----- --
Let me know the result and I'll get back to you as soon as I can.
Sincerely
Dante Amor
----- --
 

Attachments

  • 1729560775912.png
    1729560775912.png
    12.9 KB · Views: 2
Upvote 0
Try.
K2= Start Date, L2 =End Date

=COUNTIFS(B2:B1500,"Bryan", H2:H1500,"<>saved", A2:A1500,">="& K2, A2:A1500,"<="&L2)

=COUNTIFS(B2:B1500,"Bryan", H2:H1500,"saved", A2:A1500,">="& K2, A2:A1500,"<="&L2)
 
Upvote 0
Thank you all! I like all of these options, I'm going to have a play today and see which one works the best for my needs

I'd tried a pivot table, but adding those extra steps in seems like this will work and will make it easier for others to extract the data. I'll report back later

Thanks again for your help and suggestions
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,091
Members
453,021
Latest member
Justyna P

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