+ Reply to Thread
Results 1 to 13 of 13

Random selecting 20 items base on criteria with no duplicates

  1. #1
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Random selecting 20 items base on criteria with no duplicates

    Ok here is the scenario,first take a look at my workbook please. Then refer on Column A to C about the criteria, The thing is on Column F to H will be my data and on Column K to L will I have to put my result, I have to select 20 item only out of 24 entity code randomly without duplicates on Country and Entity code, Account will be ok if it has duplicate. On the sample table, for example on PH country there will be 4 entity code and I have to select only 3 entity code out of 4. I tried the random function and I am having a difficult times because it still selecting duplicate record. I hope someone could help me
    Attached Files Attached Files
    Last edited by emina002; 04-19-2013 at 04:47 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Random selecting 20 items base on criteria with no duplicates

    Please confirm where is the data which needs to be considered to determine the Top 20?
    Last edited by :) Sixthsense :); 04-19-2013 at 02:32 AM. Reason: Corrected the sentence


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    Hi there @ Sixthsense , if you refer to my workbook the data is Column A row 13 and so on that will be 23 total(I sorted it out ascending by country),but you have to choose only 20 to meet the criteria on table(Column C:"Possible Count included in 20"). The data where you have to choose randomly on Column F to H and put it on Column K to M.

  4. #4
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    Hope I explained it well Sir, kindly see first or review the workbook.Thank you

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Random selecting 20 items base on criteria with no duplicates

    Thanks for the brief and I posted the question after reviewing your file. Still this header is not clear for me Result here Top 20 What is the Top 20 stands for? How to fix those Top 20? Why the word Top is used?

  6. #6
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    Ok, Sorry if I did something wrong or mistype it "Top 20" since all I want a result is randomly "pick 20" items out of data that is on Column F to H(Entity code no duplicate,Country duplicate depends on criteria on table,account it is ok if has duplicate), I think I can't explain it further because of language barrier and the problem is on my side..>_<. List of Entity code per country is on Column A and B starting row 13.

  7. #7
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    All I know is that my workbook still have 0 views, that is why I am being paranoid explaining to see first my workbook for the other forum contributor understand my problem.

  8. #8
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Random selecting 20 items base on criteria with no duplicates

    If you have been logged into the sight since you Originally Posted, it probably will display '0 views'...the site has been udergoing (seemingly, interminable) changes, lately (cough), if you re-log in, you will probably see that number change
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Random selecting 20 items base on criteria with no duplicates

    I already downloaded it, may be technical problem I believe. Is VBA solution is ok for you?

  10. #10
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    Yes it is. Thank you so much

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Random selecting 20 items base on criteria with no duplicates

    Try the below code....

    Please Login or Register  to view this content.
    Refer the attached file for details, Click the Click Me Button to run the Macro
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Random selecting 20 items base on criteria with no duplicates

    Hi there Sixthsense , the code you given to me works..thanks to you

  13. #13
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Random selecting 20 items base on criteria with no duplicates

    Glad it helps you and 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