Lookup Help - Scan Grid of data and if a value exist return the header - Excel 2016

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
693
Office Version
  1. 2016
Platform
  1. MacOS
Hello all,

I am working on a project and I have come to a problem I don't know how to solve,

I have a grid of Data, Row Descriptions (Column B), and then My headers in columns "H:AP" and then the corresponding rows in between Range("H9:AP128").

So, I need code or even a formula that will go row by row, Example( Scan Row 9, if a value exists anywhere in the range of ("H9:AP9") Return the Header. I would need the returned headers to be side by side without any blanks in between.

The results can be on a secondary sheet.


Sample Layout:
Row DescriptionHeader1Header2Header3Header4Header5
Misc 112
Misc 2111

<tbody>
</tbody>


So for Misc 1: The returned values will look like: Header2, Header 4

So for Misc 2: The returned values will look like: Header1, Header2, Header 3

Each returned value will be in a new column left to right so that I can copy each value in one cell.

Hopefully this is somewhat clear.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
With data like


Book1
ABCDEF
1Row DescriptionHeader1Header2Header3Header4Header5
2Misc 112
3Misc 2111
Sheet1


Try


Book1
ABCD
1
2Misc 1Header2Header4
3Misc 2Header1Header2Header3
Sheet2
Cell Formulas
RangeFormula
B2=IFERROR(INDEX(Sheet1!$B$1:$F$1,AGGREGATE(15,6,(COLUMN(Sheet1!$B$1:$F$1)-COLUMN(Sheet1!$B$1)+1)/((Sheet1!$A$2:$A$3=$A2)*(Sheet1!$B$2:$F$3<>"")),COLUMNS($A$1:A$1))),"")


Just copy the formula down & across
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,709
Members
449,093
Latest member
Mnur

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