+ Reply to Thread
Results 1 to 12 of 12

Converting time format, inserting leading zero and adding +3 hours

  1. #1
    Registered User
    Join Date
    09-02-2011
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    91

    Post Converting time format, inserting leading zero and adding +3 hours

    Hi guys i would appreciate if someone help me with formula which can convert AM/PM time to 24hours, then add 3 hours, and insert leading zero only from 1 to 9.

    see attachment example click here
    Attached Images Attached Images
    Last edited by godlev; 09-07-2011 at 10:10 AM. Reason: SOLVED

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Converting time format, inserting leading zero and adding +3 hours

    Here, try this:

    =TEXT(A1+"3:00", "hh:mm:ss")

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Converting time format, inserting leading zero and adding +3 hours

    First use custom format to format the cells as hh:mm:ss.

    Then type 03:00:00 in a spare cell and copy it (Ctrl-C)

    Select the target cells, goto Paste>PasteSpecial, and click the Add box

    Then clear that spare cell.

  4. #4
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Converting time format, inserting leading zero and adding +3 hours

    Hi,

    First thing, please do not use a picture as an attachment. In future please attach the excel file with dummy data. That is a forum rule.

    You can easily convert the time zone to 24 hrs.Just select all the cells, then go to format cells. Select Custom and under Type put in this "hh:mm:ss" Select OK and the format will be changed
    Formula for adding 3 hours

    Please Login or Register  to view this content.
    Please let me know if it doesnt work

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Converting time format, inserting leading zero and adding +3 hours

    Quote Originally Posted by inayat View Post
    First thing, please do not use a picture as an attachment. In future please attach the excel file with dummy data. That is a forum rule.
    To be more precise, it's not a forum rule. It's an advice how to get your answer quickly.
    Because if you post a picture we'll probably ask you to upload example workbook, so you save time...

    But sometimes picture helps too...

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Converting time format, inserting leading zero and adding +3 hours

    Hello godlev,

    I assume your "time" data is actually text, in which case try this formula in D6

    =MOD(REPLACE(A6;LEN(A6)-1;0;" ")+"3:00";1)

    Now format D6 in required time format, e.g. hh:mm:ss and copy across and down
    Audere est facere

  7. #7
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: Converting time format, inserting leading zero and adding +3 hours

    Quote Originally Posted by zbor View Post
    To be more precise, it's not a forum rule. It's an advice how to get your answer quickly.
    Sorry Zbor... Just trying to do my bit for the forum. I had seen many posts wherein the forum gurus had asked for the workbook instead of picture. Sorry again...

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Converting time format, inserting leading zero and adding +3 hours

    No need for apology.

    And posting workbook will be aksed in the future because I (we) surely don't want to spend 15 minutes creating example for a 5 minute solution.
    But it's not against the rules to post a picture.
    it's just take more time for user to get solution

    keep up the good work.

  9. #9
    Registered User
    Join Date
    09-02-2011
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    91

    Re: Converting time format, inserting leading zero and adding +3 hours

    thank you for the responses ill post example spreadsheet from now on.

    but still i didn't got the right formula.

    can you please check the example sheet and check how it should convert.
    Attached Files Attached Files

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Converting time format, inserting leading zero and adding +3 hours

    As it's stored as text use daddylonglegs solution:
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-02-2011
    Location
    Bulgaria
    MS-Off Ver
    2013
    Posts
    91

    Re: Converting time format, inserting leading zero and adding +3 hours

    Great thank you all of you - this is the best forum for excel!

  12. #12
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Converting time format, inserting leading zero and adding +3 hours

    The answers you are getting assume you want to keep the original table and create a transformed table. If you want to transform the original, you need VBA, or take the approach I gave earlier.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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