Avatar of agwalsh
agwalsh
 asked on

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
Microsoft OfficeMicrosoft ExcelSpreadsheets

Avatar of undefined
Last Comment
agwalsh

8/22/2022 - Mon
SOLUTION
Rgonzo1971

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Saqib Husain

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Shums Faruk

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
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
agwalsh

ASKER
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
Shums Faruk

Do you need any changes?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
agwalsh

ASKER
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.
Rob Henson

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
agwalsh

ASKER
The weekend is not an issue in this scenario. And the waiting time could possibly go on longer - but thanks :-)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.