Countifs function for Date & Time Range not counting all cells

SMcCafferty

New Member
Joined
May 5, 2022
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
I am using the formula below to count all cells that fall between two specified date/time ranges. From what I can tell, it is counting the cells between the two date/times but not the boundary cells which meet the criteria.

The function is counting cells on a separate worksheet, but is contained within the same workbook. The References AL2 and AL3 are helper cells I created to combine the Date and Time entered on the sheet specifying the date/time range needed.

=COUNTIFS('KPI Table'!AM3:AM491,">"&AL2,'KPI Table'!AM3:AM491,"<"&AL3)

I am also using SUMIFS formulas in the adjacent cells and getting the same result.

Any help would be greatly appreciated.

PS: Below is the code from the two sheets I am using captured by Xl2BB. Not sure if that is what you want. I dont see an option where I can upload the actual Excel file.

Countifs Example.xlsx
ABCD
8Total Frac Stages4
9Total Pumping Hours10:56
10Total NPT Hours5:42
Daily Ops Report
Cell Formulas
RangeFormula
C8C8=COUNTIFS('KPI Table'!AM3:AM491,">"&AL2,'KPI Table'!AM3:AM491,"<"&AL3)
C9C9=SUMIFS('KPI Table'!AN3:AN491,'KPI Table'!AM3:AM491,"<="&AL3,'KPI Table'!AM3:AM491,">="&AL2)
C10C10=SUMIFS('KPI Table'!AO3:AO491,'KPI Table'!AM3:AM491,">="&AL2,'KPI Table'!AM3:AM491,"<="&AL3)


Cell Formulas
RangeFormula
AK3:AK13AK3=IF('C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!A6="","",'C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!A6)
AL3:AL13AL3=IF('C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!L6="","",'C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!L6)
AM3:AM13AM3=AK3+AL3
AN3:AN13AN3=IF('C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!M6="","",'C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!M6)
AO3:AO13AO3=IFERROR('C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!J6+'C:\Users\spmcc\Documents\4. Job Management Packet\[JMP 6.06 Vlookup.xlsm]Frac Stage Tracker'!P6,"")
 
But they are before 6 AM on 4/7.
Well, this is the part where I feel like a complete idiot. Yes sir, you are absolutely correct. I went back to the original time entry log and those times are correct but the date was wrong. It should be 4/8 and therefore counted. So, when I changed the date to 4/8 magically it worked. I cannot apologize enough for wasting your time. Please feel free to delete this entire thread. It's always the little things.
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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