Date Time

Johnboy

Board Regular
Joined
Oct 25, 2004
Messages
144
On Sheet1 column A is date time formatted "dd-mmm-yy hh:mm:ss", Sheet2 contains the following formula:

=SUMPRODUCT(--(Sheet1!A7:A50000>=I34),--(Sheet1!A7:A50000<=K34),--(Sheet1!J17:J50010="a"))

Which works, but the dates in on Sheet2 I34 and K34 automatically assume 12:00:00 PM and end up missing any entry before 12 PM on start date and after 12 PM on end date. I would like to have the formula to reflect I34 and time 00:00:01 and k34 and time 23:59:59 without having to put hours in cells I34 and K34.

Thanks
Johnboy
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
They will automatically assume 12am times on those dates if you don't include any h:m:s. So maybe you should set it as:

=SUMPRODUCT(--(Sheet1!A7:A50000>=I34),--(Sheet1!A7:A50000<=K34+1),--(Sheet1!J17:J50010="a"))
 
Upvote 0
perhaps:

=SUMPRODUCT(--(Sheet1!A7:A50000>=(I34+TIMEVALUE("00:01")),--(Sheet1!A7:A50000<=(K34-TIMEVALUE("00:01")),--(Sheet1!J17:J50010="a"))
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

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