If Function

D

DNF Karran

the "+" operator can't be used when you have text strings involved s
you have to make the 0's zero length text strings and concatenate th
if's.

=IF(E1=1,"X","")&IF(E1=2,"W","")&IF(E1=3,"Y","")&IF(E1=4,"Z","")

Can also nest the IF's to get:

=IF(E1=1,"X",IF(E1=2,"W",IF(E1=3,"X",IF(E1=4,"Z"))))

Dunca
 
R

Ron Rosenfeld

Trying to create an IF function with different criteria - ie formula in
A1:

=IF(E1=1,"X",0)+IF(E1=2,"W",0)+IF(E1=3,"Y",0)+IF(E1=4,"Z",0)

Trying to make cell A1 change to either X,W,Y,Z so it can be counted on
a separate sheet

Attachment filename: if function query.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=520650

If E1 can be only one of the stated values, then:

=CHOOSE(E1,"X","W","Y","Z")

or with some error testing:

=IF(OR(E1>4,E1<1),"out of range",CHOOSE(E1,"X","W","Y","Z"))


--ron
 
P

Pete McCosh

Rather than an IF function, how about:

=CHOOSE(E1,"x","w","y","z")

By the way, are X and W the wrong way round intentionally?

Cheers, Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top