Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Default Associating messages with random numbers?

Hi all

I am a new user of Excel, i'm looking for a bit of help with the following.

I am using Excels RAND formula to mimic a die roll for a game i play, however associated with each die roll number i would like a message to be displayed giving instructions to the player, for example

=RANDBETWEEN(1,10)

IF(1) message A
IF(2) message B
.
.
.IF(10) message J



I am ok generating the Random number, but how do i associate a message to each value and display the message instead of the value?

Any help appreciated, like i said i am new to Excel so may need to walk me through it.

Thanks for any replies

regards

slipper
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Associating messages with random numbers?



Hi,Am Sat, 3 May 2014 21:21:50 +0100 schrieb slipper:

I am using Excels RAND formula to mimic a die roll for a game i play,
however associated with each die roll number i would like a message to
be displayed giving instructions to the player, for example

=RANDBETWEEN(1,10)

IF(1) message A
IF(2) message B


your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA","MessageB","MessageC","Messa geD","MessageE",.........)

Or you write the numbers from 1 to 10 e.g. in L1:L10 and in M1:M10 the
depending messages. Then you can try it with:

=VLOOKUP(A1,$L$1:$M$10,2,0)


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,Am Sat, 3 May 2014 21:21:50 +0100 schrieb slipper:

I am using Excels RAND formula to mimic a die roll for a game i play,
however associated with each die roll number i would like a message to
be displayed giving instructions to the player, for example

=RANDBETWEEN(1,10)

IF(1) message A
IF(2) message B


your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA","MessageB","MessageC","Messa geD","MessageE",.........)

Or you write the numbers from 1 to 10 e.g. in L1:L10 and in M1:M10 the
depending messages. Then you can try it with:

=VLOOKUP(A1,$L$1:$M$10,2,0)


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

Claus

Thanks alot mate, that works perfectly really appreciate it. Out of interest is there a way to assign a colour to the cell depending on what message shows?

for example something like

your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA (CELL green)","MessageB (CELL blue)","MessageC (CELL red)","MessageD (CELL yellow)","MessageE (CELL orange)",.........)


not that important but would be nice to do.

Thanks again for your help really appreciate it.

regards

slipper
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Associating messages with random numbers?

Hi,

Am Sun, 4 May 2014 11:32:09 +0100 schrieb slipper:


Out of
interest is there a way to assign a colour to the cell depending on what
message shows?

for example something like

your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA (CELL green)","MessageB (CELL blue)","MessageC
(CELL red)","MessageD (CELL yellow)","MessageE (CELL
orange)",.........)


look for Conditional Formatting


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Associating messages with random numbers?

Hi,

Am Sun, 4 May 2014 12:52:16 +0200 schrieb Claus Busch:

look for Conditional Formatting


or look he
https://onedrive.live.com/?cid=9378A...121822A3%21326
for "ShowDependingMessages"
There is a solution with macro. Rightlick and download the file because
macros are disabled in OneDrive


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


  #6   Report Post  
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Sun, 4 May 2014 12:52:16 +0200 schrieb Claus Busch:

look for Conditional Formatting


or look he
https://onedrive.live.com/?cid=9378A...121822A3%21326
for "ShowDependingMessages"
There is a solution with macro. Rightlick and download the file because
macros are disabled in OneDrive


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
Many thanks Claus you have been a big help, really appreciate you taking the time to help out.

cheers mate

slipper
  #7   Report Post  
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by slipper View Post
Many thanks Claus you have been a big help, really appreciate you taking the time to help out.

cheers mate

slipper
Claus

One more thing i thought of that may be usefull to me. The conditional formatting works fine for changing a colour of a cell based on a value in that cell.

However is there any way to influence the colour of another cell based on the value in a separate cell?

for example

your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA","MessageB","MessageC","Messa geD","MessageE",.........)


IF(A1 <= 4) then (A2&&A3 = green, A4 = red)
IF(A1 4) then (A2 = green, A3 = red, A4 = orange)


The above is not exactly what i want just as way of an explanation, is this possible at all? can't see a way of doing it with conditional formatting, only of changing the colour in the cell with the value in it.

Cheers again for any help.

regards

slipper
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Associating messages with random numbers?

Hi,

Am Mon, 5 May 2014 11:01:05 +0100 schrieb slipper:

IF(A1 <= 4) then (A2&&A3 = green, A4 = red)
IF(A1 4) then (A2 = green, A3 = red, A4 = orange)

The above is not exactly what i want just as way of an explanation, is
this possible at all? can't see a way of doing it with conditional
formatting, only of changing the colour in the cell with the value in
it.


look again in OneDrive for the workbook. I changed the code to the above
colors.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #9   Report Post  
Junior Member
 
Posts: 8
Default

Quote:
Originally Posted by Claus Busch View Post
Hi,

Am Mon, 5 May 2014 11:01:05 +0100 schrieb slipper:

IF(A1 <= 4) then (A2&&A3 = green, A4 = red)
IF(A1 4) then (A2 = green, A3 = red, A4 = orange)

The above is not exactly what i want just as way of an explanation, is
this possible at all? can't see a way of doing it with conditional
formatting, only of changing the colour in the cell with the value in
it.


look again in OneDrive for the workbook. I changed the code to the above
colors.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
Many thanks Claus, got it. Think i am sorted now.

Thanks for all your help, took the opportunity to download some other example aswell.

regards

slipper
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Associating messages with random numbers?

Hi,

Am Tue, 6 May 2014 10:12:04 +0100 schrieb slipper:


Think i am sorted now.


always glad to help. Thank you for your feedback


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
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
Random messages pop up David A. Excel Worksheet Functions 2 June 20th 07 03:23 PM
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 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 04:12 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"