Search code examples
excelexcel-2010excel-2007

Excel lookup by text


I am trying to make lookup for excel table using the text in the columns For example if i have

A1 | A2

BMW-X6 | 1

BMW-X5 | 1

Mazda-1 | 2

Mazda-2 | 2

Mazda-3 | 2

Mercedes-Benz | 3

Mercedes- cls | 3

I want where there is Bmw in A1 the value is 1 in a2, and so on, any help ?

Thanks, Morad.


Solution

  • =IFERROR(MATCH(TRUE,ISNUMBER(SEARCH({"BMW","Mazda","Mercedes"},A2)),0),"")
    

    Add more manufacturers as required.

    Must be entered as an array formula in B2 using Ctrl Shift Enter

    enter image description here