Match value if 1 cell contains many values with a formula in an excel report

In some of my reports, using vlookup to display the good data is not working for cells containing a long description or many different names, particularly when I am looking for only 1 specific word. For instance, I want to know the value of chocolate for Spain, so vlookup works great if in the column “country” 1 cell = 1 country but not good if 1 cell = 10 countries.

formula excel formula excel

 

When I use the formula ?

When in 1 single cell contains a lot of information.

 

How to use the formula ?

The formula in this topic is with "," so depending of the operating system of your PC, the formula should have ";" instead of ",".

 

How is/are the formula(s) ?

=INDEX()

=MATCH()

=INDEX('sheet2'!A:C,MATCH("*"&A2&"*",'sheet2'!A:A,0)+0,3)

Explanation:

  • 1. 'sheet2'!A:C
    Asking to search in the sheet2 between the column A and C
  • 2. "*"&A2&"*",'sheet2'!A:A,0
    Asking to take as reference cell A2 of sheet1 to look in the column A of sheet2 (note: A2 = Spain)
  • 3. +0,3
    So if “Spain” is found in the column A of sheet2, asking to display the value of chocolate in the column C (3 = C) of sheet2

As I said, if you have 1 cell = 1 value, use vlookup, read Search in different sheets then display the wanted data with a formula in an excel report.

Interesting Topics