TImes

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
316
Office Version
  1. 2007
Hello I have a spreadsheet formatted to time format. With over 1000 times.
Im trying to calculate the times between 2 cells, whether its a plus or minus. So for example if cell a2 is 19:00 and cell b2 is 19:30 there is difference of -30 minutes as its late.
However if cell b2 is 16:30 then its a plus 02:30 hours as its early..

Any ideas how i can work this out?
Thanks in advance for any help anyone can give me
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
you need date as well as time to do elapsed time in case it crossed midnight.
1/1/2022 19:30, 1/2/2022 4:30,
 
Upvote 0
Is this what you want?
+Fluff 1.xlsm
ABC
1
219:0019:30-30
319:0016:30150
Primary
Cell Formulas
RangeFormula
C2:C3C2=(A2-B2)*1440


If not please post some sample data giving expected results.
 
Upvote 0
Hello Yes this is partly what I require, is there a way I can do this?

1st dose given4 Hours Between2nd Dose due2nd Dose given (actual time)
03:00​
04:00​
07:00​
07:30​
00:30​
30 mins late
09:30​
04:00​
13:30​
13:00​
########​
want it to show 30 mins early
21:00​
04:00​
01:00​
02:00​
########​
Want this to show 1 hour late
 
Upvote 0
But that is what the formula does
+Fluff 1.xlsm
ABCDE
11st dose given4 Hours Between2nd Dose due2nd Dose given (actual time)
203:0004:0007:0007:30-30
309:3004:0013:3013:0030
421:0004:0001:0002:00-60
Primary
Cell Formulas
RangeFormula
E2:E4E2=(C2-D2)*1440
 
Upvote 0
you need date as well as time to do elapsed time in case it crossed midnight.
1/1/2022 19:30, 1/2/2022 4:30,
Thank you.
But that is what the formula does
Thanks for all your help, When I put this range in mine is showing differently, will this be a formatting issue do you think? third row of data should be -60 but its showing 1380!

1st dose given4 Hours Between2nd Dose due2nd Dose given (actual time)
03:00​
04:00​
07:00​
07:30​
-30​
30 mins late
09:30​
04:00​
13:30​
13:00​
30​
want it to show 30 mins early
21:00​
04:00​
01:00​
02:00​
1380​
Want this to show 1 hour late
 
Upvote 0
Check that none of those times contain a date element.
 
Upvote 0
Then I don't understand how you get 1380 as that is 23hrs.
Did you format the cells to show dates?
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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