Excel - sequence with a random number

beng986

Board Regular
Joined
Jan 10, 2012
Messages
88
Hi,

I have some set values (columns A:B, rows 1:4)

Months10
High150
Low10
Set or Random Set

I have used the sequence function to generate a row of values:

=SEQUENCE(1,B1,1,1)

If B4 is equal to set I can use the formula below:
=IF(B4="Set",SEQUENCE(1,B1,AVERAGE(B2:B3),0))

However if B4 is set to random, how would I do the same thing but set each number to random but keeping within the high and low range?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
How about
=IF(B4="Set",SEQUENCE(1,B1,AVERAGE(B2:B3),0),IF(B4="Random",RANDARRAY(1,B1,B3,B2,1)))
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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