Subtracting time to produce time in previous day.

HighAndWilder

Well-known Member
Joined
Nov 4, 2006
Messages
660
Office Version
  1. 365
Platform
  1. Windows
Hi

I would like to be able to subtract a combination of hours, minutes and seconds from a date and time.

The resultant time may be in the previous day and that is where the problem is.

For example :

10/08/2019 01:08:00

I would like to be able to subtract 1 hour and 15 minutes from this time which should result in the following:

09/08/2019 23:53:00 a time in the previous day.

Does anybody know how to do this?

I would like to represent the time elements to subtract as negative numbers and add them to the time so that I can, using the above example, add minus 1 hour and minus 15 minutes to 10/08/2019 01:08:00.

Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This works
- adapt to your own situation
Excel 2016 (Windows) 32 bit
[Table="width:, class:head"][tr=bgcolor:#E0E0F0][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][th]
E
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
1
[/td][td]Time[/td][td]Hours[/td][td]minutes[/td][td]result[/td][td] formula in D2[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E0E0F0]
2
[/td][td]
10/08/2019 01:08​
[/td][td]
1​
[/td][td]
15​
[/td][td]
09/08/2019 23:53​
[/td][td] =A2-(B2+C2/60)/24[/td][/tr]
[/table]
[Table="width:, class:grid"][tr][td]Sheet: Sheet1[/td][/tr][/table]


I would like to represent the time elements to subtract as negative numbers and add them to the time so that I can, using the above example, add minus 1 hour and minus 15 minutes to 10/08/2019 01:08:00.
- unsure what this means:confused:
- if you cannot figure out what to do based on above example, then post a table of required results including both positive and negative examples
 
Upvote 0
Below is for US date system. One hour and 15 mins is (1.25 hours/24 hours/day) days.
Excel Workbook
AB
18/10/2019 1:088/9/2019 23:53
Sheet1
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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