+ Reply to Thread
Results 1 to 8 of 8

How to increase space between the digits of a number within a cell ?

  1. #1
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,647

    How to increase space between the digits of a number within a cell ?

    Hi everybody,

    I am generating the random numbers through randbetween() function in a cell. Is there any way to increase the spaces between the digits of the obtained random number within a cell. For example if I generate randbetween(100,9999), I get the random number 3729 while I want this number to be appeared like 3 7 2 9 in the same cell so that I can treat this as a single number in a cell.
    Please don't suggest any vba code since I will not be able to understand that.

    Thanks in advance.
    Last edited by sktneer; 05-14-2013 at 02:25 AM.

  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,917

    Re: How to increase space between the digits of a number within a cell ?

    1st, please dont use colors and large font, it is not necessary and just takes up space.

    2nd what do you mean by..."so that I can treat this as a single number in a cell"?
    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
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: How to increase space between the digits of a number within a cell ?

    =text(randbetween(100,9999),"0 0 0 0")

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,647

    Re: How to increase space between the digits of a number within a cell ?

    Point 1: I have removed the formatting as per your suggestion.
    Point 2: I mean I want to use it as a single number in other calculations.
    I hope that I have made my point clear.
    Thanks.
    Quote Originally Posted by FDibbins View Post
    1st, please dont use colors and large font, it is not necessary and just takes up space.

    2nd what do you mean by..."so that I can treat this as a single number in a cell"?

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,647

    Re: How to increase space between the digits of a number within a cell ?

    This will convert that number into the text therefore it can not be used in other calculations.
    Quote Originally Posted by Teethless mama View Post
    =text(randbetween(100,9999),"0 0 0 0")

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to increase space between the digits of a number within a cell ?

    =randbetween(100,9999)

    And use custom format in this way

    0 0 0 0
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,647

    Re: How to increase space between the digits of a number within a cell ?

    Thanks Fotis !
    You provided the perfect solution. Thanks a lot dear.
    Quote Originally Posted by Fotis1991 View Post
    =randbetween(100,9999)

    And use custom format in this way

    0 0 0 0

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to increase space between the digits of a number within a cell ?

    ..............................

+ 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