+ Reply to Thread
Results 1 to 3 of 3

RAND function nested inside a VLOOKUP

  1. #1
    Registered User
    Join Date
    10-28-2016
    Location
    San Antonio, Texas
    MS-Off Ver
    Office 365
    Posts
    5

    Post RAND function nested inside a VLOOKUP

    My assignment wants me to have a RAND nested inside a VLOOKUP but I'm not sure how exactly that would look.

    What would a basic nested rand function look like?

    stu.png

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: RAND function nested inside a VLOOKUP

    Many members are unable to see images in the *.png format due to forum compatibility issues with some browsers.

    If you need to post an image post it in the *.jpg format.

    Even better than posting images... post a SMALL sample file. That way we can test solutions directly in the file with the relevant data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: RAND function nested inside a VLOOKUP

    What is the logic behind using a random number in the VLOOKUP() function? That will determine what it looks like. There are four arguments to the VLOOKUP() function (https://support.office.com/en-us/art...8-93a18ad188a1 ):

    1) first argument -- lookup value. Find a random number in your lookup table and return the corresponding value from the desired column. =VLOOKUP(RAND(),lookup_table,col#,approx_match).
    2) second argument -- lookup table. Generate some random numbers, then find the desired number in that set of random numbers. =VLOOKUP(lookup_value,range of cells containing RAND() function,col #,approx_match)
    3) third argument -- column # -- return the value from a random column =VLOOKUP(lookup_value,lookup_table,RANDBETWEEN(1,5),approx_match)
    4) fourth argument -- approx_match -- randomly decide whether to do a linear search/exact match or a binary search/approximate match =VLOOKUP(lookup_value,lookup_table,col#,RANDBETWEEN(0,1))

    Those are the ways I could see using random numbers in the VLOOKUP() function. Decide which logic best represents what you are trying to do.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  2. [SOLVED] Weird randomisation issue with nested rand() functions
    By qdtruong in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-13-2015, 01:10 PM
  3. [SOLVED] Help Requested with Nested Small Function Inside Index/Match Formula
    By trandle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2015, 10:07 AM
  4. [SOLVED] Exclude Zero's from Min Function nested inside an index+Match... all within CELL funtion
    By clemsoncooz in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-05-2014, 05:16 PM
  5. Vlookup inside IF function not working
    By Ruby91 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-07-2014, 10:30 AM
  6. Help with file path inside VLOOKUP function
    By acpt22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2013, 05:51 AM
  7. [SOLVED] RIGHT Function nested inside of IF
    By jakeisbill in forum Excel General
    Replies: 6
    Last Post: 10-16-2012, 12:01 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