Calculate waiting times that spans two days

hi
I'm attaching a file that shows the following - date, start time, finish time. If the start and finish times are within the same day, it's fine - but how do I show the time waiting if it spans a couple of days. Does the person entering have to enter the complete start date with start time and ditto for finish date and time or can they some how incorporate the date into the formula? Thanks
Time_and_date_question.xlsx
LVL 1
agwalshAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rgonzo1971Commented:
HI,

pls try
=+IF(C4<B4,1+C4,C4)-B4

Open in new window

shorter
=IF(C4<B4,1)+C4-B4

Open in new window

Regards
0
Saqib Husain, SyedEngineerCommented:
Even shorter
=C4-B4+(C4<B4)

Open in new window

0
ShumsDistinguished Expert - 2017Commented:
Rather I would use full date & time and use below formula:
=IF(OR($B7="",$C7=""),"",IF(TEXT(C7,"d")-TEXT(B7,"d")>=1,DAY($C7-$B7)&" Days "&HOUR(MOD(C7-B7,1))&" Hours"&" Waiting Time",HOUR($C7-$B7)&" Hours"&" Waiting Time"))

Open in new window

Please find attached...
Time_and_date_question_v1.xlsx
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ShumsDistinguished Expert - 2017Commented:
If you want to be more specific between 23 hours and days, then use below:

=IF(OR($B7="",$C7=""),"",IF(INT((C7-B7)*24)=24,DAY($C7-$B7)&" Days"&" Waiting Time",IF(INT((C7-B7)*24)>24,DAY($C7-$B7)&" Days "&HOUR($C7-$B7)&" Hours "&"Waiting Time",HOUR($C7-$B7)&" Hours"&" Waiting Time")))
Please find attached...
Time_and_date_question_v2.xlsx
0
Rob HensonFinance AnalystCommented:
Including Start Date and Finish Date would make the formula much simpler.

Start Date in column A
Start Time in Column B
End Date in column C
End Time in column D

Formula:

=(C3+D3)-(A3+B3)

Result with custom format [hh]:mm. This custom format will allow the hours to go over 24 when more than one day.

See attached.

Thanks
Rob
Time_and_date_question.xlsx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agwalshAuthor Commented:
The person I am helping is not an experienced Excel person and my suggestion to her was actually the Rob Henson one but I just wanted to check that there wasn't something fairly obvious and not too complex that I was missing.  Good answer @Shums - but I *know* she won't use that and while there seems to be more work in adding an extra column, I reckon that's the way to go...Thank you both
0
ShumsDistinguished Expert - 2017Commented:
Do you need any changes?
0
agwalshAuthor Commented:
Got lots of "ferrari" solutions but ended up going with a slighter longer winded set up but which I know would be easier for the user to understand. thanks to all.
0
Rob HensonFinance AnalystCommented:
Thanks for the feedback.

If the waiting time will only ever be 24 hours or less, albeit the finish time could be the next day, there could be another option whereby you can use the existing set-up with only the start date.

Start Date in Column A
Start Time in Column B
End Time in column C

=IF(C3>B3,C3-B3,(A3+1+C3)-(A3+B3))

See attached.

The first suggestion would not take weekends into account, ie starting something on a Friday afternoon but not finishing until Monday morning. For this scenario, the first suggestion would add 48 hours for the weekend whereas this suggestion would assume it is the next day.

Thanks
Rob H
Time_and_date_question.xlsx
0
agwalshAuthor Commented:
The weekend is not an issue in this scenario. And the waiting time could possibly go on longer - but thanks :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.