Search code examples
excelexcel-formulaexcel-2010excel-2007

VLOOKUP with OR (Choices) in using different cell as a choice


How do I use Vlookup function with OR

For example if there is one value in the table either it is adj P/E or P/E or P/E ord adj.

I want to lookup that value.


Solution

  • There are two ways:

    First if there is a common word in all the criteria that is unique, in your example P/E you can use wildcards:

    =VLOOKUP("*" & "P/E" & "*",$H4:$L20,3,False)
    

    Where $H4:$L20 is your dataset and you want the third column in that dataset.

    If not then you need to do the long way using IFERROR():

    =IFERROR(VLOOKUP(A1,$H4:$L20,3,False),IFERROR(VLOOKUP(B1,$H4:$L20,3,False),IFERROR(VLOOKUP(C1,$H4:$L20,3,False)IFERROR(VLOOKUP(D1,$H4:$L20,3,False),""))))
    

    This will cycle through the criteria till it finds one that works.