+ Reply to Thread
Results 1 to 17 of 17

Timezone difference

  1. #1
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Timezone difference

    Hi all,
    I'm struggling to work out how to show how many hours difference there is between 2 timezones, especially when they are on different days.
    I'm in the UK so Sydney is 11 hours ahead of me (which is tomorrow) but excel only seems to want to count backwards for this time.
    Does anyone know how i can fix this?

    Cell D26 is set as =NOW() formatted hh:mm:ss
    Cell D29 pulls another timezone from a formula also formatted hh:mm:ss

    I would like D33 to show the difference in time such as +5:00 or -5:00.

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Timezone difference

    If you have want to know how the difference between 00:30 and 23:30, then you would use something like:
    =24+"00:30"-"23:30"
    but how would excel know whether to count forwards or backwards?

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Timezone difference

    Perhaps this with a custom format of +0.00;-0.00;0.00.
    .
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Timezone difference

    Oops, ignore my formula, I copied it wrong.

  5. #5
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Thank Norie,
    but i'm still getting the output of -998635.93

  6. #6
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Even with =IF(D26>D29,D26-D29,D26-D29)*24 i'm still getting -19 when it should be -5

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Timezone difference

    My formula is wrong, I did have something I thought was working but when I tried changing it for your cell references I mucked up.

    By the way, what exactly do you have in the cells?

  8. #8
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Cell D26 is =now()
    Cell D20 is has the time in the chosen City

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Timezone difference

    Could you use something as simple as this to indicate if the time is Ahead or Behind? Or, am I missing something?
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then this to determine the number of hours:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Thank newdoverman but when I tried that formula it gives an output of 0.791666667 when I'm looking for -5

  11. #11
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Timezone difference

    At Jimmisavage, you need to format D33 to time and that should change the decimals into hours.
    I think 24+D29-D26 would give you the correct answer for the difference between two times when one is the day after the next.

    However, the bit I still don't get if you have:
    21:30 in D26
    and
    04:30 in D29

    Then how do you know if it is 04:30 the next day or 04:30 the previous day, somewhere you need to tell it whether the time is ahead or behind.

  12. #12
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Hi yudlugar,
    If I format the cells the date and time it understands that its a day ahead but i don't want the date to show on my spreadsheet. Does that help at all?

  13. #13
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Timezone difference

    I think an example workbook might help here. Do you mean that the values in the cells are date&time values that you have formatted to show only a time?

    In which case I would expect the other solutions that are posted would work, although I believe
    =abs(D26-D29)
    would also work. You just need to format D33 to time

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Timezone difference

    Can you upload a representative workbook as this shouldn't be as difficult as it is turning out to be?

  15. #15
    Forum Contributor
    Join Date
    10-30-2006
    MS-Off Ver
    O365
    Posts
    311

    Re: Timezone difference

    Hi sorry for the delay - here is an attachment: Office Address and Timezones.xls

    Now a perfect example is when I search for COL (buy typing COL into cell D13) it should say -5 hours but instead it gives me -14:18??

    It's fair to say I'm pretty stumped right now! Any help would be appreciated.

    Thanks again

  16. #16
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Timezone difference

    Hi - your attachment works fine, the formula in F22 is correct.

    The problem is that some of your times in column E on the office sheet are hard typed, so are not related to the current time.

    For example, COL has a time of 19:00:00 hard typed. If you change this so that it is the correct time relative to the current system time then it will give you the correct answer..

  17. #17
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Timezone difference

    I found a few entries that were made by direct entry and an inconsistency in the formulae in the time column. I fixed these and applied Conditional Formatting to the column that you have coloured.
    Attached Files Attached Files

+ 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. Timezone Conversion
    By denroi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2021, 10:19 AM
  2. Dropdown Timezone
    By dazzlerellis in forum Excel General
    Replies: 3
    Last Post: 12-19-2012, 12:54 PM
  3. Timezone calculations
    By filky in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2008, 07:48 AM
  4. timezone calculation
    By j_anne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2007, 04:09 AM
  5. Timezone calculations
    By tangomj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2007, 09:01 PM

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