I have a large amount of date/time fields that need to be changed in excel. I need to subtract 2 hours from the current date/time format ISO 8601.
Ex: 2006-09-21 16:45:00 +0000 <----Changed to------>2006-09-21 14:45:00 +0000
I was able to parse the data into separate columns and subtract 2 hours using this formula: =B1+TIME(2,0,0) and then concentrate the columns back.
I ran into a problem when the time is 01:59:99 or less. It gives me #######
Anyone have a formula to subtract 2 hours from ISO 8601 format. Please and thank you.
This should help, if your original value is in Cell A2:
=IF(NUMBERVALUE(MID(A2,12,2))<2,LEFT(A2,8)&TEXT(NUMBERVALUE(MID(A2,9,2))-1,"00")&" "&TEXT(NUMBERVALUE(MID(A2,12,2)-2+24),"00")&RIGHT(A2,12),LEFT(A2,8)&TEXT(NUMBERVALUE(MID(A2,9,2)),"00")&" "&TEXT(NUMBERVALUE(MID(A2,12,2)-2),"00")&RIGHT(A2,12))
Thanks, Tim
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.