+ Reply to Thread
Results 1 to 8 of 8

Thread: format text and number

  1. #1
    Registered User
    Join Date
    10-15-2011
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    45

    format text and number

    hi all ,

    can some body can help me on this,


    a1 contains = r12

    b1 i want it as = 000r12

    is there any way to do this.

  2. #2
    Valued Forum Contributor
    Join Date
    06-09-2010
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    346

    Re: format text and number

    does this formula work for you (in cell B1):

    ="000"&A1

  3. #3
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,297

    Re: format text and number

    Hi

    ..Where will you use the 000r12 result??

    Because a simple way to do this, is to use a helper column.

    A1=r12 >> C1(helper & hide column)>>(Texr Format)>>000. Then in B1=C1&A1

    Hope to helps you.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  4. #4
    Registered User
    Join Date
    10-15-2011
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: format text and number

    sorry i di not give the clear information in a coloumn their are diffrent varities

    like

    a1: r12
    a2 :123h
    a3:125a

    but all i want in 6 digits

  5. #5
    Valued Forum Contributor
    Join Date
    06-09-2010
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    346

    Re: format text and number

    how about
    =IF(LEN(A1)>5,A1,REPT("0",6-LEN(A1))&A1)

  6. #6
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,297

    Re: format text and number

    ..Then try this:

    =IF(LEN(A2)=3;"000"&A2;IF(LEN(A2)=4;"00"&A2;IF(LEN(A2)=2;"0000"&A2;IF(LEN(A2)=5;"0"&A2;""))))

    Is it ok for you?
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  7. #7
    Registered User
    Join Date
    10-15-2011
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: format text and number

    hi all ,

    thank you so much

    i have found a simple way, it might be useful to you also some times
    =RIGHT("000000"&a1,6)

  8. #8
    Valued Forum Contributor
    Join Date
    06-09-2010
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    346

    Re: format text and number

    neat!

    Do you ever have values with more than 6 characters - if so, how do you want them treated? Your formula will give the right six characters, mine would give the whole of A1

+ 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.2.0