Find if value in B1 (sheet2) is in Column (on sheet 1) with a header name in A1 (Sheet2)

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
594
Office Version
  1. 365
Hopefully this makes sense!

On Sheet 1 I have my master data sheet, with Column Headers in Row 1 and the values relating to that in the cells below.

On Sheet 2, in column A I have the name of a column header, and in Column B (on same row) I have a value.

I would like it to come back "Yes", or "No", depending if the value is in that column


Sheet1
ANIMALCITY
HorseAberdeen
CatBelfast
DogCardiff


Sheet2

ANIMALCatYES
ANIMALElephantNo
CITYAberdeenYES
CITYDarlingtonNO
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try something like this. You may need to adjust the ranges to suit your actual data size and layout.

surkdidat.xlsm
AB
1ANIMALCITY
2HorseAberdeen
3CatBelfast
4DogCardiff
Sheet1


surkdidat.xlsm
ABC
1ColumnValueExists?
2ANIMALCatYES
3ANIMALElephantNO
4CITYAberdeenYES
5CITYDarlingtonNO
Sheet2
Cell Formulas
RangeFormula
C2:C5C2=IF(ISNUMBER(MATCH(B2,INDEX(Sheet1!A$1:E$100,0,MATCH(A2,Sheet1!A$1:E$1,0)),0)),"YES","NO")
 
Upvote 0
Solution
Try something like this. You may need to adjust the ranges to suit your actual data size and layout.

surkdidat.xlsm
AB
1ANIMALCITY
2HorseAberdeen
3CatBelfast
4DogCardiff
Sheet1


surkdidat.xlsm
ABC
1ColumnValueExists?
2ANIMALCatYES
3ANIMALElephantNO
4CITYAberdeenYES
5CITYDarlingtonNO
Sheet2
Cell Formulas
RangeFormula
C2:C5C2=IF(ISNUMBER(MATCH(B2,INDEX(Sheet1!A$1:E$100,0,MATCH(A2,Sheet1!A$1:E$1,0)),0)),"YES","NO")
Superb! Thank yoU!
 
Upvote 0

Forum statistics

Threads
1,223,578
Messages
6,173,167
Members
452,504
Latest member
frankkeith2233

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