Tracker
HOME    TRACKER    Excel

# Calculating Time Across A 24 Hour Period

## Calculate certain time increments for various work-shifts. I have a start time,finish time and increments of time across the spectrum of 24 hours. There are also multiple start time across the 24 hour period with some start times begining on one day and ending on the next day. Example In B5 Startime is 22:00 In C5 Finishtime is 06:30 In I3 increment begins at 00:00 In I4 increment ends at 00:30 The employee working the shift from 22:00 - 06:30 would fall into the time increment of 00:00 - 00:30 where another employee working a different shift (08:30 - 17:00) would not. I'm looking for a formula that would return a 1 in a cell if the employee fell into the 00:00 - 00:30 time increment and a 0 in a cell in the employee did not fall into the time increment.

Related Forum Messages:
Chart Over A 24 Hour Period
I'm attempting to chart 3 series over a 24 hour period (8am-8am). The 3 series are captured in 1 minute intervals. My X axis intervals is displayed hourly though. My issue is, charting goes bad at 00:00:00. i.e. it stops.

Here are the values I have on my X axis

min: .33333
max: 1.35
maj: .04167
min: .00347
cross at: .33333

Any ideas how I can get from 8am to 8am?

Changing Date/time To Run A 12 Hour Production Schedule, And Not 24 Hour
I have created a daily schedule which has a number of factory variables taken into consideration which determine the date and time a particular product should, barring any mechanical problems, come off the machine. (see attached spreadsheet).

The date at the top will be editable by me only so that when I update the production quantities, the “date/time off” column automatically re-adjusts to the remaining quantities.

The formulas are a little long winded, but I have left them that way whilst I try and develop it. I should be able to figure out how to condense them later.

My problem is that the “date/time off” on the right works excellent, but over a 24 hr period.

Ordinarily, we work a 12 hour day (6am to 6pm) with overlapping shifts to cover breaks, and 20 mins warm up at the start of the day for the machine, thus maximising a 12 hour day.

Of course if demand exceeds the allotted time we put on overtime.

Is it possible to specify that normal days are only 12 hours so that if a product exceeds 6pm, it flows into the next day with the balance starting at 6:20am?

And, if the production for the week exceeds the time could I stipulate particular days which we deem are suitable for overtime? Ie, we decide Wednesday is a 14 hour day and not 12.

I had toyed with the idea of creating a 365 day table/calendar, on another worksheet which would have its individual allocated hours in an adjacent column and somehow link them to the date/time off, perhaps by way of a VLOOKUP, but I have been chasing my tail trying to figure out how to implement it.

CONVERT 24-Hour Time To 12-Hour Time
I have a list of FLIGHT departure times that are listed in MIL TIME, however, there is no : in the format. Its just 4 or 3 digit numbers. I need to convert these to time in 12-hour clock. If I go to FORMAT/CELL/TIME and select 1:30pm it simply makes the time ZERO!

Convert To 12-hour Time From 24-hour Time
I'd like to convert from 24 hour standard time to 12 hour time using VBA code. For example: instead of 13:00 I need 1:00.

Calculating If A Period Is During A Workday
I have two dates in this format:

start: 17.07.2009 11:00:00
end: 17.07.2009 14:00:00

i need to check if the period in between those is during a workday.

our workday starts at 10:00:00 and finishes at 19:00:00

so my expected result is 3 hours. (1400-1100)

other example:

start: 17.07.2009 11:00:00
end: 18.07.2009 11:00:00

result is 1900-1100 + 1100-1000

= 9 hours

because it is during two workdays...

is there a way to calculate this in VBA?

Calculating Episodes Per Hour
I need to calculate the number of calls my operators take per hour of the day in order to calculate the busiest times of the day. Each call is time stamped and captured but now how do I calculate the total number of calls taken between 07:00:00 and 07:59:59 etc etc for the whole 24 hour period?

Calculating The Number Of Business Days In A Specified Period
It should be deplaying dates of weekly days in Monday, Wednesday and Friday excluding sundays. Or Tuesday, Thursday Saturday excluding Sunday. e.g

Mondays, Wednesdays and Fridays of June
June 1, 2006
June 3, 2006
June 6, 2006

Tuesdays, Thursdays and Saturdays of June
June 2, 2006
June 5, 2006
June 7, 2006

