I have a rectangular Boolean matrix M that is say 30x6
For example, one column of M is:
1
0
0
1
0
1
For each column, I want to randomly choose a row number of a cell with a 1 in it.
For the example column, the result would be a 1, 4,or 6
With M, I’d end up with 30 numbers (one for each column).
I don’t want to use VBA, and I need the calc to be done in one cell/column without using a second matrix of random numbers to generate indices)..it needs to be done on the fly so to speak.
If u multiply each column by a 6x1 array of random numbers, and find the position of the largest, that would work, but I’m having trouble with the syntax to get it done in one cell. I suspect it should be a cousin to the syntax for removing blank cells (something like:
=INDEX($A$1:$A$8,SMALL(IF(ISnumber($A$1:$A$8),ROW($A$1:$A$8),""),ROW(1:8)))
Does anyone have a way to do something like this. I come across this situation all the time, but don't have a decent way of addressing it. thanks
Bookmarks