+ Reply to Thread
Results 1 to 5 of 5

How to get first or second digit number from the random formula

Hybrid View

  1. #1
    Registered User
    Join Date
    01-29-2021
    Location
    United State
    MS-Off Ver
    Microsoft Office Standard 2016
    Posts
    5

    How to get first or second digit number from the random formula

    I am using =RAND()*(1128-1008)+1008 this formula for B3, and it is generating random numbers.

    When B3 number is starting 8, I want to put 8 in the C3. When B3 number is starting 9, I want to put 9 in the C3. When B3 number is starting 10, I want to put 10 in the C3.

    I used left formula for C3, but if B3 number is starting 10, I want C3 to show 10. But with my left formula, I can not use it.

    What should I do?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-18-2019
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    21

    Re: How to get first or second digit number from the random formula

    Have you considered using the RANDBETWEEN function? For example, =randbetween(0,100)?

  3. #3
    Registered User
    Join Date
    10-18-2019
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    21

    Re: How to get first or second digit number from the random formula

    This is probably closer to what you're looking for: =(TRUNC(RANDBETWEEN(0,100)*((1128-1008)+1008)/1000))

  4. #4
    Registered User
    Join Date
    01-29-2021
    Location
    United State
    MS-Off Ver
    Microsoft Office Standard 2016
    Posts
    5

    Re: How to get first or second digit number from the random formula

    It is not working with RANDBETWEEN function.

  5. #5
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,463

    Re: How to get first or second digit number from the random formula

    If I understand correctly, I believe this formula will do what you want...

    =INT(B3/100)
    Last edited by Rick Rothstein; 02-08-2021 at 05:25 PM.

+ 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. Replies: 2
    Last Post: 10-09-2020, 03:53 PM
  2. Random generating a 10 digit number that only contains specific digits.
    By mutzie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2017, 09:46 AM
  3. Replies: 20
    Last Post: 05-10-2016, 06:05 PM
  4. Replies: 3
    Last Post: 03-19-2016, 01:11 AM
  5. Replies: 6
    Last Post: 08-31-2015, 03:08 PM
  6. Replies: 10
    Last Post: 11-24-2011, 10:34 AM
  7. [SOLVED] Random 8 digit number?
    By KennyS in forum Excel General
    Replies: 6
    Last Post: 08-21-2006, 01:30 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