+ Reply to Thread
Results 1 to 5 of 5

Take data from one column and separate out numbers and letters into two new columns

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    3

    Take data from one column and separate out numbers and letters into two new columns

    Okay so I have a column of data that has one of the following four configurations two numbers (ex. 20), two numbers and a letter (ex. 16M), three numbers (411), three numbers and a letter (234P). The letters are always at the end if there is a letter (there are a couple instances where there are two letters but I could go in and hand change those if that causes a problem).

    I want to separate out the numbers and letters so that one column would have: 20,16,411,234 and the other column would have (blank),M, (blank),P ( I don't want it to say blank I just want it to be empty)

    What should I do?
    If a solution involved adding a leading 0 to the two numbers I would be fine with that as that will be my next step.

    Thanks!

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Take data from one column and separate out numbers and letters into two new columns

    Say your data is in column A.

    In B1 enter:
    =IF(ISNUMBER(--RIGHT(A1,1)),A1,--LEFT(A1,LEN(A1)-1))
    and copy down. Column B is for numbers

    In C1 enter:
    =IF(ISNUMBER(--RIGHT(A1,1)),"",RIGHT(A1,1))
    and copy down. Column C is for the trailing text.
    Gary's Student

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Take data from one column and separate out numbers and letters into two new columns

    Thanks for the reply - the first part of it worked great - The numbers are separating just fine and showing up in the appropriate column. However, the second part is leaving me with a strange result. It's putting numbers in the column where the letters should be. For example 16M was my original entry and it is separating out into 16 and then 7 (not m). 17M has turned into 17 and then 8 (not M), 235P is now 235 and 4 (not P)....any insights?

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Take data from one column and separate out numbers and letters into two new columns

    Jakobshavn's formula works..

    Shorter version

    In B1
    =IF(ISNUMBER(A1),A1,LEFT(A1,LEN(A1)-1))*1

    In C1
    =IF(ISNUMBER(A1),"",RIGHT(A1,1))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    09-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Take data from one column and separate out numbers and letters into two new columns

    Thanks Ace_XL. Your version worked perfectly. Sorry but when I entered the first one I wasn't getting the same results, maybe the whole --Right part? Anyways, thank you very much!

+ 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