This should be happening after entering any date on the first cell of the List and should accommodate up to 3 months

Automatically Change Cell (With Time) Color After Time Period Has Passed
I have a protected worksheet. Users wish to be able to track changes in the input cells. The suggested approach for this is to temporarily disable sheet protection and allow them to change the font color, then protect afterwards. What I would like to do is:

i) check whether they are in an input cell
ii) if so, then prompt the user with the 'Font Color' dialog box
iii) apply the font color selected to the input cell

I'm struggling to find the dialog box I need. I can launch the one to change the interior color, no problem (Application.Dialogs(xlDialogPatterns).Show). But that's no use to me, I just want a color palette that specifically relates to the Font Color

Count Number Of Full Time Periods Within A Time Period
I have thousands of timestamps that have a start & end date and time in 2 separate columns. (one named start and one named end...)

I also have numerous set time periods that i'm interested in.. (about a dozen or so)

for example 01/01/2008 - 05/01/2008, 07:30:00 - 10:00:00

What i need is to be able to count the number of times the full time period i am interested (07:30:00 - 10:00:00) in falls in between the thousands of start and end timestamps i have. The time periods must also fall within the date range specifed.

So if my timestamps were
Start: 01/01/2008 06:30:00 & End: 02/01/2008 11:00:00, based on the set time period above, there would be a count of 2

and if my timestamps were
Start: 01/01/2008 07:05:00 & End: 02/01/2008 09:00:00 there would be a count of zero as there is not a full uninterupted timeperiod 07:00:00 - 10:00:00 between these timestamps.

and if my timestamps were:
Start 01/01/2007 07:00:00 & End 02/01/2007 10:00:00 the count would be zer as this is a year early!

Time W/in Each Hour Of Day Btwn A Time Range
I need a formula to calculate the time (in hours/fractions of an hour) that is "covered" for each hour of the day between a range of times. In other words, I have a "START TIME" and an "END TIME" and for each hour of the 24-hour clock, I want to know how much time this range covers.

For example, if my start time is 3:30am and my end time is 5:15am, for the 3am hour, the formula would return 0.5 hours, for the 4am hour it would return 1.0 hours, for the 5am hour it would return 0.25 hours, and for all other hours it would return 0.0 hours. The range of START TIME and END TIME can be up to 24 hours (but not more), but the tricky part is that the START TIME can be on the day BEFORE the END TIME (e.g., START TIME of 10:35pm and END TIME of 5:45pm the next day).

Time Sheet :: 12 Hour Time Format With AM/PM
I found a formula for calculating time in the HH:MM AM/PM

=IF(B1<A1,B1+1,B1)-A1

This formula was to give me total hours in the cell for which it is entered, and cell format for the formula was in military format.

I cannot find this post. The formula worked in OpenOffice Calc program, but when it came to converting to excel, I came up with #value!

I want to enter the time in 12 hour format and using am/pm to designate. I am making it for someone to make work schedules with and they do not know military time.

24 Hour Double Time
I have a timesheet which for certain days of the year calculates double-time. What i would like to do is have a formula that gives double time for a 24 hour period. I have a formula setup with a start time and end time for my double time, but it wont stop at midnight.

I have a start time in cell A1 (say 9am entered as 900), cell B1 has a time interval (25min), Cell C1 gives total (925). Cell B2 has the next time interval (56min). How do I get cell C2 to give total of 1021 rather than 981? Values in columns B and C continue on down.

Time Trial Period In My Spreadsheet
I've searched a few of the posts here about freebies in terms of adding a trial period to your spreadsheet. I'm just starting to get into VBA programming (beginnner), but I was wondering if anyone here could suggest actual programs or add-ins that I could buy that would allow me to create a trial version of my spreadsheet? either by allowing the user to use it for a few days or to allow the user to use it for a specifed # of times.

I'm willing to pay for this, but I can't afford those expensive Licensing/Copy protection programs....I need a simple solution in between \$20 and \$60....

Work Out The Value Of Cars Over A Period Of Time
I have a project where I have to work out the value of cars over a period of time.

The cars depreciate at 36.9% per year over a 5 year period and I can't work out for the life of me how to create a formula in excel that give me the values at the end of each year.

Each car costs £10000 and I need to know what the value of each car is at the end of each year

