+ Reply to Thread
Results 1 to 5 of 5

Random selection option, same 'random' selection in two columns

  1. #1
    Registered User
    Join Date
    01-31-2016
    Location
    The Netherlands
    MS-Off Ver
    MAC 16.18 2018
    Posts
    35

    Random selection option, same 'random' selection in two columns

    Hi,

    Simple example. I have data in two columns (A&B), 10 rows each, now I want to calculate the average value of two randomly selected numbers from column A in cell C1:

    =AVERAGE(RandomSelection($A$1:$A$10),RandomSelection($A$1:$A$10))

    Easy. For illustrative purposes, assume the value calculated is the average of cells A2 and A7.

    But now I want to do a similar calculation for column B but based on the exact same randomly selected rows as for column A, it should automatically (and non-randomly) calculate the average of B2 and B7 in cell D1. How do I do this? Is it even possible?

    Thank you

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Random selection option, same 'random' selection in two columns

    Use this formula in two cells

    A37 and A38 for example
    Please Login or Register  to view this content.
    Then these are your formulas

    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    01-31-2016
    Location
    The Netherlands
    MS-Off Ver
    MAC 16.18 2018
    Posts
    35

    Re: Random selection option, same 'random' selection in two columns

    Thank you; the document that I am working on is obviously a lot more complex but the results that I got were what could be expected.
    What is not entirely clear to me though is why the random number is 1,10; I take it that this is not related to the number of rows in the example I gave? When I change it to 0,10 it actually gives better results but I am not sure what I am doing.

    Quote Originally Posted by mehmetcik View Post
    Use this formula in two cells

    A37 and A38 for example
    Please Login or Register  to view this content.
    Then these are your formulas

    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Random selection option, same 'random' selection in two columns

    Quote Originally Posted by applebanana View Post
    What is not entirely clear to me though is why the random number is 1,10; I take it that this is not related to the number of rows in the example I gave?.
    No, the 1 and 10 ARE related to the number of rows in the referenced range.

    In the example the range is A1:A10. There are 10 rows in that range so the random numbers generated need to be between 1 and 10 (inclusive).
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-31-2016
    Location
    The Netherlands
    MS-Off Ver
    MAC 16.18 2018
    Posts
    35

    Re: Random selection option, same 'random' selection in two columns

    Ah I see, so it is the actual total numbers of rows. I now have:

    =AVERAGE(INDEX($AF$35:$AF$67,BB2),INDEX($AF$35:$AF$67,BB3),INDEX($AF$35:$AF$67,BB4),INDEX($AF$35:$AF$67,BB5),INDEX($AF$35:$AF$67,BB6))

    and random number between 1,33

+ 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. Random Selection and Random Numbers
    By thepassfan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2014, 04:48 PM
  2. Random Selection
    By scsuflyboy in forum Excel General
    Replies: 4
    Last Post: 01-13-2012, 09:19 PM
  3. Random selection
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-26-2010, 01:41 PM
  4. Random selection.
    By sandeephg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2010, 05:29 AM
  5. Random option selection based on variable input
    By Icecycle66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 01:19 PM
  6. random selection help
    By 0ctagon in forum Excel General
    Replies: 1
    Last Post: 09-07-2006, 03:43 PM
  7. Random row selection
    By shanemjo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2005, 07:15 AM

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