Computer Selects Numbers?

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I am using Excel XP.

Is it possible to select a section of a column and make
the worksheet select 3 #'s at random?
 
The usual approach would be to fill an adjacent column with =RAND(),
sort both columns by the random column, and read off the first three
values from the first column.

If sorting is undesirable, you could avoid that step with the following
array formula, to be array entered (Ctrl-Shift-Enter) with three rows of
a column selected
=INDEX(A1:A40,MATCH(LARGE(B1:B40,{1;2;3}),B1:B40,0))
The formula assumes that B1:B40 contains =RAND() to return random
selections from A1:A40. When you first enter the formula it will give
#N/A values, but will start working on the next recalculation (and will
return a new selection every recalc after that).

Jerry
Excel MVP
 
Like Jerry, I'm not really sure what you're asking. Once which of the numbers passes midnight
At any rate, it sounds to me like you can fix the problem by altering the data you enter into the cells and changing how the cells are formatted
Use a Time format to display the times as you wish them to appear in the cells
--However-
Instead of entering simply the time, type the date followed by the time. Example
4/25/04 11:00am
If you format it as time (Format|Cells, choose a Time format), the date won't appear in the cell. But, when I typ
4/26/04 12:30am Excel will now recognize it as larger than the time 4/25/04 11:00am

Unless you tell it otherwise, Excel assumes all the times you are working with are from the same 24 hour period. So, what probably happened is that when you thought you had 'passed midnight,' Excel thought you were talking about 24hrs. earlier than what you meant

tj
 
Think you meant to reply to the next message with this note :-)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



tjtjjtjt said:
Like Jerry, I'm not really sure what you're asking. Once which of the numbers passes midnight?
At any rate, it sounds to me like you can fix the problem by altering the data
you enter into the cells and changing how the cells are formatted.
Use a Time format to display the times as you wish them to appear in the cells.
--However--
Instead of entering simply the time, type the date followed by the time. Example:
4/25/04 11:00am.
If you format it as time (Format|Cells, choose a Time format), the date won't
appear in the cell. But, when I type
4/26/04 12:30am Excel will now recognize it as larger than the time 4/25/04 11:00am.

Unless you tell it otherwise, Excel assumes all the times you are working with
are from the same 24 hour period. So, what probably happened is that when you
thought you had 'passed midnight,' Excel thought you were talking about 24hrs.
earlier than what you meant.
 
Here is what I am trying to do. In a column I have these
numbers 3,7,9,12,15,22,24,28,30. I want to be able to
randomly pick three or four of this, with no repetition.
How can I do it?
 
John McGimpsey and I both provided answers to this question. A
discussion of why these answers were not satisfactory is needed before
we can give a more targeted response.

Jerry
 
The spreadsheet consists of numbers, not times.
-----Original Message-----
John McGimpsey and I both provided answers to this question. A
discussion of why these answers were not satisfactory is needed before
we can give a more targeted response.

Jerry


.
 
Neither the solution I gave, nor Jerry's have anything to do with times.
They assume the spreadsheet contains numbers, though times would work
too, since in XL times are just numbers between 0 and 1.
 
Back
Top