simmy
simmy

Reputation: 3

IF Function with different values returned based on multiple conditions

I want to use a formula that lets me to do the following in excel.

If A2="7M" then return FED If A2 = "61" then return EC or else none of those then return DTC

Upvotes: 0

Views: 94

Answers (3)

Hasib_Ibradzic
Hasib_Ibradzic

Reputation: 666

you just need a nested if statement =if(A2="7M","FED",if(A2=61,"EC","DTC"))

Upvotes: 1

BruceWayne
BruceWayne

Reputation: 23283

=IF(A2="7M","FED",IF(OR(A2="61",A2=61),"EC","DTC"))

The OR() will catch both 61 as a number or text.

Or, if you want to add more conditions, use a VLOOKUP():

=IFERROR(VLOOKUP(A2,$C$2:$D$10,2,FALSE),"DTC")

with C2:D10:

enter image description here

So if you want, say, 3M to return FNKY, just put 3M in C4, and FNKY in D4.

Upvotes: 1

Gary's Student
Gary's Student

Reputation: 96753

Use this:

=IF(A2="7M","FED",IF(A2="61","EC","DTC"))

This assumes that you are looking for a text 61 rather than a numeric value.

Upvotes: 1

Related Questions