+ Reply to Thread
Results 1 to 18 of 18

Splitting a cell with a 3 digit number into three cells where the first digit may be 0?

  1. #1
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Splitting a cell with a 3 digit number into three cells where the first digit may be 0?

    Sorry guys for the trouble. I have been trying and trying to wrap my head around doing this and looked for some time now with nothing figured out. What I'm needing to do is I have a cell that has a 3 digit number in it, sometimes it will have a 0 as the first number. I need to take that three digit number and split it into three cells and keep the 0 in the first cell. Like if I have 097 in A1, I would need 0 in B1, 9 in C1 and 7 in D1. I need them to stay as numeric value so my formulas from another sheet will pick them up.

    I know this is something simple and I thought I had a formula for this on one of my discs, but I can not find it after a fresh reinstall.

    Thank you all so much!!!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Try this...
    B1=--left(a1,1)
    C1=--mid(a1,2,1)
    D1=--right(a1,1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    how are you managing to keep the 0 in front of 097? by custom number format?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by FDibbins View Post
    Try this...
    B1=--left(a1,1)
    C1=--mid(a1,2,1)
    D1=--right(a1,1)
    Thanks FD,
    I'll give that a try. I've been trying similar but been using MID.

  5. #5
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by humdingaling View Post
    how are you managing to keep the 0 in front of 097? by custom number format?
    Thank you for the reply humdingaling.

    Yes. Custom number format of 000.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by greenfox74 View Post
    Thank you for the reply humdingaling.

    Yes. Custom number format of 000.
    hmm then my suggestions wont necessarily work, because you could have only a 1 - or - 2 digit number. Will take another look

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

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Put your 3 digit number in A1 then..

    In B1 try =INT(A1/100)
    In C1 try =INT((A1-100*B1)/10)
    In D1 try =MOD(A1,10)
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  8. #8
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by FDibbins View Post
    Try this...
    B1=--left(a1,1)
    C1=--mid(a1,2,1)
    D1=--right(a1,1)
    That's close to one I have been trying. It's giving me 977 instead of 097. Closer than I was but still not picking up that 0 for some reason.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    B1=IF(LEN(A1)<3,0,--LEFT(A1,1))
    C1=IF(LEN(A1)=2,--LEFT(A1,1),IF(LEN(A1)<2,0,--MID(A1,2,1)))
    D1=no change

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by greenfox74 View Post
    That's close to one I have been trying. It's giving me 977 instead of 097. Closer than I was but still not picking up that 0 for some reason.
    See my post 6

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Marvin, nice 1

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    b1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    c1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    d1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by MarvinP View Post
    Put your 3 digit number in A1 then..

    In B1 try =INT(A1/100)
    In C1 try =INT((A1-100*B1)/10)
    In D1 try =MOD(A1,10)
    It keeps logging me off for some reason. I dunno. That one is giving me my 0 and the third digit is showing correctly, but giving me 07 for the second digit. Getting closer though.

  14. #14
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by FDibbins View Post
    B1=IF(LEN(A1)<3,0,--LEFT(A1,1))
    C1=IF(LEN(A1)=2,--LEFT(A1,1),IF(LEN(A1)<2,0,--MID(A1,2,1)))
    D1=no change
    It keeps kicking me off before I can reply. That got it FD. Thank you very much again!!!

  15. #15
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    Quote Originally Posted by humdingaling View Post
    b1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    c1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    d1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you very much for the help also humdingaling!!!
    That one is giving me my 0 also, but it's putting what isn't a 0 as TEXT for some reason. I think that would work also as far as it picking it up in my other formulas. I'll have to test that part.

  16. #16
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    A GIANT THANK YOU to all three of you for your help!!! This place has never let me down and is always full of amazing people that don't care to help someone out. I'd be nowhere with my work without you all!!!!!

    (Still not sure why it keeps logging me out.) But, that's OK.

  17. #17
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    If you keep getting logged out, make sure you check the "Remember Me" box

  18. #18
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Splitting a cell with a 3 digit number into three cells where the first digit may be 0

    another way may be if I am getting question right
    assuming your digit is in A1 then in B1
    =MID(TEXT($A1,"000"),COLUMN(A1),1)+0 drag to right
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

+ 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. Color a single digit in a mult-digit number cell
    By Phyllis in forum Excel General
    Replies: 8
    Last Post: 09-30-2022, 04:22 PM
  2. Convert 3 digit or 4 digit number to time format
    By dubcap01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-04-2015, 04:30 AM
  3. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  4. How to add check digit to 6 digit number string...
    By unclejemima in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-18-2013, 04:19 PM
  5. Replies: 3
    Last Post: 05-04-2013, 09:57 PM
  6. Replies: 2
    Last Post: 06-17-2010, 08:36 PM
  7. [SOLVED] How do I identify the 7th digit in a 13 digit number, then establi
    By Catherine in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2005, 02:06 PM

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