SOLVED

Counting entries between date/time ranges

%3CLINGO-SUB%20id%3D%22lingo-sub-1508977%22%20slang%3D%22en-US%22%3ECounting%20entries%20between%20date%2Ftime%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1508977%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20figure%20out%20how%20to%20count%20the%20number%20of%20entries%20in%20an%20excel%20column%20that%20fall%20within%20a%20certain%20date%2Ftime%20range%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20I%20have%20a%20spreadsheet%20that%20has%20three%20columns%20(See%20below)%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDate%2Ftime%20case%20opened%3C%2FP%3E%3CP%3ESLA%20cut%20off%20(date%2Ftime%20of%20our%20cut%20off%20date%2Ftime)%3C%2FP%3E%3CP%3EWorkday%20Hours%20-%20excluding%20weekends%2Fholidays%20-%20represented%20in%20days%2C%20hours%2C%20minutes%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture5.JPG%22%20style%3D%22width%3A%20518px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204140i7490644D0F5AFD20%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture5.JPG%22%20alt%3D%22Capture5.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20need%20to%20do%20is%20figure%20out%20a%20way%20to%20count%20the%20number%20of%20cases%20between%20unique%20date%2Ftime%20ranges%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture65.JPG%22%20style%3D%22width%3A%20203px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204141i6ABD3E9130E2635B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture65.JPG%22%20alt%3D%22Capture65.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20found%20this%20%3CA%20href%3D%22https%3A%2F%2Fwww.get-digital-help.com%2Fcount-entries-between-date-and-time-criteria-in-excel%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewebsite%3C%2FA%3E%20that%20seems%20to%20give%20this%20formula%20for%20it's%20scenario%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DCOUNTIFS(B3%3AB17%2C%20%22%26lt%3B%3D%22%26amp%3BF3%2C%20B3%3AB17%2C%20%22%26gt%3B%3D%22%26amp%3BF2%2C%20C3%3AC17%2C%20F4)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20I%20cannot%20get%20it%20to%20work%20for%20my%20specific%20scenario%20-%20any%20help%20or%20advice%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1508977%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1509089%22%20slang%3D%22en-US%22%3ERe%3A%20Counting%20entries%20between%20date%2Ftime%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1509089%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F606460%22%20target%3D%22_blank%22%3E%40NeilKloster%3C%2FA%3E%26nbsp%3B%20without%20the%20sheet%20it%20is%20hard%20to%20know%20for%20sure.%26nbsp%3B%20for%20example%20I%20assume%20the%20dates%20in%20the%20table%20are%20in%20B3%3AB17%20and%20the%20start%20date%20is%20in%20F2%20and%20the%20end%20date%20is%20in%20F3%20but%20what%20is%20that%20last%20part%20at%20looking%20at%20column%20C%20and%20checking%20it%20again%20F4%3F%26nbsp%3B%20What%20is%20F4%3F%26nbsp%3B%20Based%20on%20the%20picture%20it%20would%20appear%20to%20be%20%22Item%22%20which%20is%20blank.%26nbsp%3B%20Since%20none%20of%20the%20SLA%20Cutoff%20cells%20are%20blank%20the%20count%20should%20be%200.%26nbsp%3B%20In%20F4%20try%20putting%207%2F8%2F2020%203%3A00%20PM%20or%20just%20delete%20that%20part%20of%20the%20equation%20so%20you%20only%20have%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3DCOUNTIFS(B3%3AB17%2C%20%22%26lt%3B%3D%22%26amp%3BF3%2C%20B3%3AB17%2C%20%22%26gt%3B%3D%22%26amp%3BF2)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hello, 

 

I'm trying to figure out how to count the number of entries in an excel column that fall within a certain date/time range?

 

For example, I have a spreadsheet that has three columns (See below): 

 

Date/time case opened

SLA cut off (date/time of our cut off date/time)

Workday Hours - excluding weekends/holidays - represented in days, hours, minutes

Capture5.JPG

 

What I need to do is figure out a way to count the number of cases between unique date/time ranges?

 

Example: 

Capture65.JPG

I found this website that seems to give this formula for it's scenario:

 

