 SOLVED

# If within an If then another then another...(with a twist)

Frequent Contributor

# If within an If then another then another...(with a twist)

Hello,

I've been trying to figure out the syntax for my formula but I can't. I need your help.

Okay, here is what I am trying to do:

IF a value is find in a given range do another if(match) then if another value is find that range do another if(match) so on... But for each specific 'if' if the value is not found then set the value of the cell "sth".

=IF(MATCH(Names!A2,S17:S20,0),IF(MATCH(Names!A3,S17:S20),IF(MATCH(Names!A4,S17:S20),"sth","sth1","sth2")

This is what I've been tinkering with but I can't get it to work. Where should I put the value if false for every if?

So if first one evaluates true, the true condition of that statement is another if statement. in that statement there is another if statement. for each if statement I need to set the value to sth if it evaluates false then stop there. I'm having trouble placing the false portion of each if.

Am I making any sense?

3 Replies

# Re: If within an If then another then another...(with a twist)

What do you want to return if the third match is found?

best response confirmed by kheldar (Frequent Contributor)
Solution

# Re: If within an If then another then another...(with a twist)

As variant

``````=IF( ISNA( MATCH( Names!A2, S17:S20, 0 ) ),
IF( ISNA( MATCH( Names!A3, S17:S20, 0 ) ),
IF( ISNA( MATCH( Names!A4, S17:S20, 0 ) ),