Time variance

reganshaw

Board Regular
Joined
May 6, 2005
Messages
77
I'm sure this is an easy one but I just can't quite figure it out... :confused:

Cell A1 = 20:00
Cell A2 = 20:10

I want cell A3 to show the variance between the 2 in whole minutes. ie;

Cell A3 = +0:17

Can you help me with the formula and cell formatting?

Thanks in advance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hello, reganshaw,

try this
=(A2-A1)*24

(perhaps you still want to round, else you can change the numberformat to 2 decimals)

kind regards,
Erik

EDIT: if you wanted some more info
time-calculations are performed in "days" so 20:10 - 20:00 = a fraction of a day (about 0.0069)
 
Upvote 0
you're welcome !!

I just saw a problem: my experience with timecalculations is limited :)
When the calculation needs to go "over midnight" you will have a problem.

so you would better use
Code:
=(A2-A1+(A2<A1))*24

best regards,
Erik
 
Upvote 0
Thanks Erik & Yogi.

The revised formula works well however;

In my spreadsheet, cell A1 holds the Scheduled time. Cell A2 holds the Actual time. With the revised formula if A1 = 00:00 and A2 = 23:30 (event took place 30 minutes early) the formula returns a value of 23.5

With the first formula you provided Erik, I can resolve the "past mindight" issue by continuing with the 24 hour clock. For example 01:00 would be data entered into cell A2 as 25:00. This returns a value of 1.0 if the scheduled time was 00:00 and I can still return a negative value if the Actual time is earlier than the scheduled time.

Long story short... the first solution works perfect!

Thanks again to you both.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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