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.
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
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...