ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Assign number to correct range (https://www.excelbanter.com/excel-discussion-misc-queries/119179-assign-number-correct-range.html)

blinton25

Assign number to correct range
 
I have a range of numbers representing a culmalative total for a population
e.g:


1 500
2 750
3 1000

I then generate a sequence of random numbers, e.g 250, 800 etc. So if I get
250 it should appear beside 1 (since it is less than 500), and if I get 800
it should appear beside 1000 ((since it is less than 1000). Anyway to do this?

I have no problem with a solution that reads the random numbers generated
and then assigns them to the correct position

JMay

Assign number to correct range
 
There is a function RANDBETWEEN(Bottom#,Top#) which may be a part of
the Tool-Pack_AddIn, But that is what you need.

With A1:A4 = 0, 500, 750, 1000
In Cell B2 enter =RANDBETWEEN(A1, A2) -- Copy down to B4

HTH



"blinton25" wrote in message
:

I have a range of numbers representing a culmalative total for a population
e.g:


1 500
2 750
3 1000

I then generate a sequence of random numbers, e.g 250, 800 etc. So if I get
250 it should appear beside 1 (since it is less than 500), and if I get 800
it should appear beside 1000 ((since it is less than 1000). Anyway to do this?

I have no problem with a solution that reads the random numbers generated
and then assigns them to the correct position



blinton25

Assign number to correct range
 
Hi,

Sorry, the numbers (250, 800 etc) aren't random.

"JMay" wrote:

There is a function RANDBETWEEN(Bottom#,Top#) which may be a part of
the Tool-Pack_AddIn, But that is what you need.

With A1:A4 = 0, 500, 750, 1000
In Cell B2 enter =RANDBETWEEN(A1, A2) -- Copy down to B4

HTH



"blinton25" wrote in message
:

I have a range of numbers representing a culmalative total for a population
e.g:


1 500
2 750
3 1000

I then generate a sequence of random numbers, e.g 250, 800 etc. So if I get
250 it should appear beside 1 (since it is less than 500), and if I get 800
it should appear beside 1000 ((since it is less than 1000). Anyway to do this?

I have no problem with a solution that reads the random numbers generated
and then assigns them to the correct position





All times are GMT +1. The time now is 07:18 PM.

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