# Associating messages with random numbers?

S

#### slipper

Hi all

I am a new user of Excel, i'm looking for a bit of help with th
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 t
be displayed giving instructions to the player, for example

=RANDBETWEEN(1,10)

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

C

#### Claus Busch

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","MessageD","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.

S

#### slipper

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

your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA","MessageB","MessageC","MessageD","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.

Claus

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

for example something like

your RAND formula in A1. Then:

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

not that important but would be nice to do.

Thanks again for your help really appreciate it.

regards

slippe

C

#### Claus Busch

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.

S

#### slipper

Claus said:
Hi,

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

or look he
http://tinyurl.com/n9s5tdh
for "ShowDependingMessages"
There is a solution with macro. Rightlick and download the file because
macros are disabled in OneDrive

Regards
Claus B.
Many thanks Claus you have been a big help, really appreciate you takin
the time to help out.

cheers mate

slippe

S

#### slipper

slipper;1617314 said:
Many thanks Claus you have been a big help, really appreciate you takin
the time to help out.

cheers mate

slipper
Claus

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

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

for example

your RAND formula in A1. Then:

=CHOOSE(A1,"MessageA","MessageB","MessageC","Mess
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, i
this possible at all? can't see a way of doing it with conditiona
formatting, only of changing the colour in the cell with the value i
it.

Cheers again for any help.

regards

slippe

C

#### Claus Busch

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.

S

#### slipper

Claus said:
Hi,

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

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

Regards
Claus B.
Many thanks Claus, got it. Think i am sorted now.

example aswell.

regards

slippe

C

#### Claus Busch

Hi,

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

Think i am sorted now.