Converting Time Period In Hours
How do I convert 7.30 hours into 7.21 (ie 7 hours 21min.) Note I do not wish
to use the standard hour:minute formatting.

Graphing - Selecting Specified Time Period
I have sheet that is populated with data daily. I wish to create graphs from information contained within a table in this sheet where i can select the start date and end date of the graph possibly from a drop down menu. I will be creating multiple graphs and wish for them all to change when i select the time period.

Working With Time: Blocks Every Whole Hour
I have a spreadsheet that users input the temperature each hour, for a 24 hour period. The time used is 24hr clock, as example, cell A1 will be 03:00, and cell B1 would be the forecasted temperature.

On another sheet, the user inputs the temperature for the specific time a airplane is going to take off, i:e: 07:32. Is there a way I can have the second sheet look back to the first sheet and grab the temperature for the correct time (using the hour block it falls into). The first sheet time blocks are every whole hour, i.e 08:00, but on the second sheet, the time could be any hour/minute, 07:32.

Count Time (entries Per Hour)
I have a bunch of data and I want to be able to count the number of entries that fall within each of the 24 hour increments in a 24 hour clock. (military time)

For 12:00:00 all times would be between and including 12:00:00 and 12:59:59

Column B | Count
------------------
12:00:00 344
13:00:00 44
14:00:00 5

Convert Hh:mm.* To 12 Hour Time Format
I have a ton of time in the above format (hh:mm.*) that needs to be converted to a 12 hour format (2:15 PM). I'm not wonderful with formulas, but if it's explained "simplistic" enough, I can probably get it. Please help - I've googled this to death every possible way. I can go in an manually change 19:37.5 to 7:37 pm - but it will take me FOREVER!

How To Get The (average Or Sum) In A Limited Period Of Time
This code help me in typing the date and time in any cell of column (B) automatically just in case I enter somthing in any adjacent cell of column (A)

Automatically Close UserForm After Time Period
I have the following code in a simple userform containing only a label:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub UserForm_Activate()
DoEvents
Sleep 4000
End Sub

When I invoke this as a single macro in a blank workbook and immediately change focus by pressing ALT+TAB to enter NotePad the userform is shown and exits normally after 4 seconds.

However, when I issue this code from within a larger macro, and hit ALT+TAB to Notepad, the excel application hangs on the displayed userform until I click back into Excel.

If required, I can happily send you the code as an attachment.

Chart A Graph Of Jobs Over A Period Of Time
I have an Access database, with a table of jobs processed.

One column for Job ID (Unique), Date it was processed, By Who it was processed and Comments ascoiated.

I need to chart a graph of Jobs over a period of time. How many jobs done per date. In excel preferebly, I have programs like Database Plus for excel. And I am familiar with VBA. I can't figure out how to uniquely sort how many jobs for each date. As there are numerous job entries for on the same dates. I think it can be done with an SQL query or sorting it with VBA somehow. Any help will be greatly appreciated. Or can anyone suggest an application designed for charting with Access databases in Excel?

Extract Hour From Time In Cell Using VBA
If I had a cell containing a time, 06:30 in A1 for example, how would I use VBA in the following argument:

If the hour in A1

12-hour Time Entry Stored As Text
I have a problem with entering 12-hour time data in excel.

If I key in 3:00, Excel will recognise it as 3:00 AM.
If I key in 3:00 p, Excel will recognise it as a text entry. To get Excel to recognise it as 3:00 PM, I have to use the 24-hour format. i.e. I have to type 15:00.

I have checked the Regional and Language option in the Control Panel. Everything looks fine.

Does anyone have such encounter with Excel before?

Add Hour/minute To Time On Other Cell
I am creating a Little League Schedule and want to start Saturday games and have the lower cells ad 2hr 45min to whatever time I post in the upper cell

Autofill Date/Time: Increment By 1 Hour
I have a column with dates + time under this format: 2005-01-01 00:00:00. I wanted the same thing for the whole year, so, I wrote 2005-01-01 01:00:00. in the cell below, and then did an autofill.

Unfortunately, at some point, the cell goes from
2005-01-05 03:00:00
to
2005-01-05 03:59:59
which is a problem for me, because I was using the hour as an indicator.
And hour(2005-01-05 03:59:59) returns 3 and not 4!

