+ Reply to Thread
Results 1 to 6 of 6

How do I create text string using hh:mm without is changing to decimal fraction?

  1. #1
    Registered User
    Join Date
    01-22-2020
    Location
    UK
    MS-Off Ver
    365 Proplus
    Posts
    2

    How do I create text string using hh:mm without is changing to decimal fraction?

    Hi all,

    I have a timesheet that I fill every day, sometimes I split my hour-long work and have 2 or even 3 sessions, all of which need reporting in PST (I'm GMT).

    The attached image shows my set-up, I put in my start/stop time and it gets switched to PST in the 4th and 5th column.

    It's a pain to copy and paste from two excel boxes as the formatting still needs changing but this would be so much quicker and easier if I could create a string box containing my start and stop times with a dash in between them.

    I found the fourmula =D22 & " - " & C22 but it changes the times (ie 15:22) to a decimal fraction.

    I have my time columns and the one I'm using for the test formula formatted as Custom/time/hh:mm and have tried all the other formats but none allow this, all of them change the time to a fraction except text, which just puts the cell number!

    Any help would be great, thanks!

    sheet clip.png

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How do I create text string using hh:mm without is changing to decimal fraction?

    Does this work

    =TEXT(D22,"hh:mm")&" - "&TEXT(C22,"hh:mm")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: How do I create text string using hh:mm without is changing to decimal fraction?

    Try it this way in K28:

    =TEXT(D28,"[h]:mm") & " - " & TEXT(E28,"[h]:mm")

    or you might prefer:

    =TEXT(D28,"hh:mm") & " - " & TEXT(E28,"hh:mm")

    though this will wrap every 24 hours.

    Hope this helps.

    Pete

  4. #4
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: How do I create text string using hh:mm without is changing to decimal fraction?

    Usely I use TEXT function, But it is depends on regional settings and in my country formula looks like
    =TEXT(D28,"чч:мм") & " - " & TEXT(E28,"чч:мм").
    for international it could
    =INT(D28*24)&":"&MOD(D28*24;1)*60&" - "&INT(E28*24)&":"&MOD(E28*24;1)*60
    Last edited by BMV; 01-22-2020 at 12:53 PM.

  5. #5
    Registered User
    Join Date
    01-22-2020
    Location
    UK
    MS-Off Ver
    365 Proplus
    Posts
    2

    Re: How do I create text string using hh:mm without is changing to decimal fraction?

    Brilliant thanks all - I have a solution that works, I can use this on another sheet too and will save me much time and fiddlyness!

    Thank you all for replying!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: How do I create text string using hh:mm without is changing to decimal fraction?

    Glad to hear that you found a solution, and thanks for marking the thread as Solved.

    You might also like to know that you can show your appreciation directly and thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Problems converting fraction as a text cell to a decimal
    By KTENHAKEN in forum Excel General
    Replies: 4
    Last Post: 12-09-2019, 01:38 PM
  2. [SOLVED] Text fraction conversion to decimal
    By Mad Myk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-17-2019, 04:11 PM
  3. Fraction is read as decimal when text is combined in new cell
    By robclark63 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-30-2017, 11:24 PM
  4. Converting Decimal to Fraction Text VBA
    By vbalearnerSF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-27-2014, 02:38 PM
  5. [SOLVED] " / " Changing Decimal number format to Fraction on Protected Cell
    By laudie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-14-2005, 10:15 PM
  6. [SOLVED] " / " Changing Decimal number format to Fraction on Protected Cell
    By laudie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-14-2005, 09:15 PM
  7. How do I change a text fraction. eg 1 1/2 into a decimal number, .
    By antac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2005, 01:06 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