1

I have an Excel formula that matches a cell on one spredsheet and searches through a column on another, then returns the contents of adjacent cells to that column for any matches. The problem is I need to search through two different columns for that match, and if either of the columns contains the match, return another adjacent cell. I have tried using:

=INDEX('PNO Lookup'!$A:$A,MATCH(Summary!D25,'PNO Lookup'!$G:$J,0))

which should search from column G to column J, but I get a #VALUE error. Can anyone explain how I would search both column G and J for the value in cell D25?

5
  • Try this =INDEX('PNO Lookup'!$A:$J,MATCH(Summary!D25,'PNO Lookup'!$G:$J,0)) Commented Feb 9, 2018 at 2:31
  • That one returns a #N/A error unfortunately. Commented Feb 9, 2018 at 2:34
  • $G:$J is not 'two different columns'. Commented Feb 9, 2018 at 2:36
  • @david_10001 you have not given the column index number. The formula works like this Index(lookup range, row number, column number) you are missing the column number Commented Feb 9, 2018 at 2:38
  • 2
    @PraveenRKaruppannan column number is optional. If the range is only one column or row it is not needed. Commented Feb 9, 2018 at 2:40

2 Answers 2

2

use:

=INDEX('PNO Lookup'!$A:$A,MIN(IFERROR(MATCH(Summary!D25,'PNO Lookup'!$G:$G,0),1E+99),IFERROR(MATCH(Summary!D25,'PNO Lookup'!$J:$J,0),1E+99)))
Sign up to request clarification or add additional context in comments.

3 Comments

Good for column G or column J; personally I found the match column description confusing. e.g. 'two different columns' vs, ''PNO Lookup'!$G:$J' vs. 'from column G to column J' vs. 'both column G and J'.
yes I assumed the first and the last. Either way yours is shorter.
don't know about that, been on the road a lot lately. I don't see that stopping anytime soon.
2

Along the same idea as the previous answer but a little shorter.

=INDEX('PNO Lookup'!$A:$A, IFERROR(MATCH(Summary!D25, 'PNO Lookup'!$G:$G, 0),
                           IFERROR(MATCH(Summary!D25, 'PNO Lookup'!$H:$H, 0),
                           IFERROR(MATCH(Summary!D25, 'PNO Lookup'!$I$I, 0),
                           MATCH(Summary!D25, 'PNO Lookup'!$J:$J, 0)))))

Comments

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.