=if function (mutiples)

nkll

New Member
Joined
Jan 21, 2004
Messages
6
this should be easy (i think)

A1=can be equal to Coach, Player, Owner

B1 =if(A1="coach",1) if(A1="player",2) if(A1="owner"3)

My question is...how do you combine these "if" statements...use an "or" ????

any help is appriciated...thanks
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,592
Hi there

try

B1 =if(A1="coach",1, if(A1="player",2, if(A1="owner",3,"")))

regards
Derek
 

Jay Petrulis

MrExcel MVP
Joined
Mar 17, 2002
Messages
2,040
Hi,

Try the following...

=IF(A1="Coach",1,IF(A1="Player",2,3))
=IF(A1="Coach",1,IF(A1="Player",2,IF(A1="Owner",3,"")))
=MATCH(A1,{"Coach","Player","Owner"})
 

Yogi Anand

MrExcel MVP
Joined
Mar 12, 2002
Messages
11,454
Hi nkll:

I think Jay's contribution using the MATCH function is very compact -- however I will use it with the 0 argument added -- as in ...

=MATCH(A1,{"Coach","Player","Owner"},0)

to get a corrsponding result of 1, 2, or 3 depending on whether the entry in A1 is Coach, Player, or Owner.
 

nkll

New Member
Joined
Jan 21, 2004
Messages
6
Jay Petrulis said:
Hi,

Try the following...

=IF(A1="Coach",1,IF(A1="Player",2,3))
=IF(A1="Coach",1,IF(A1="Player",2,IF(A1="Owner",3,"")))
=MATCH(A1,{"Coach","Player","Owner"})


Thanks.....=IF(A1="Coach",1,IF(A1="Player",2,3))
this worked
 

Jay Petrulis

MrExcel MVP
Joined
Mar 17, 2002
Messages
2,040
nkll said:
Jay Petrulis said:
Hi,

Try the following...

=IF(A1="Coach",1,IF(A1="Player",2,3))
=IF(A1="Coach",1,IF(A1="Player",2,IF(A1="Owner",3,"")))
=MATCH(A1,{"Coach","Player","Owner"})


Thanks.....=IF(A1="Coach",1,IF(A1="Player",2,3))
this worked

Just be careful on this one. If the cell is blank or has anything other than the options listed, this formula will default to 3.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,096
Messages
5,545,926
Members
410,713
Latest member
TaremyLunsil
Top