=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
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,595
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.
 

Forum statistics

Threads
1,186,176
Messages
5,956,374
Members
438,249
Latest member
georgebasalic3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top