+ Reply to Thread
Results 1 to 2 of 2

Need Help Fixing UTC to US Eastern Time Zone Formula

  1. #1
    Registered User
    Join Date
    03-09-2022
    Location
    Columbia, South Carolina, USA
    MS-Off Ver
    365
    Posts
    1

    Need Help Fixing UTC to US Eastern Time Zone Formula

    Good day, folks:

    I just registered an account to seek help on this. I have created a formula to convert UTC timestamps to US Eastern Time Zone with DST conditions. I would paste it here, but I keep getting an error despite using the wrap formula tag. (Please see the attached workbook.)

    It appeared to work just fine at first; however, after inspecting the results, I am finding that some dates are not converting properly, as the "IF AND" criteria #3 is indicating a value of False. I have attached an example workbook to demonstrate the issue.

    The formula is supposed to check the following:
    1. If the target cell is empty, make the resulting cell empty.
    2. If the target cell is not empty, check whether the following three conditions are true:
    a. The date occurs on or after the 2nd Sunday of March.
    b. The date occurs before the 1st Sunday of November.
    c. The time hour value is greater than or equal to 7 (i.e. 07:00:00 AM).
    3. If the three above conditions are TRUE, subtract 4 hours from the target cell (converts the timestamp to Eastern Daylight Time, UTC-4)
    4. If any of the three above conditions are FALSE, subtract 5 hours from the target cell (converts the timestamp to Eastern Standard Time, UTC-5).

    I have been toiling with this function for a long while and I have been unsuccessful finding a solution. Your help would be greatly appreciated.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Need Help Fixing UTC to US Eastern Time Zone Formula

    Please try

    B2

    =IF(A2="","",
    IF(AND(HOUR(A2)>=7,
    (A2>=DATE(YEAR(A2),3,1)+(7+MAX(0,7-WEEKDAY(DATE(YEAR(A2),3,1),11)))),
    (A2<=DATE(YEAR(A2),11,1)+(MAX(0,7-WEEKDAY(DATE(YEAR(A2),11,1),11))))),A2-TIME(4,0,0),
    A2-TIME(5,0,0)))


    or

    =IF(A2="","",A2-
    IF(AND(HOUR(A2)>=7,
    (A2>=DATE(YEAR(A2),3,1)+(7+MAX(0,7-WEEKDAY(DATE(YEAR(A2),3,1),11)))),
    (A2<=DATE(YEAR(A2),11,1)+(MAX(0,7-WEEKDAY(DATE(YEAR(A2),11,1),11))))),TIME(4,0,0),
    TIME(5,0,0)))

    Regards.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula to get time zone from 2 letter state ID
    By devildogdad76 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-14-2019, 01:13 AM
  2. How to convert from indian time zone to US time zone
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-18-2018, 05:42 AM
  3. formula to convert eastern time to central time
    By Shellybelly in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2015, 07:20 AM
  4. Eastern Time to PST
    By erickguz in forum Excel General
    Replies: 2
    Last Post: 03-22-2008, 06:46 PM
  5. Converting Eastern time to Central time
    By DonaldM210 in forum Excel General
    Replies: 5
    Last Post: 08-12-2006, 04:52 PM
  6. [SOLVED] How to set a formula to convert the time zone
    By Calculate Date range in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2006, 03:50 AM
  7. Replies: 4
    Last Post: 03-31-2006, 08:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1