Formula

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Can someone help me with a formula.

If someone types a 1 into block A1, I want block C1 to say "GREEN".
If they type a 2 in block A1, I want block C1 to say "Blue".
If they type a 3 in block A1, I want block C1 to say "Black".
And so on.

Can anyone help?

Bill
 
<< The function you want is CHOOSE()

In C1 type:

=CHOOSE(A1,"Green","Blue","Black")>>

Using the above CHOOSE formula will yield a VALUE error if a numbe
besides 1, 2 or 3 is entered in A1.

Perhaps the old fashioned nested IFs will do,i.e.,

=if(A1=1,"Green",if(A1=2,"Blue",if(A1=3,"Black","")))

The above nested IF formula will return a blank in cell C1 if any othe
number (besides 1, 2, 3) is entered in Cell A1.

OR to be more descriptive, perhaps Cell C1's formula should be

=if(A1=1,"Green",if(A1=2,"Blue",if(A1=3,"Black","Enter number between
and 3 only please!!!"))
 
There might be a simpler way, but it's been a while since I've really
power used Excel...

Here is one way...

=if(A1=1,"Green",if(A1=2,"Blue",if(A1=3,"Black","")))

I thought I saw a feature that makes this much simpler though but can't
remember without Excel in front of me...

-----Original Message-----
From: Bill [mailto:[email protected]]
Posted At: Friday, August 27, 2004 5:27 PM
Posted To: microsoft.public.excel
Conversation: Formula
Subject: Formula


Can someone help me with a formula.

If someone types a 1 into block A1, I want block C1 to say "GREEN".
If they type a 2 in block A1, I want block C1 to say "Blue".
If they type a 3 in block A1, I want block C1 to say "Black".
And so on.

Can anyone help?

Bill
 
choose could still be used, if desired with
=IF(AND(F5>0,F5<4),CHOOSE(F5,"a","B","C"),"")
 
Back
Top