+ Reply to Thread
Results 1 to 4 of 4

Select random row from a list after Autofilter has been applied

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Select random row from a list after Autofilter has been applied

    Hi all,

    I would appreciate any help on this issue:

    I am trying to select a random row from a list of rows in excel, after the rows have had an AutoFilter applied to them.

    I have round the function to select a random row (with the help of INDEX) and RAND(), but I want the function to work on the filtered results, not all the results.

    Any help of the matter would be greatly appreciated!

    George

    PS: I have uploaded the spreadsheet for convenience
    Attached Files Attached Files

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

    Re: Select random row from a list after Autofilter has been applied

    Try this array formula**:

    =INDEX(C4:C74,SMALL(IF(SUBTOTAL(103,OFFSET(C4:C74,ROW(C4:C74)-MIN(ROW(C4:C74)),,1)),ROW(C4:C74)),RANDBETWEEN(1,SUBTOTAL(103,C4:C74)))-MIN(ROW(C4:C74))+1)

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Select random row from a list after Autofilter has been applied

    That works! Thank you! I would have never figured that out!

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

    Re: Select random row from a list after Autofilter has been applied

    You're welcome. Thanks for the feedback!

+ 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