Timesheet: Calculate Time Within A Period When Crossing Midnight
I am creating a timesheet using excel 2003 users enter their shift start/finish time and a break start/finish time. Emplyee's can work night shifts (ie across midnight).

There are penalty rates which apply at different times. I need to be able to work out the amount of worked time that fits into a certain time period. eg. 10pm-7.30am, 7.30am-10pm.

I have a solution based on A clever formula from Daniel Maher that will calculate time within a period. But it doesn't work when the shift goes over two days.

I have attached a spreadsheet to help show the problem .......

Automatically Close If A User Is Inactive For A Period Of Time.
We have one shared excel workbook and it is used by many people (more than 20 simultaneously), is there any way to auto save & close the workbook (session) if a user is inactive for specified time.

Pivot Tables To Find Max Value In Time Period
I have a in field column M of my table that gives the week number of various dates within the table.

I would like to find the high value reached during each week based on the Highs which are located in column P, the highs consist if workdays during each week number.

I would like this to appear as a new calculated field entitled "Week High", I am assuming I need to input a custom formula to do this. I also want to create calculated fields for the the high reached during each year, the year is in column L

Stop Macro Running After Specfied Time Period
I'm opening a workbook and then running the macro in the workbook. The problem is I would like to build a "timeout" feature if the macro is running too long (as some of the macro's this will run can take days to complete) but I don't know how to run the macro asynchronously. Also I need to know if i can get it to run asynchronous is there an event that will tell me when the process is finished. The calling application of the macro is written in VB6 and opening excel workbooks to run the macros out of. also the "timeout" feature must be done from the VB6 application it cannot be edited into the the workbooks containing the macro.

Round Total Time To One Hour Multiples With A Minimum Of Two
I need a basic formula that will take my start time from my end time and round it up to the next hour with a two hour minimum. I formated my cell to not have decimals and I tried to use round and roundup along with and if/then formula but no luck. If it makes any difference, all times are in 24hr format.

Round Up A 24HR Format Time To The Nearest Quarter Of An Hour
Is it possible to round up or down a 24HR time format.

ie. 18:06 would be 18:00
18:28 would be 18:30?

Calculate A 24 Hour Cycle Time Which Excludes Weekends And Public Holidays
I would like to find out if a job took more than 24 hour cycle time (eg. 6:00 am to 5:59:59 AM next day). data:

A1 = received date & time (format "m/d/yyyy h:mm")
B1 = completed date & time (format "m/d/yyyy h:mm")

my formula is '=if(B1-A1>"24:00"+0,"Yes","No"). The problem with the formula is that it doesnt exclude weekends nor public holidays. I couldnt formulate a solution using networkdays function......

Calculate Future Dates From Start Date With Varying Time Period/cycle
I need to determine a formula which will allow me to calculate a future date based upon a current date with varying time periods.

For example:

I have a bill which is paid on the 15th and last business day of each month. I would like to be able to see the next due date regardless of what day of the week it is.

I have a bill which is paid every other Tuesday. I would like to know the next due date without having to enter +14 for every due date in the future. In other words, it is preferable to be able to open the spreadsheet and automatically see the next due date, not use autofill to repeatedly add +14 to a previous date which would limit the # of future due dates that could be calculated.

I have a bill which is paid on the last business day of each month, not the last Friday of each month. I would need excel to return a value for the last day of the month which = Monday-Friday, regardless of what day of the week it may be as long as it isn't Saturday or Sunday(holiday exclusion would be nice but not required).

Calculating Time Owed Based On Time Worked
I know the title is a bit vague, but I cant think how else to word it!

I have a sheet (attached) which works out hours worked, and if the amount is under a specified target, it counts how much time is owed. The problem occurs when someone works more hours than the specified target.

I guess I need an IF formula of some kind, to say if the figure is over the target, to put zero in the hours owed column.

Calculating Time And A Half And Double Time (After 40 Hours)
I'm battling to come up with the formula to calculate time and a half and double time. My boss wants me to show the overtime worked AFTER 40 hours has been worked. I have attached a copy of my spreadsheet.

Calculate Work Hour Phone Time By Day, Week & Month
I am trying to figure out a way to count the minutes used from 8am-5pm Monday-Friday. I have this years worth of data. I would like to do it by month and by week and by day. I use office 08 for the mac and its my understanding that it doesn't have VBA. I would also like to be able to figure out if on a certain date a employee made over x amount of phone calls in a day. But have several employees. I have columns that are labeled date, employee, minutes used.

