+ Reply to Thread
Results 1 to 5 of 5

Separating digits

  1. #1
    Registered User
    Join Date
    03-30-2005
    Posts
    2

    Separating digits

    Is there a way in Excel to separate out part of a number? For example, if I have the number 154000. I want to be able to write a formula that extracts the 50000, but not get any of the other numbers. I want to be able to do this for each place in the number. If anyone knows of a way to do this, I would be grateful. Thanks!

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Assuming your number (154000) is in cell A10, the following formula will return 100000:

    =(--MID(A10,FIND(RIGHT(A10,6),A10),1)*100000)

    =(--MID(A10,FIND(RIGHT(A10,5),A10),1)*10000) will return 50000

    =(--MID(A10,FIND(RIGHT(A10,4),A10),1)*1000) will return 4000

    and so on....

    note the use of the double negative that forces Excel to take the Text value returned by the MID and RIGHT functions and treat them as numeric values.

    Good Luck

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    Here's what I quickly came up with:

    Put 1234567 in Cell A1.

    Then in Cells B1 through B7 put:
    7
    6
    5
    4
    3
    2
    1

    Then put this formula in Cells C1 and copy it through C7:
    =FLOOR(MOD($A$1,10^B1),10^(B1-1))

    It may not be exactly what you're looking for but maybe it will put you on the right track.

    Regards,
    Ron

  4. #4
    Registered User
    Join Date
    03-30-2005
    Posts
    2

    Thanks!

    The MID formula worked great! Thanks for the help.

  5. #5
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    You are most welcome. Glad it worked for you. Thanks for the feedback.

    Cheers!

    Bruce

+ 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