+ Reply to Thread
Results 1 to 7 of 7

Extracting Numbers Before and After A Comma

  1. #1
    Registered User
    Join Date
    05-09-2011
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    44

    Extracting Numbers Before and After A Comma

    Hi there,

    I'm not sure if this is at all possible, but I have a cell column with a collection of numbers. Example : 90,104,155.

    I'm trying to figure out a way to extra these numbers into different columns. I only managed to extract the number prior to the first comma "," with the following formula.

    Please Login or Register  to view this content.
    Does anyone have any idea how I can extract the second and third (104 and 155) set of numbers?

    Appreciate if anyone could assist.

    Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,297

    Re: Extracting Numbers Before and After A Comma

    Hi treeantz,

    Find the attached with the answer.

    Study this formula and save it for later. I use it about once a week.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-09-2011
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Extracting Numbers Before and After A Comma

    Thanks MarvinP, that works very well. Appreciate your help.

  4. #4
    Registered User
    Join Date
    05-09-2011
    Location
    *
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Extracting Numbers Before and After A Comma

    Hi MarvinP, I tried your formula on a different spreadsheet this time but it didn't seem to work. Would you by any chance be able to assist me with this?

    On my new spreadsheet, A1 now contains a similar data to the one below.

    1;"0";"Last Name";"First Name";"my@email.com";"0123456789"

    I changed the formula to
    Please Login or Register  to view this content.
    while it managed to pick up for the first value "1" but the rest are returning as #VALUE!

    Do you happen to know what needs to be changed to have this working?

    Appreciate if you could help.

    Thanks in advance.

  5. #5
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Extracting Numbers Before and After A Comma

    have you tried select column --> data --> Text to column?

    This can handle several different type of deliminators!
    Regards,
    Vandan

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,297

    Re: Extracting Numbers Before and After A Comma

    I key on the comma in A1. It looks like you are putting in semicolons and other stuff. That wasn't the original problem. As the problem changes so does the answer.

    The formula I gave expands every comma in a string to a bunch of spaces. Because of how many spaces it puts in (the number is the length of the original string) you can pull back the 1st or 2nd or last part of the string based on where they were. You would use the Mid function for this extraction.

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Extracting Numbers Before and After A Comma

    the "value" is giving the error......in your sample only the 1 is true number..all are text
    Please Login or Register  to view this content.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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