Calculating Using Time
Firstly, i'd like cell G5 to show the amount of time worked i.e diff between E6 & F6. Secondly I'd like help with the formula for cells AF6 & AG6 which would require AB6-AC6 divided by the frames, every time I try it I get a messed up answer.

Calculating Time In
=INDEX({"\$5.00","\$3.00","You Were Late"},MATCH(L17,{7:00am,7:05am,7:06am},1))

i have this formula in excel...this formula sanrv1f posted to help with another question (values changed) but i thought i would work with what i wanted but i get a (Value) error

so what im trying to do is base on the system time is if the person typed in

if they were early 6:45am to 7am they get Extra \$5 on top of the \$5 they get for being on time.

6:55am gets \$5
7:00am they get \$5.00 for being on time
if they type 7:01am to 7:05am they get \$3.00
if they type 7:06 to 7:10am would return You Were Late
after 7:10am would return No Pay

so Ex

7am would get \$5

7:03am am would get \$3

7:07am would get You Were Late

7:11am Would get No Pay

if they were on time 5 times (ie 5days in a row) they would get a bonus of \$20 i tried factoring this in could not do it :/

Calculating Time
basically I need an excel sheet to calculate the period of time between cells.

For instance, in A1 I write:

18-Feb-10

In A2 I write:

13:00

Unfortunately I cannot write 18-Feb-09 13:00 in just one cell because it doesn't work.

Now, in B1 I write 19-Feb-10

and in B2 I write 15:14

Now we know that 26 hours and 14 minutes have elapsed between these two times. So if I want this to automatically be calculated in B3, what do I do?

Also, how do I apply the formula to all cells in column 3 so all I have to type in is the date (in column 1) and the time (in column 2)?

Calculating Value, Based On Time
I am trying to write what I believe is a fairly simple set of calculations to determine non-qualified stock option values. Before this digresses into a discussion of the merits of Black-Sholes methodology, I must tell you that this is a "101" type sheet. I'm not an economist.

