COUNTIF help DATE condition and DATE TIME range

sparkd

New Member
Joined
Jul 23, 2018
Messages
12
I need some help please?

I have a range of cell B1:B500

These cells are TEXT from a Database output

format is

dd/mm/yyyy hh:mm:ss


In cell H7 I want to count the number of occurrences in the range, based on a prescribed date in cell G7

The issue I currently face is that each value is counted as one instance due to the HH:MM:SS elements in the range
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try:

=COUNTIFS($B$1:$B$500,">="&G7,$B$1:$B$500,"<"&G7+1)

If that doesnt work then try to use text to columns and see if that converts them. Saving that come back and ill write it differently.
 
Upvote 0
No as that would be incorrect. That would be tomorrow. Its essentially saying greater than or equal to the first second of today or less than the first second of tomorrow.
 
Upvote 0
If you do not need the date and time in the same cell, you could take the following approach...

1. Highlight Column B
2. Go to the data tab in the ribbon
3. Select "Text to Columns"
4. Select "Delimited"
5. Select "Next"
6. Deselect "Tab" & Select "Space"
7. Select "Next"
8. Set your "Destination" as the next blank column in your spreadsheet
9. Select Finish

This will separate your data into a "Date" column and a "Time" column. You can now format them as such and your countif should work properly when referencing the date.
 
Upvote 0
If it is text and the format follows your local date protocols then you can say:

=SUMPRODUCT(($B$1:$B$500>=G7)*($B$1:$B$500 < G7+1))<g7+1))<g7+1))< html=""></g7+1))<g7+1))<>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,449
Messages
6,159,930
Members
451,604
Latest member
SWahl

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