Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2015, 05:28 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default Selecting random cells based on criteria

Hi I have a sheet that contains a few thousand entries.

In column "D" I have a value assigned to each entry (A, - W)

What I want to do is select a random set of entries for each of the criteria in column "D" and return a list of cell values that are in column "A"



However the number of cells I want to return changes for each criteria

So for example If cell in column "D" contains an "A" I want to return the value of the corresponding cell in Column "A".

So far so good?

The next twist is that there is a variable number of entries for each criteria (A, B, C, etc... ,W)

So if there are a total of 56 entries with an "A" in column "D" I want to specify the number of random entries I want returned for example I only want 9 of the 56.

If that hasn't totally confused everyone, any suggestions on how to do this would be welcome.
Reply With Quote
  #2  
Old 10-23-2015, 02:21 PM
shg shg is offline Selecting random cells based on criteria Windows 7 64bit Selecting random cells based on criteria Office 2010 32bit
Advanced Beginner
 
Join Date: Oct 2015
Posts: 55
shg is on a distinguished road
Default

Quote:
... any suggestions on how to do this would be welcome.
I'd suggest you post a workbook with an example of input and desired output.
Reply With Quote
  #3  
Old 10-26-2015, 03:04 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default Sorry - workbook attached

Sorry, forgot to include the workbook before
Attached Files
File Type: xlsx Excel Example.xlsx (10.2 KB, 15 views)
Reply With Quote
  #4  
Old 10-26-2015, 04:52 AM
xor xor is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Expert
 
Join Date: Oct 2015
Posts: 1,101
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Quote:
Originally Posted by mesTrethowan View Post
Sorry, forgot to include the workbook before
Maybe you can use the attached.
Attached Files
File Type: xlsx RandomCells.xlsx (11.1 KB, 24 views)
Reply With Quote
  #5  
Old 10-27-2015, 03:59 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default Nearly there

Hi Xor,

thanks for the suggestion.

It is close but doesn't give me random results as it hides anything above the required value by changing the text format to white. so it seems to provides me with a sequential list of values.
Reply With Quote
  #6  
Old 10-27-2015, 04:30 AM
xor xor is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Expert
 
Join Date: Oct 2015
Posts: 1,101
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Could you please be a bit more specific.
Reply With Quote
  #7  
Old 10-27-2015, 05:16 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default

the formula appears to list the records sequentially as they appear in the data set.

So if I want 25 results for letter "T" it list the first 25 records it finds, anything after this is hidden.

Therefore if I have a total of say 150 records that are coded "T" number 1 - 150 the formula seems to list values 1 - 25 while hiding 26 - 150 thus not random.

Hope that makes more sense.
Reply With Quote
  #8  
Old 10-27-2015, 05:57 AM
xor xor is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Expert
 
Join Date: Oct 2015
Posts: 1,101
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default Selecting random cells based on criteria

I am still in doubt, but maybe:
Attached Files
File Type: xlsx RandomCells_2.xlsx (11.9 KB, 16 views)
Reply With Quote
  #9  
Old 10-27-2015, 06:53 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default

Sorry I may not be explaining this very well.

You are right about the column mixup in your file, sorry the data is an extract of my full sheet which has several more columns but these shown are the key ones.

Your example, while it extracts all the values that correspond to a certain letter as requested then lists them in the same order in which they appear in the original data. What I am trying to get is a random selection of all records that are classed as "A, B, C, etc." by entering the number of random selections I want for each letter;

Letter "A" may return 56 values but I want 7 random values from that 56. Currently your formula seems to return values 1 through 7 and then hides the rest.

What I had hoped for was of the 56 records identified the 7 random values would be something like;

Value 1 = Record 3
Value 2 = Record 44
Value 3 = Record 9
.
.
.
Value 7 = Record 19
Reply With Quote
  #10  
Old 10-27-2015, 07:33 AM
xor xor is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Expert
 
Join Date: Oct 2015
Posts: 1,101
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

I give it up.
Reply With Quote
  #11  
Old 10-27-2015, 07:45 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default

Thanks anyway
Reply With Quote
  #12  
Old 10-28-2015, 06:51 AM
mesTrethowan mesTrethowan is offline Selecting random cells based on criteria Windows 10 Selecting random cells based on criteria Office 2013
Novice
Selecting random cells based on criteria
 
Join Date: Oct 2015
Posts: 7
mesTrethowan is on a distinguished road
Default Solved in another forum

Solved in another forum - Selecting random cells based on criteria
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching Criteria against a range when criteria is not in contiguous cells?? GMorris Excel 9 08-20-2014 02:15 AM
In Excel 2007-After Selecting Visibe Cells-How do I "Copy to Visible cells" Only mag Excel 0 10-28-2012 08:04 PM
Change values in cells based on criteria SaneMan Excel Programming 2 02-02-2012 07:58 AM
Selecting random cells based on criteria Selecting blank cells in criteria apolloman Excel 6 08-24-2011 05:38 AM
Selecting random cells based on criteria Selecting merge field based on whether or not text is present amym Mail Merge 1 12-07-2010 05:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft