+ Reply to Thread
Results 1 to 10 of 10

formula to create a random date?

  1. #1
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    formula to create a random date?

    Hi everyone,

    Does anyone know how to create a random date? I'm studying for the bar exam and want to take 3 of the past exams each day starting on Monday until I take the exam on July 26. I'm attaching the worksheet as it currently stands. I'd really appreciate any help on this.

    Thanks in advance,
    Rob
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: formula to create a random date?

    from your example
    =INDEX($B$1:$B$103,RANDBETWEEN(2,103))
    will give a random date from col b
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: formula to create a random date?

    Thanks. I can make this work. Will it repeat at all, or will all of the dates it chooses be original? See attached.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: formula to create a random date?

    Quote Originally Posted by robbyvegas View Post
    Thanks. I can make this work. Will it repeat at all, or will all of the dates it chooses be original? See attached.
    you should change the formula at B2 become:
    =INDEX($A$2:$A$103,RANDBETWEEN(1,102))

  5. #5
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: formula to create a random date?

    Thanks!

    Now, I'd rather not take the same practice essay multiple times. Is there a way to set this up so that it only uses a randomly selected value once? The attached is a copy of the spreadsheet as it currently stands. The 3rd column is a countif to count the number of times a given random value appears.

    Thanks again!
    Rob
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: formula to create a random date?

    Quote Originally Posted by robbyvegas View Post
    Thanks!

    Now, I'd rather not take the same practice essay multiple times. Is there a way to set this up so that it only uses a randomly selected value once? The attached is a copy of the spreadsheet as it currently stands. The 3rd column is a countif to count the number of times a given random value appears.

    Thanks again!
    Rob
    try the solution, see in the attached file,
    for a randomly selected value once, the cell B103 of course get the last item

    Plz Ctrl+F3 to see the 2 name: _List1 and _List2 to reduce the length and complicate formula
    Attached Files Attached Files
    Last edited by tigertiger; 07-06-2011 at 12:23 AM.

  7. #7
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: formula to create a random date?

    Perfect! Thank you Thank you!

    As you can see, I'm only going to be able to get to 45 of the questions. I may decide to toss out the earlier tests. If I wanted it to select a random question between A47:A103, what changes do I need to make?

    I'm usually fairly adept at figuring out how to manipulate formulas, but I'm not familiar with some of the functions that you are using, and in all honesty my mind is single tracking the bar exam right now.

    I can't thank you enough!
    Rob

  8. #8
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: formula to create a random date?

    Quote Originally Posted by robbyvegas View Post
    Perfect! Thank you Thank you!

    As you can see, I'm only going to be able to get to 45 of the questions. I may decide to toss out the earlier tests. If I wanted it to select a random question between A47:A103, what changes do I need to make?

    Rob
    only two steps you should do:

    1) Change the name _List1 (Ctrl+F3):
    =ROW(Sheet1!$1:$102)*(COUNTIF(Sheet1!$B$1:$B1,Sheet1!$A$2:$A$103)=0)
    to
    =ROW(Sheet1!$1:$57)*(COUNTIF(Sheet1!$B$1:$B1,Sheet1!$A$47:$A$103)=0)

    (where: 57=103-47+1)



    2) Change the formula at B2
    from
    =INDEX($A$2:$A$103,INDEX(SMALL(_List2,ROW($1:$102)),RANDBETWEEN(1,COUNT(_List2))))
    to
    =INDEX($A$47:$A$103,INDEX(SMALL(_List2,ROW($1:$57)),RANDBETWEEN(1,COUNT(_List2))))

    is this appropriated for your case?

    copy fill-down to other cell B3....B46 (depend of the number question you want - of course it must be less or equal than the number of question you have (57))
    Last edited by tigertiger; 07-07-2011 at 09:57 AM.

  9. #9
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: formula to create a random date?

    Why not just put a random variable beside each exam and filter them largest to smallest. See attached.

    Heres a question for you ---> Do you think the 2001, 2002 exams will be a good indication of whats on the exam? You may be better off studying the more recent ones??
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: formula to create a random date?

    Thanks! No, I don't thing the 01 - 02 exams will be the best indication of what is on the bar. So I was going to just grab exams from 05 or 06 forward.

    Thanks again everyone! I can't thank you enough.

+ 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