=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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,822
Messages
5,772,469
Members
425,760
Latest member
zj042060

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