+ Reply to Thread
Results 1 to 3 of 3

Random Selection of cells and values averaged.

  1. #1
    Registered User
    Join Date
    08-01-2009
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    12

    Random Selection of cells and values averaged.

    Hi in the excel sheet appended below, I am trying to randomly select a 7 cell range column wise from an array B1:M30 - (e.g.- B2:B9 ;F11:F18 etc ) and want to average the values for the output. So far, I have only managed to randomly select one cell.

    Q: How do you randomly select a range from a big array column wise and average the values.

    This is part of an analysis and is crucial. I have a deadline tomorrow am literally begging for help.
    Thanks,
    Rahul

    [email protected]
    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: Random Selection of cells and values averaged.

    =AVERAGE(OFFSET(INDIRECT(ADDRESS(RANDBETWEEN(1,24),RANDBETWEEN(2,13))),0,0,7,1))
    modify that to
    =AVERAGE(OFFSET(INDIRECT(ADDRESS(N1,O1)),0,0,7,1)) then put randbetween in N1,O1 so you can also retrieve address
    assuming of course last range must be minimum of 7 rows so last range can only be from row 24 to 30 inclusive
    see attached
    Attached Files Attached Files
    Last edited by martindwilson; 08-01-2009 at 09:46 PM.
    "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
    08-01-2009
    Location
    Phoenix, Arizona
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Random Selection of cells and values averaged.

    Thanks you Martin!!
    You're the King!!!

+ 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