+ Reply to Thread
Results 1 to 12 of 12

Split Text to Numbers

  1. #1
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Split Text to Numbers

    Hi everybody,

    I have on column "A" below texts:

    1,256+45
    356,5000-12
    436,000+21

    There is not any space between first number, plus/minus sign and second number. I am willing to split this text to the numbers in each cell.

    Please see attached excel file.

    Is there any formula for above problem?

    Thanks in advance for your help.
    Attached Files Attached Files
    Last edited by soleimani1967; 05-23-2020 at 06:03 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    In B2 copied down:

    =VALUE(LEFT(A2,IFERROR(FIND("+",A2),FIND("-",A2))-1))

    In C2 copied down:

    =VALUE(SUBSTITUTE(A2,B2,""))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Re: Split Text to Numbers

    Thank you AliGW. Your formula as well as works.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Re: Split Text to Numbers

    Hi AliGW,

    Do you have any idea for changing format of left number from General to Accounting just like below texts?

    1,256+45
    3,565,000-12
    4,363,457+21
    253,637+34

    In this format, the second formula does not work.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    It works just by changing the formatting of that column:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    TEXT
    Left Number
    Right Number
    2
    1436700+24
    1,436,700.00
    24
    3
    76538-35
    76,538.00
    -35
    4
    987120+87
    987,120.00
    87
    5
    26762900-21
    26,762,900.00
    -21
    Sheet: Sheet1
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Re: Split Text to Numbers

    I mean that something like attached spreadsheet.
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    Use this in C2 copied down:

    =VALUE(SUBSTITUTE(SUBSTITUTE(A2,",",""),B2,""))

  9. #9
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Re: Split Text to Numbers

    Many thanks. It works now.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    It worked before on the data provided originally! Next time, provide ACCURATE sample data at the outset instead of shifting the goalposts.

  11. #11
    Registered User
    Join Date
    10-07-2015
    Location
    Tehran - Iran
    MS-Off Ver
    2013
    Posts
    71

    Re: Split Text to Numbers

    Yes. you are true. I took a mistake to post original sample data. I am so sorry.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Office 365 (Win 10 - Work) & Office 365 Subscription Insider (Win 10 - Home)
    Posts
    37,523

    Re: Split Text to Numbers

    No worries - just bear it in mind in future.

+ 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