• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Randomly select rows without duplication from an excel sheet

joj_john

New Member
Hello I am a new member. My name is Jolly.
For audit purposes, I want to select 10 notes prepared per physician by different dates from an excel sheet. Attaching the excel sheet.
Currently I am using pivot tables (as shown in pivot table sheet) and then for each physician, I use the conditional formatting option to enter the formula -=mod(row(),n)=0, where n stands for row number based on the total notes assigned to the physician. So for example in the excel sheet, filter by physician named Laurette watson-brown who has 29 rows assigned, so 29 divided by 10 would give me the 3rd row, 6th row, etc, till i have 10 rows. Please see sheet Laurette wilson

If there are 50 users, it takes more time for the output. I am sure someone can help me with an easier way. Awaiting your kind advice.
 

Attachments

  • Emergency Docs 10.xlsx
    39.2 KB · Views: 3
Last edited:
In the attached, in the sheet called select 10 notes by a physician I've added a random number column E (rnd).
The pivot table on sheet uses that column. See the values filter of the Note date field in the pivot using the Top 10 option (I've left it showing the top 6; I'll leave you to alter that to 10). This is untidy because you see the random numbers in the pivot. Refresh the pivot for another set of random records.

Separately, there's another solution on sheet select 10 notes by a physic (2) which is a copy of your sheet, but there's a Power Query query in the table at cell H1 of that sheet. To get a new set of random selections you need to refresh the table just like you would a pivot table, eg. using a right-click on the table and choosing Refresh.

There are other ways possible using purely formulas with random numbers but the results will change every time the sheet gets recalculated, which can be a nuisance.
 

Attachments

  • Chandoo56539Emergency Docs 10.xlsx
    96.6 KB · Views: 7
Back
Top