ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Random Numbers (https://www.excelbanter.com/excel-worksheet-functions/157069-random-numbers.html)

bollard

Random Numbers
 
I have a spreadsheet where, in one column there is a number. The next column
holds a list of random numbers. I want the sheet to look at the number in the
first column and then select that number of entries from the random number
column to use.

e.g. if the number in the first colum is 5, it will select the first 5
random numbers from the next column.

Can anyone help, please?

Keith

Bernie Deitrick

Random Numbers
 
Keith,

What do you mean by "Select"? Do you want a macro that selects cells, a function that does something
to that number of cells, or something else entirely?

HTH,
Bernie
MS Excel MVP


"bollard" wrote in message
...
I have a spreadsheet where, in one column there is a number. The next column
holds a list of random numbers. I want the sheet to look at the number in the
first column and then select that number of entries from the random number
column to use.

e.g. if the number in the first colum is 5, it will select the first 5
random numbers from the next column.

Can anyone help, please?

Keith




hmm

Random Numbers
 
=OFFSET(B:B,,,A1)

where A1 contains the number of entries and column B is the list of entries.

If the complete formula will return multiple values (like the one above), it
is an array formula and you will need to enter it in multiple cells and hit
Ctrl + Enter after typing it. Good luck.


"bollard" wrote:

I have a spreadsheet where, in one column there is a number. The next column
holds a list of random numbers. I want the sheet to look at the number in the
first column and then select that number of entries from the random number
column to use.

e.g. if the number in the first colum is 5, it will select the first 5
random numbers from the next column.

Can anyone help, please?

Keith


Bernd P

Random Numbers
 
Hello,

=B1:INDEX(B:B,A1)

is non-volatile - meaning that it does not recalculate each time you
press F9 unless A1 changes.

Regards,
Bernd



All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com