+ Reply to Thread
Results 1 to 8 of 8

Concatenating numbers as text and retaining text format

  1. #1
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Concatenating numbers as text and retaining text format

    Column C has numbers downloaded in text format, i.e. each cell has a green smart tag and a value might be 000 or 001. In Column A, when I refer to column C in a concatenation, the 001 is showing in column A as 1. So the number as text is being converted to a number format after the concatenation is applied. Rather than having this, I would like to retain the values in Column C as is, i.e. 000 should stay as 000 and 001 should remain 001 when they appear in column A.

    I forgot how to do this.


    Initially I tried to start by retaining the values in column C as follows.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Concatenating numbers as text and retaining text format

    When you select the cell in column C, what's the value in the formula bar? Is it "1" or "001"?

    If it's "1", you can concatenate using
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: Concatenating numbers as text and retaining text format

    Hi, how does your concatenation looks like?
    If you concatenate a text with col C, value in col C shall remain 001 e.g. A001.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  4. #4
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Concatenating numbers as text and retaining text format

    Quote Originally Posted by millz View Post
    When you select the cell in column C, what's the value in the formula bar? Is it "1" or "001"?

    If it's "1", you can concatenate using
    Please Login or Register  to view this content.
    The cell has 001 with a green smart tag, and the formula bar also has 001. But for some reason, when I concatenate, it converts the 001 to a 1.

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Concatenating numbers as text and retaining text format

    So, like Alvin asked, how are you concatenating? You did not give any information on that part

  6. #6
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Concatenating numbers as text and retaining text format

    Quote Originally Posted by alvin-chung View Post
    Hi, how does your concatenation looks like?
    If you concatenate a text with col C, value in col C shall remain 001 e.g. A001.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

    Here is my code:

    Please Login or Register  to view this content.
    I checked the values in C and they are displayed AND stored as 001, 002, etc. So it looks like they are already in text format. The For loop does the concatenation. The leading zeros are dropped of, and the hyphen is being read as a subtraction sign and a subtraction is being done.

    How do I retain the leading zeros so that I get something like 1813-001 instead of 1812?

  7. #7
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Concatenating numbers as text and retaining text format

    That's because you are setting it into a formula.

    Try changing to this:

    Please Login or Register  to view this content.

    Edit: If you must use a formula, try this
    Please Login or Register  to view this content.
    Last edited by millz; 01-19-2014 at 09:29 PM.

  8. #8
    Forum Contributor
    Join Date
    12-15-2009
    Location
    Herndon, VA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Concatenating numbers as text and retaining text format

    Quote Originally Posted by millz View Post
    That's because you are setting it into a formula.

    Try changing to this:

    Please Login or Register  to view this content.

    Edit: If you must use a formula, try this
    Please Login or Register  to view this content.
    Thank you very much. It worked. I clicked Add reputation for you.

    I also tried to understand the formula way of doing it, but I keep getting lost with all those quotations and ampersands. Thank you for your help.

+ 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. Changing numbers from text format to number format
    By garden_gnome in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2012, 12:48 PM
  2. Retaining formatting when using the text function
    By dotsofcolor in forum Excel General
    Replies: 2
    Last Post: 01-03-2012, 03:06 PM
  3. Retaining number format in a text string
    By bngms in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-27-2007, 11:31 AM
  4. [SOLVED] Format text to numbers
    By Jamesy in forum Excel General
    Replies: 3
    Last Post: 01-10-2006, 03:10 PM
  5. Convert numbers from text format to number format
    By merlin68 in forum Excel General
    Replies: 4
    Last Post: 04-12-2005, 09:06 AM

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