LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default random integer with sum constraint

Hi

I want to generate two random integers that fall within a certain range
("min" to "max", e.g. 0 to 10) AND that sum to equal no more than a given
value ("maxsum", e.g. 19)

The first integer is easy (using a Analysis Toolpak add-in)
A1=RANDBETWEEN(min, max)

But that second integer has me stuck. I started with A2=RANDBETWEEN(min,
maxsum-A1) but then a lot of the results were larger than "max." Oops. Any
ideas on what else I need to put in there?

Thanks,
Karin
 
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
How do I add an integer to an existing integer? Aaron Excel Worksheet Functions 3 December 17th 09 09:46 PM
Random Integer Don[_4_] New Users to Excel 3 September 20th 09 11:08 PM
Adding a constraint. AhmtDY Excel Discussion (Misc queries) 2 May 6th 05 09:59 AM
cell value constraint Balder Excel Discussion (Misc queries) 2 April 18th 05 07:14 PM
Definition of integer constraint kimber New Users to Excel 1 January 12th 05 08:22 PM


All times are GMT +1. The time now is 01:13 AM.

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

About Us

"It's about Microsoft Excel"