The deal is that my sister (for whom I'm constructing this worksheet), gets employer stock options which vest at different intervals.

In the past year, she's gotten some options that vest in two, four, and five year increments. I'm using Excel 2002, with the analysis toolpak, and stock pricing add-in from MS.

Have today's date, date of option grant, and can easily compute time (in years) until options are fully vested.

The trick is that options with a 2-year vesting period are 50% excerciseable in one year, 100% in two.

Four-year options are excerciseable 25% per year for 4 years; 5-year are 20% for 5 years, etc.

I'm trying to write a single date-driven formula to take each grant (individually), and divide it by the appropriate divisor (based on the current date), to figure out the current value.

I can't seem to quite figure it out how to write a formula which can handle:

Shares Strike Price Date of Grant Years Until Vested Value
100 26.57 1/4/2003 5
245 45.67 2/6/2001 4

Value should equal =

(if today's price is grater than Strike Price)

(Current Price * (Shares * (% vested which is based on "date of grant" + "years until vested")) )

-

(Strike Price * Shares * (% vested which is based on "date of grant" + "years until vested") )

how the math to make the "% vested multiplier" work...

Calculating Time Blocks
I am trying to calculate the amount of time in blocks, using a pre-determined spread. For example:

AM block is anytime between 0600-1230
PM block is anytime between 1230-1830
Evening block is anytime between 1830-0000 and the Overnight block is anytime between 0000-0600

Sounds easy enough, yeah? Let me paint an example of how I want it to calculate though:

If an employee starts at 0600 and finishes at 1400, then the AM total is 6.5 and the PM total is 1.5.

If an employee starts at 1100 and finishes at 1900, then the AM total is 1.5, the PM is 6 and the Evening is 0.5.

If an employee starts at 2200 and finishes at 0800, then all of the 10 hours must report to the Overnight total, even though some of them fall within the Evening and AM blocks.

I just can't seem to get each block to show the accurate number of hours...and to bring in the rules that I require.

Calculating Time Variance
I'm trying to calculate the variance between planned date & time of arrival vs actual date & time of arrival.

I attach the workbook as am a bit useless at explaining myself....

What I've done is in H14 subtract the actual date of arrival (F14) from planned date of arrival (C14). This result is the only way I could think of dealing with crossing over midnight. As a result I14 should subtract the actual time of arrival (E14) from planned time of arrival (B14):

=SUM(E14-B14,H14)

This method works well when the arrival was later than expected but doesn't work if the arrival was sooner than expected.

Long Calculating Time
I managed to put together an array formula to calculate the last date that a rep made a sale. It checks two other tabs in the workbook to find the date, and if none is found, it leaves the cell empty.

{=IF(MAXA(IF('Daily Compliance'!A:A=B48,'Daily Compliance'!O:O),IF('Daily Compliance 11-07 to 4-08'!B:B=B48,'Daily Compliance 11-07 to 4-08'!A:A))=0,"",MAXA(IF('Daily Compliance'!A:A=B48,'Daily Compliance'!O:O),IF('Daily Compliance 11-07 to 4-08'!B:B=B48,'Daily Compliance 11-07 to 4-08'!A:A)))}

But it takes sometimes up to 4-5 minutes to make the calculations. Is there possibly a way to simplify it so that it calculates faster, with the same results?

Calculating Flexi Time
I have two questions about a spreadsheet where I am trying to calculate how much flexi time has been accured.

So far I have managed to do this: ....

I have a sheet to calculate Time Elapsed based on StartDT & EndDt taking into consideration the actual working hours in any working day and the function exclude the weekend. I am not a guru in excel but i found this formula in this website .

=IF(AND(INT(StartDT)=INT(EndDT),NOT(ISNA(MATCH(INT(StartDT),HolidayList,0)))),0,ABS(IF(INT(StartDT)=INT(EndDT),ROUND(24*(EndDT-StartDT),2),
(24*(DayEnd-DayStart)*
(MAX(NETWORKDAYS(StartDT+1,EndDT-1,HolidayList),0)+
INT(24*(((EndDT-INT(EndDT))-
(StartDT-INT(StartDT)))+(DayEnd-DayStart))/(24*(DayEnd-DayStart))))+
MOD(ROUND(((24*(EndDT-INT(EndDT)))-24*DayStart)+
(24*DayEnd-(24*(StartDT-INT(StartDT)))),2),
ROUND((24*(DayEnd-DayStart)),2))))))
the formula works perfectly except for the fact that in our part of the world we have "Friday & Saturday" as the weekend days instead of Saturday and Sunday.

is there a way to get this formula or any similar formula to take different weekend days and do exactly what i need?

Calculating Turn Around Time ..
I've browsed the net searching for a solution to my problem and found one solution altough not entirely what i was after, but it was very close. It was provided on another forum, of which i'm not a member.

[url] ...

I have a TAT target of <= 2hours, however this is complicated by weekends, holidays and jobs received after working hours and on weekends. I've attached the file, which contains detailed information about my problem.

Calculating Turn Around Time Between Two Times
i want to calculate the TAT between two times. the TAT target is <= 2 hours. i used the following formula

b1 has 7:08 AM (received time)
c1 has 3/13/2009 (completed date)
d1 has 9:08 AM (completed time)
e1 has TAT formula :- '=IF((D1-B1)*1440<=120,"Met TAT","Not Met TAT")

however this formula does not work in the following conditions.

In these conditions, it is considered that TAT is met.
1. When the difference in time is <=2 hours .... for TAT calculation, on working days and working hours are taken into consideration.

To illustrate.
Day begins : 8:00 AM
Day ends : 4:00 PM

If job is received at 3:30 PM and completed the next working day by 9:30 AM, then it is considered TAT is met.
calculation = 4:00 PM - 3:30 PM = half hour + next day's 9:30 AM - 8:00 AM = 1.5 hours, therefore, total working hours used to complete the job is within the agreed TAT.

If job is received and completed on non working days and during non working hours, it is considered TAT met.

If job is received almost at the end of the day, say, 3.30 PM and job is completed at 8:00 PM same day, then it is considered TAT met, rationale, only half an hour of working hours used to complete the job.

Calculating Date AND Time Differences
Within 4 columns, I have a series of:
Start Dates / Start Times / End Dates / End Times
I need to create a formula which will give me the sum total of the difference between the data sets.

For example, the time difference between 8am on the 20th March and 1pm on the 21st March is 29 hours OR 1 day and 5 hours.
I need a formula which will calculate this for me.