Compare value in 1 column to values in multiple columns

Garmerr

New Member
Joined
Sep 13, 2017
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello - I would like to compare the value in one column to see if that value is included in a list of values across multiple columns. The purpose of this to see if the actual value is present in the list of possible values. If it is included, then there should be a confirmation statement (e.g., Included). If it is not included, there should be some guidance statement (e.g. Select new Value).

I have thought about trying to concat the possible values and searching the resulting string, but not sure if there is an easier approach.

Data Setup
Actual ValueName
2001CP10
1995CP11
4300CP08

NamePossible Value1Possible Value 2Possible Value 3Possible Value 4Possible Value X
CP10200120022300
CP1119972001
CP0810001500200043009999

Ideal Result
NameResult
CP10Included
CP11Select new Value
CP08Included
 

Attachments

  • Value Lookup.jpg
    Value Lookup.jpg
    43.2 KB · Views: 4

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Formula in C2 and copied down:
Excel Formula:
=IF(COUNTIF(F2:J2,A2)>0,"Included","Select New Value")
Book1
ABCDEFGHIJ
1Actual ValueNameResultNamePossible Value1Possible Value 2Possible Value 3Possible Value 4Possible Value X
22001CP10IncludedCP10200120022300
31995CP11Select New ValueCP1119972001
44300CP08IncludedCP0810001500200043009999
Sheet1
 
Upvote 0
If your Actual Value and Name are on the same row as the possible values, then @mumps solution is ideal. However, if the Actual Value and Name aren't in the same row as the possible values, or perhaps they appear in a different order than the lookup table, then you'll need to: 1) confirm that you have a Name match, and 2) determine which row in the lookup table is needed. Then a more complicated solution is needed...here is one approach:
Book1
ABCDEF
1NamePossVal1PossVal2PossVal3PossVal4PossVal5
2CP10200120022300
3CP1119972001
4CP0810001500200043009999
Sheet1

Book1
ABC
7Actual ValueNameResult
82001CP10included
91995CP11select new value
104300CP08included
114300CP09no name match
12999CP08select new value
Sheet1
Cell Formulas
RangeFormula
C8:C12C8=LET(a,MATCH(B8,$A$2:$A$4,0),b,SUM(--(INDEX($B$2:$F$4,a,)=A8)),IFS(ISERROR(a),"no name match",b>=1,"included",TRUE,"select new value"))
 
Upvote 0
Solution
Formula in C2 and copied down:
Excel Formula:
=IF(COUNTIF(F2:J2,A2)>0,"Included","Select New Value")
Book1
ABCDEFGHIJ
1Actual ValueNameResultNamePossible Value1Possible Value 2Possible Value 3Possible Value 4Possible Value X
22001CP10IncludedCP10200120022300
31995CP11Select New ValueCP1119972001
44300CP08IncludedCP0810001500200043009999
Sheet1
This method works.
 
Upvote 0
If your Actual Value and Name are on the same row as the possible values, then @mumps solution is ideal. However, if the Actual Value and Name aren't in the same row as the possible values, or perhaps they appear in a different order than the lookup table, then you'll need to: 1) confirm that you have a Name match, and 2) determine which row in the lookup table is needed. Then a more complicated solution is needed...here is one approach:
Book1
ABCDEF
1NamePossVal1PossVal2PossVal3PossVal4PossVal5
2CP10200120022300
3CP1119972001
4CP0810001500200043009999
Sheet1

Book1
ABC
7Actual ValueNameResult
82001CP10included
91995CP11select new value
104300CP08included
114300CP09no name match
12999CP08select new value
Sheet1
Cell Formulas
RangeFormula
C8:C12C8=LET(a,MATCH(B8,$A$2:$A$4,0),b,SUM(--(INDEX($B$2:$F$4,a,)=A8)),IFS(ISERROR(a),"no name match",b>=1,"included",TRUE,"select new value"))
This method works and is preferred for the multi table data set.
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,189
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top