Randomly selecting a certain repeating number in a matrix

yamomami

New Member
Joined
Jan 17, 2012
Messages
1
I am trying to randomly select a repeating number in a matrix. I have seen the different random number and random select codes out there, but specifically what I'm asking is how to go about selecting a number that repeats in a matrix multiple times, not numbers between a certain range or a specific number that occurs in a matrix either. In other words, say I have a matrix like the following:
<table class="cms_table"><tbody><tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right" width="75">0</td> <td class="cms_table_td" align="right" width="75">0</td> <td class="cms_table_td" align="right" width="75">0</td> <td class="cms_table_td" align="right" width="75">0</td> <td class="cms_table_td" align="right" width="75">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">4</td> <td class="cms_table_td" align="right">4</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">4</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">4</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">8</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">9</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> <tr class="cms_table_tr" valign="top"><td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">5</td> <td class="cms_table_td" align="right">0</td> <td class="cms_table_td" align="right">0</td> </tr> </tbody></table>
There are multiple 5's here, but for my purposes I only want to select one of those 5's. Is there a way to do this in Excel?

Also, I can only run macros in MSExcel 2004 for Mac because 2008 doesn't allow macros. Hopefully that doesn't cause any probs.

Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top