Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
RagDyeR
 
Posts: n/a
Default

The only problem with your formula is that you'll *never* get a "9".

This bug (wrong information) has been around for years in the Help files,
where I'll bet, is where you got this formula from.

Try this instead:

=INT(RAND()*(9)+1)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"BaldySlaphead"
wrote in message
news:BaldySlaphead.1s45mw_1121267162.1931@excelfor um-nospam.com...

Thank you, sir, that works fine! :)


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile:
http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779


  #2   Report Post  
RagDyeR
 
Posts: n/a
Default

Actually, the info is correct, *except* when using Int().

Either of these produce the range you want (1 to 9):

=ROUND(RAND()*(9-1)+1,0)

=INT(RAND()*(9)+1)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"RagDyeR" wrote in message
...
The only problem with your formula is that you'll *never* get a "9".

This bug (wrong information) has been around for years in the Help files,
where I'll bet, is where you got this formula from.

Try this instead:

=INT(RAND()*(9)+1)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"BaldySlaphead"
wrote in message
news:BaldySlaphead.1s45mw_1121267162.1931@excelfor um-nospam.com...

Thank you, sir, that works fine! :)


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile:
http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779



  #3   Report Post  
BaldySlaphead
 
Posts: n/a
Default


RagDyeR Wrote:
Actually, the info is correct, *except* when using Int().

Either of these produce the range you want (1 to 9):

=ROUND(RAND()*(9-1)+1,0)

=INT(RAND()*(9)+1)
--

HTH,

RD


RD,

Many thanks for your assistance. You're quite correct that it wasn't
generating a 9 - I must have kept F9 depressed for a couple of minutes
and not one sign - okay, it could happen but I'm willing to accept
you're right and the formula doesn't work! ;)

I have an additional enquiry, out of pure interest. Would I be able to
record which number is generated in any way? What I imagined was
setting up an additional COL 'Results' and then trying to increment an


if A13=1 then x=x+1

style argument for each unique line to increment the count each time
the screen was refreshed. Thus I could see how often a number was
picked by the RAND.

Is this possible, and how might I do it? Any comments gratefully
received.

Regards,

Baldy


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile: http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779

  #4   Report Post  
RagDyeR
 
Posts: n/a
Default

I don't know where or how you're utilizing the returns of your formula, but
wouldn't simply copying it down a column give you the type of list that
you're looking for?

You could remove the formulas, via <Copy - PasteSpecial - Values, leaving
the random numbers behind.

"BaldySlaphead"
wrote in message
news:BaldySlaphead.1s5jmi_1121331920.9348@excelfor um-nospam.com...

RagDyeR Wrote:
Actually, the info is correct, *except* when using Int().

Either of these produce the range you want (1 to 9):

=ROUND(RAND()*(9-1)+1,0)

=INT(RAND()*(9)+1)
--

HTH,

RD


RD,

Many thanks for your assistance. You're quite correct that it wasn't
generating a 9 - I must have kept F9 depressed for a couple of minutes
and not one sign - okay, it could happen but I'm willing to accept
you're right and the formula doesn't work! ;)

I have an additional enquiry, out of pure interest. Would I be able to
record which number is generated in any way? What I imagined was
setting up an additional COL 'Results' and then trying to increment an


if A13=1 then x=x+1

style argument for each unique line to increment the count each time
the screen was refreshed. Thus I could see how often a number was
picked by the RAND.

Is this possible, and how might I do it? Any comments gratefully
received.

Regards,

Baldy


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile:
http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779


  #5   Report Post  
BaldySlaphead
 
Posts: n/a
Default


RagDyeR Wrote:
I don't know where or how you're utilizing the returns of your formula,
but
wouldn't simply copying it down a column give you the type of list
that
you're looking for?

You could remove the formulas, via <Copy - PasteSpecial - Values,
leaving
the random numbers behind.


I don't believe so!

Every time I refresh the data, the Rand will recalculate. For a bit of
fun, I wanted to record that the Rand had generated the result 1 ten
times, 2 seven time, 3 not at all etc etc.


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile: http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779



  #6   Report Post  
RagDyeR
 
Posts: n/a
Default

Like I said, I don't know *how* you're using your data, but copying that
formula down a column, and then eliminating the formula, leaving the random
numbers behind, gives you a list of random numbers that you can *USE* by
polling down that column, in the same way that you're using the return of
the single formula.

If you can do that (use the random numbers in the list), then you have
exactly what you're looking for, and you'll even know ahead of time, exactly
what random return will be used next.
--

Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
--------------------------------------------------------------------


"BaldySlaphead"
wrote in message
news:BaldySlaphead.1sgvzi_1121861306.506@excelforu m-nospam.com...

RagDyeR Wrote:
I don't know where or how you're utilizing the returns of your formula,
but
wouldn't simply copying it down a column give you the type of list
that
you're looking for?

You could remove the formulas, via <Copy - PasteSpecial - Values,
leaving
the random numbers behind.


I don't believe so!

Every time I refresh the data, the Rand will recalculate. For a bit of
fun, I wanted to record that the Rand had generated the result 1 ten
times, 2 seven time, 3 not at all etc etc.


--
BaldySlaphead
------------------------------------------------------------------------
BaldySlaphead's Profile:
http://www.excelforum.com/member.php...fo&userid=1260
View this thread: http://www.excelforum.com/showthread...hreadid=386779


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
conditional formating Jed Excel Discussion (Misc queries) 3 June 14th 05 05:11 PM
Conditional Formating Roy Excel Discussion (Misc queries) 4 May 27th 05 01:16 AM
Conditional Formating Extreme Question Heather Excel Worksheet Functions 5 May 8th 05 08:06 PM
Conditional Formating Itch Excel Discussion (Misc queries) 1 March 8th 05 06:13 PM
more than 3 conditional formating in excel Manan Excel Discussion (Misc queries) 2 February 7th 05 09:12 PM


All times are GMT +1. The time now is 08:55 AM.

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"