+ Reply to Thread
Results 1 to 5 of 5

Retain number values when changing formatting to text

  1. #1
    Registered User
    Join Date
    06-24-2020
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013 15.0.5249.1000
    Posts
    3

    Retain number values when changing formatting to text

    I have a column of numbers I've converted to three digits by adding a leading zero. I need to add them to a column in a separate sheet using a concatenating formula. I have tried every which way to convert the column formatting to text (including using special pasting to create a new column) but the formatting always reverts to special. If I leave as is, the column won't concatenate properly on the new sheet (it drops the leading zero). Has anyone had this problem and found a solution? I wonder if it has to do with my version of excel because this wasn't a problem in the past. Thank you!

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Retain number values when changing formatting to text

    I presume you have real numbers where the leading zero was added by using Custom Formatting. You can concatenate this value into a text string using the TEXT function. So, if cell A1 contains your number, you can use this to concatenate the value with its leading zeroes...

    TEXT(A1,"000")

  3. #3
    Registered User
    Join Date
    06-24-2020
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013 15.0.5249.1000
    Posts
    3

    Re: Retain number values when changing formatting to text

    That seems like the correct solution (thank you for that!), but I don't think I am working it into the formula correctly. Here is what I did:

    =CONCATENATE("000000s",data!H2," cau",data!TEXT(A2,"000")," g o vl",data!B2," d")

    The final product should look like this:

    000000s2019 cau212 g o vleng d

    (It's the code for a library record for a video recording in English that's 212 minutes long.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Retain number values when changing formatting to text

    Quote Originally Posted by daryne View Post
    =CONCATENATE("000000s",data!H2," cau",data!TEXT(A2,"000")," g o vl",data!B2," d")
    What I highlighted in red is located incorrectly... it belongs attached to the A2 cell reference, not the function using it.

    =CONCATENATE("000000s",data!H2," cau",TEXT(data!A2,"000")," g o vl",data!B2," d")

  5. #5
    Registered User
    Join Date
    06-24-2020
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013 15.0.5249.1000
    Posts
    3

    Thumbs up Re: Retain number values when changing formatting to text

    You are my absolute hero. Thank you so much. It worked beautifully.

+ 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. Remove duplicate number values but retain text value via vba
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2015, 03:42 PM
  2. Replace text string in a cell and retain rich text formatting (Excel 2013)
    By CharlieBear in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-15-2015, 04:39 PM
  3. Excel 2010: Retain changing cell values - web query
    By John19 in forum Excel General
    Replies: 1
    Last Post: 12-20-2014, 12:43 PM
  4. Paste number from EXCEL to WORD and retain formatting
    By DKolev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2014, 07:40 PM
  5. Pivot is changing values from Number to Text ?!?!??
    By MichaelDude in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-19-2014, 12:20 PM
  6. [SOLVED] Changing number values into sequential text values.
    By alex.l_91 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2013, 02:37 AM
  7. Pivot doesn't retain number formatting from macro
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2010, 04:51 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