Allocating Minutes by Hour of Day

Status
Not open for further replies.

IA2022

New Member
Joined
May 4, 2022
Messages
6
Office Version
  1. 365
I have written a formula to allocate minutes for a case duration to each hour (columns E through AB). However, if the case goes over into the next day it evaluates 12pm as being < 1am and makes the statement false. In the attached spreadsheet, row 2 shows this. Row 3 allocates the minutes correctly. Is there another way to allocate minutes by hour of day?

Test.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1StatusCase Duration MinutesActual Start Time Actual Out Time 12:00 AM1:00 AM2:00 AM3:00 AM4:00 AM5:00 AM6:00 AM7:00 AM8:00 AM9:00 AM10:00 AM11:00 AM12:00 PM1:00 PM2:00 PM3:00 PM4:00 PM5:00 PM6:00 PM7:00 PM8:00 PM9:00 PM10:00 PM11:00 PM
2Incorrect6111:09:00 PM12:10:00 AM0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00
3Correct6011:09:00 PM11:10:00 PM0.000.000.000.000.000.000.000.000.000.000.000.000.0051.0060.0060.0060.0060.0060.0060.0060.0060.0060.0010.00
Sheet 1
Cell Formulas
RangeFormula
E2:AB3E2=IF(AND(HOUR($C2)=HOUR(E$1),HOUR($D2)=HOUR(E$1)),$B2,IF(OR($C2>E$1+(1/24),$D2<E$1),0,IF(AND(E$1>$C2,E$1+1/24<$D2),60,IF(HOUR(E$1)<=HOUR($C2),24*60*(MAX(0,E$1+(1/24)-$C2)),24*60*($D2-E$1)))))
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Duplicate to: Allocating Minutes by Hour of Day

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

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