ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Associating messages with random numbers? (https://www.excelbanter.com/excel-discussion-misc-queries/450055-associating-messages-random-numbers.html)

slipper

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

Claus Busch

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

slipper

Quote:

Originally Posted by Claus Busch (Post 1617310)
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

Claus Busch

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

Claus Busch

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

slipper

Quote:

Originally Posted by Claus Busch (Post 1617313)
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

slipper

Quote:

Originally Posted by slipper (Post 1617314)
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

Claus Busch

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

slipper

Quote:

Originally Posted by Claus Busch (Post 1617324)
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

Claus Busch

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


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com