INDEX/MATCH with multiple criteria -- if value isn't found, ignore it, and search for something else

Copper Contributor

Not sure if this is possible; I have the following table. 

 

MICROSOFTHELP_0-1587903417216.png

 

This is a dummy table but it relates to my actual in the exact same way. It's about upgrading airports; as we can see I look for the price of the upgrade using an arrayed INDEX/MATCH, and this works without any problem for all of them. I then multiply it by a scaled value (sourced elsewhere), to get the value in K11. 

 

Now here's the issue, I have a division column in K13:

 

MICROSOFTHELP_1-1587903562295.png

 

As we can see, it yields the value of K11 if K8 does not contain the character /; otherwise it divides it by two. Sometimes for these airports, if they are medium in size but we do not have data on such, we take them as if they're in between small and large, and divide the corresponding price by two (again, this isn't what my actual table has but for the sake of this example it does work very similarly). 

 

So, my question is, for 'entry form for Size, is there a way to type in "Small / Large", and have the INDEX/MATCH function automatically look for 'Small' in the table, rather than having to copy more of the above table just to add 'small / large' into size (and instead keep it as it is)? 

 

Obviously this wouldn't be a problem for the above, but my actual table is a lot bigger so adding that many more duplicates  with just the changing airport size will make it look really large and an eye-sore.

 

Thank you ver much :) 

 

 

2 Replies

I *think* this is what you're looking for:

 

=INDEX(Price, MATCH( IF( ISERROR( FIND("/",Division) ), Division, TRIM( LEFT( L11, FIND( "/", Division)-1 ) ) ), Size, 0) )

For INDEX-MATCH, the logic is: Index on the price by matching a calculated value in the Size column, using a match-type of zero. 

 

For the calculated value, the logic is: If "/" does NOT exist in the Division text, return the Division text. Otherwise, return the TRIMmed text before the "/" in the Division cell. 

 

=INDEX( Price,
               MATCH(
                   IF(
                        ISERROR( FIND("/", Division) ),
                        Division,
                        TRIM(
                            LEFT(
                                     L11,
                                     FIND( "/", Division)-1 ) )  ),
                Size,

                0) )

 

Hi @MICROSOFTHELP 

 

I will introduce another helper cell in K2 to use “Small” instead of “Small / Large” and this cell will be used in the formula for K10.

Please clarify if this statement is correct for what you want to achieve for K13

 

“As we can see, it yields the value of K11 if K8 does not contain the character /; otherwise it divides it by two”

or it should be the other way round.

 

I have attached the worksheet that shows the expected outcome, let me know if it solves the question.