Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Random numbers from several ranges

How can I set up one formula to randomly give me a number from multiple
ranges? For example, I have 2 ranges. One is 105 though 128 and the other is
244 through 286. I need to randomly select one number from either range. I
have tried the =RANDBETWEEN function, but I can't get it to work for multiple
ranges. Please help! Thank You
Chris
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Random numbers from several ranges

You could set up multiple randbetween statements with an IF statement.

If each range is weighted equally:

=IF(RANDBETWEEN(1,2)=1,RANDBETWEEN(105,128),RANDBE TWEEN(244,286))

If each possibility in each range is weighted equally:

=IF(RANDBETWEEN(1,67)<25,RANDBETWEEN(105,128),RAND BETWEEN(244,286))


--
John C


"ChrisSafety" wrote:

How can I set up one formula to randomly give me a number from multiple
ranges? For example, I have 2 ranges. One is 105 though 128 and the other is
244 through 286. I need to randomly select one number from either range. I
have tried the =RANDBETWEEN function, but I can't get it to work for multiple
ranges. Please help! Thank You
Chris

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Random numbers from several ranges

Thank you so much! It worked perfectly!

"John C" wrote:

You could set up multiple randbetween statements with an IF statement.

If each range is weighted equally:

=IF(RANDBETWEEN(1,2)=1,RANDBETWEEN(105,128),RANDBE TWEEN(244,286))

If each possibility in each range is weighted equally:

=IF(RANDBETWEEN(1,67)<25,RANDBETWEEN(105,128),RAND BETWEEN(244,286))


--
John C


"ChrisSafety" wrote:

How can I set up one formula to randomly give me a number from multiple
ranges? For example, I have 2 ranges. One is 105 though 128 and the other is
244 through 286. I need to randomly select one number from either range. I
have tried the =RANDBETWEEN function, but I can't get it to work for multiple
ranges. Please help! Thank You
Chris

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Random numbers from several ranges

1. have you tried to use named ranges?

in Excel 2003 Insert-Name-Define

2. another option might be:
http://www.tushar-mehta.com/excel/ti..._argument.html
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
I want random numbers generated without repeating numbers Johncobb Excel Worksheet Functions 2 September 7th 06 04:52 PM
Can Excel pick random numbers from 1-300 and not repeat numbers? Julian Excel Discussion (Misc queries) 1 June 7th 06 07:17 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"