Formula to subtract 1 hour from military time
Hello. I have what seems like a simple request yet I can't seem to figure out the formula. I have a column entitled START TIME formatted as hh:mm AM/PM. In a separate cell on the same sheet I want to take that START TIME, convert it to military time, and subtract 1 hour. From a previous thread I found the formula to convert to military time:
=(VALUE(LEFT([START TIME]@row, FIND(":", [START TIME]@row) - 1)) + IF(RIGHT([START TIME]@row, 2) = "pm", 12, 0)) + ":" + MID([START TIME]@row, FIND(":", [START TIME]@row) + 1, 2)
I've found numerous threads on how to find a duration by subtracting a start time and end time but I can't seem to find a formula to subtract a fixed amount from just the start time. Any suggestions?
Thanks in advance
Answers
-
Try this...
=((VALUE(LEFT([START TIME]@row, FIND(":", [START TIME]@row) - 1)) + IF(RIGHT([START TIME]@row, 2) = "pm", 12, 0)) - 1) + ":" + MID([START TIME]@row, FIND(":", [START TIME]@row) + 1, 2)
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65K Get Help
- 443 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 129 Brandfolder
- 150 Just for fun
- 70 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!