Remember Me?
Menu
Home
Search
Today's Posts
Home
Search
Today's Posts
ExcelBanter
»
Excel Newsgroups
»
Excel Worksheet Functions
>
Generation of random numbers and sum of those with a condition
LinkBack
Thread Tools
Search this Thread
Display Modes
Prev
Next
#
12
ramana
Posts: n/a
Hi Joeu,
thank you for the formula.
Thanks & Best Regards
Ramana
wrote:
ramana wrote:
But the one thing I wanted to refine is I need real
numbers at least with two decimal points.
... As I anticipated in my first response.
Later ramana wrote:
What I did to solve this problem is.
A1: =RAND()*(50-40)+40
B1:
=RANDBETWEEN(MAX(35000,83000-A1*1000),MIN(45000,88000-A1*1000))/1000
C1: =A1+B1
I would define A1 as ROUND(RAND()*(50-40)+40,2).
That makes the precision consistent for all three
cells, and it has the added benefit of yielding
numbers over the entire range of 40-50.
As for B1, what you have should work. But I would
do a more natural extension of what I wrote
previously, namely (see the RAND() help text):
ROUND(RAND()*(MIN(45,88-A1)-MAX(35,83-A1))+MAX(35,83-A1),2)
That has the added benefit of using RAND(), not
RANDBETWEEN(). I have read that the RNG in the
Data Analysis package does a poor job; RAND() is
better, at least in later revisions of Excel. I
wonder if RANDBETWEEN() uses the RNG in the Data
Analysis package :-(.
(Perhaps an MVP can dismiss my concern.)
Reply With Quote
Thread Tools
Search this Thread
Show Printable Version
Search this Thread
:
Advanced Search
Display Modes
Switch to Linear Mode
Switch to Hybrid Mode
Threaded Mode
Posting Rules
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
On
Pingbacks
are
On
Refbacks
are
On
All times are GMT +1. The time now is
05:37 PM
.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
Contact Us
ExcelBanter forum home
Privacy Statement
LinkBack
LinkBack URL
About LinkBacks