+ Reply to Thread
Results 1 to 8 of 8

Adding Text to a Formula

  1. #1
    Registered User
    Join Date
    07-20-2017
    Location
    bne
    MS-Off Ver
    2013
    Posts
    9

    Adding Text to a Formula

    Here is the formula, =($C$1919-C1991) &" Friday "
    $C$1919 = 5.81833
    C1991 = 5.82187

    Result -0.00354000000000099 Friday

    What I would like is -0.00354 Friday
    Tried setting the format but can never change the result.
    Given up google searching for an answer.
    thanks gazza
    Attached Images Attached Images

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Adding Text to a Formula

    Use a format of

    0.00000 " Friday"
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    07-20-2017
    Location
    bne
    MS-Off Ver
    2013
    Posts
    9

    Re: Adding Text to a Formula

    That was quick.
    Changed the format to custom, the attached is the result.
    The sample never changes.
    Did I do the format correctly?
    Attached Images Attached Images

  4. #4
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Adding Text to a Formula

    It won't work as your cell formula is returning a string. The cell formatting will only work if the cell contains a value

    Two options:

    1) Format within the cell conditions using GK's formula. Edit the cell formula so it just does the calculation but doesn't add any text i.e. =($C$1919-C1991)

    or

    2) Edit the cell formula to =TEXT($C$1919-C1991,"0.00000")&" Friday"
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Adding Text to a Formula

    Works for me....

    The values in the source cells can NOT be 5.81833 and 5.82187... as they would not give the result you get. they must be simply formatted to look like 5 dps.

    In the file attached, I changed C2 to lots of dps. The formatted cell (F2) shows the desired result (5 dps) and the nformatted result shows all the dps. Does this not work for you?

    Posting a PICTURE of a sheet is of very limited value... post the sheet.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Adding Text to a Formula

    Quote Originally Posted by AskMeAboutExcel View Post
    It won't work as your cell formula is returning a string. The cell formatting will only work if the cell contains a value

    Two options:

    1) Format within the cell conditions using GK's formula. Edit the cell formula so it just does the calculation but doesn't add any text i.e. =($C$1919-C1991)

    or

    2) Edit the cell formula to =TEXT($C$1919-C1991,"0.00000")&" Friday"
    That will work... but the value will no longer be a number.

  7. #7
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Adding Text to a Formula

    I think that's the issue - from the OP's original post they are using the formula
    =($C$1919-C1991) &" Friday "
    , so number formatting isn't having an impact

  8. #8
    Registered User
    Join Date
    07-20-2017
    Location
    bne
    MS-Off Ver
    2013
    Posts
    9

    Re: Adding Text to a Formula

    The suggestion of using this formula 2) Edit the cell formula to =TEXT($C$1919-C1991,"0.00000")&" Friday"
    worked for me.
    thanks

+ 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] Adding a text superscript to the end of a formula
    By OverKnight in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2021, 12:32 PM
  2. Adding Text to A Box With a Formula
    By mercysakesalive in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2014, 03:02 AM
  3. Adding text with a formula...?
    By synses in forum Excel General
    Replies: 3
    Last Post: 07-31-2012, 04:30 PM
  4. Adding text to formula
    By arnab0711 in forum Excel General
    Replies: 1
    Last Post: 06-04-2012, 07:33 AM
  5. Adding text to a formula?
    By cocco in forum Excel General
    Replies: 6
    Last Post: 03-08-2012, 01:50 PM
  6. Adding text in same cel as formula??
    By dugexcel in forum Excel General
    Replies: 6
    Last Post: 01-06-2009, 10:05 AM
  7. [SOLVED] Adding text to a formula
    By horseman in forum Excel General
    Replies: 3
    Last Post: 04-19-2006, 09:25 AM

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