=COUNTIFS(B3:B17, "<="&F3, B3:B17, ">="&F2, C3:C17, F4)

 

but I cannot get it to work for my specific scenario - any help or advice?

 

9 Replies
Highlighted

@NeilKloster  without the sheet it is hard to know for sure.  for example I assume the dates in the table are in B3:B17 and the start date is in F2 and the end date is in F3 but what is that last part at looking at column C and checking it again F4?  What is F4?  Based on the picture it would appear to be "Item" which is blank.  Since none of the SLA Cutoff cells are blank the count should be 0.  In F4 try putting 7/8/2020 3:00 PM or just delete that part of the equation so you only have: 

=COUNTIFS(B3:B17, "<="&F3, B3:B17, ">="&F2)

 

Highlighted

@mtarler Sorry if i made this more confusing than it is.  

 

So basically, that formula I got from another website.  But ultimately, I am just looking to count the number of cases that fall between a certain date/time range.

 

Column E is my Date/time Opened 

Column F is my SLA Cut Off (basically our 3:00 PM cut off time)

Column G just shows the days in between minus weekends and holidays.

 

So just trying to figure out, how many cases would be between select date/time ranges?

Example: 

 

Column E: 6/29/2020 2:59 PM through Column F: 7/8/3030 3:00 PM = #XXX of cases, also need it to take into account weekends & holidays if possible?  Is there a way to do that?

 

I can attach the file too if that helps?

 

 

Highlighted
yes including the sheet would help. If col E is opened and F is cut off and you want count of cases that fall between that then where are the dates for those cases? a different table/sheet? How would a COUNT take into account weekends & holidays? either the date is between those dates or not.
Highlighted

@mtarler 

 

Attaching file.  

 

Here is what my spreadsheet looks like: 

Capture6f5.JPG

 

This is where I'm pulling the data from. 

 

So Is there a way to count how many cases fell between specified date/times?  

 

So if I start with 6/26/2020 1:55 PM and then let's say use a 7/2/2020 2:59 PM cut off date/time.  Is there a way to count how many cases fell between that range?  

 

The only way that I am taking weekends and holidays into account is in column G which excludes those items - but I'm worried about the first part first.  I may not need to worry about it, if I can get the formula to work between date/time ranges. 

 

I tried using this website for reference - but cannot get it to work for me.  Click HERE. 

Highlighted
Best Response confirmed by NeilKloster (Occasional Contributor)
Solution

@NeilKloster  in the attached is a SUMPRODUCTS() formula that I used because the COUNTIFS() formula wouldn't work because the "dates" in your table are actually TEXT format (you probably imported or copied them in as text).  I also went to the DATA tab and used "Text to Columns" to force that column to be actual Date information instead of text and included the correct COUNTIFS() formula in the cell below the other "count" cell to show how it works (that it does work if you correct the text).  If you will be importing data a lot and don't want to deal with converting text to number every time use the first.  If you want to do more with the data and dates, you might want to convert the text to real dates to make it easier for yourself.

Highlighted

@mtarler 

 

Thank you!!  It worked!! 

Highlighted
you're very welcome
Highlighted

Hi again @mtarler 

 

Was hoping that I could ask for your assistance again?  So the report that you sent me, helped me get to where I'm at - but I am stuck because I see that the formula you gave me, for some reason it's not properly counting up the entries.  Was wondering if you could take a look again?

 

For example, 

 

For my BSN count, it is currently showing 505 for 4 business day (4 BD), but when I look at the tab for BSN Evaluations (where the data is at) and count from the date ranges from: 6/30/2020 10:44 AM - 7/6/2020 2:59 PM it should be: 331 (when I count it manually).  So do you know why it would be counting more than that?  

 

I attached my file here to the response to see if this helps make any sense? 

 

Thank you for your help!! 

Highlighted

@NeilKloster  i found 2 problems.  

1. your > and < references were reversed.  You had < smaller date and > larger date.  I'm guessing you might have been 'playing' with the formula and accidentally left it that way

2. the "real" problem is that your "dates" in Q5 and Q12 are really text so you have the same problem you had before.  You can simply add the -- in front of those 2 refs in the formulas or fix those 2 cells.

I think you can make those corrections (and see/learn) but if you need more guidance just ask.