0

I have a formula in Sheet3 to look up a value from sheet1 and return it, but sometimes, if values are not in sheet1, I want it to check in sheet2. sheet1 and sheet2 have same data in column A:A, only columns have different values.

=INDEX(Sheet1!D:D,MATCH(Sheet3!A2&"MAN_CHANGE",Sheet1!A:A,0))

How can I modify the formula to check in sheet2 if there's not a match in sheet1?

3 Answers 3

3

Glad to hear from you again!) Try this please:

=INDEX(Sheet1!D:D,IFERROR(MATCH(Sheet3!A2&"MAN_CHANGE",Sheet1!A:A,0),MATCH(Sheet3!A2&"MAN_CHANGE",Sheet2!A:A,0)))
2
  • I eneded up changing formula to =IFERROR(VLOOKUP(A2&"MAN_CHANGE",Sheet1!A:D,4,FALSE),VLOOKUP(A2&"MAN_CHANGE",Sheet2!A:D,4,FALSE)) Since for previous formula Index(Sheet1!D:D, was still looking to grab value from there.
    – Mowgli
    Feb 1, 2013 at 20:19
  • @Mowgli I think that's the best case possible - when you're not just copy&paste the answer provided, but may easily adopt it fir your further needs with complete understanding WHAT & WHY)
    – Peter L.
    Feb 1, 2013 at 21:48
2

iferror will check for any error result from the index formula

=iferror(INDEX(Sheet1!D:D,MATCH(Sheet3!A2&"MAN_CHANGE",Sheet1!A:A,0)),"NOT FOUND")

Alternatively you could use isNA to search just for #N/A

=if(ISNA(INDEX(Sheet1!D:D,MATCH(Sheet3!A2&"MAN_CHANGE",Sheet1!A:A,0)),"NOT FOUND",INDEX(Sheet1!D:D,MATCH(Sheet3!A2&"MAN_CHANGE",Sheet1!A:A,0)))
-1

I nested two INDEX,MATCH formulas and it worked.

=IFERROR(INDEX('Activity Report 11-30-17'!G:G,MATCH('Recon Report 11-30-17'!C2,'Activity Report 11-30-17'!D:D,0)),INDEX('Activity Report 11-30-17'!G:G,MATCH('Recon Report 11-30-17'!D2,'Activity Report 11-30-17'!D:D,0)))

1
  • That is just terrible, unreadable and impossible to maintain. Mar 19, 2019 at 3:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.