3

Currently I am using this formula:

=INDEX(STP_Data!F70:G78, MATCH(7443, STP_Data!$G$70:$G$78, 0), 1)

I need to have it also look for 7664 if it does not find 7443. I don't know how to approach including this into the formula. Do you guys have any idea? Thanks!

1
  • Your MATCH locks the lookup range with absolute columns and rows but the return range in INDEX does not. Shouldn't both be locked or both be unlocked? Commented Mar 17, 2017 at 16:50

2 Answers 2

4

Give this a try and let me know if that solves it:

=IFERROR(INDEX(STP_Data!F70:G78, MATCH(7443, STP_Data!$G$70:$G$78, 0), 1), INDEX(STP_Data!F70:G78, MATCH(7664, STP_Data!$G$70:$G$78, 0), 1))
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I didn't know you can use IFERROR this way. I usually only use it to get rid of NULL.
2

The IFERROR function can pass processing to an alternate if the first attempt fails. Like Ralph's solution above but uses IFERROR internally on the MATCH for a slightly shorter formula.

=INDEX(STP_Data!F70:F78, IFERROR(MATCH(7443, STP_Data!$G$70:$G$78, 0), MATCH(7664, STP_Data!$G$70:$G$78, 0)))

You don't need to specify the column in INDEX if you only reference column F.

4 Comments

Thanks @Ralph - still getting used to a Surface's bat-crap-crazy keyboard.
Thanks! this works as well! Out of curiosity if I were to expand this to have it look for a second 7443 occurrence how would I implement that into my formula?
Well, that would be a new question since you made no mention of multiple returns but you could find an answer here. That method could also be used to return multiple matches for 7443 OR 7664.
Pefect I can definitely use that! Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.