Searching an array of cells for a value and returning the column headers where a value exists

Mattyastill

New Member
Joined
Nov 27, 2017
Messages
23
Hi,

I'm trying to find a way which i can return the column headers where a value exists in the cells F:M for the same row. As you can see from the screenshot for the first row, i would like to search for any value in row 3 and bring back the column heads for the rows. I have shown in Column N of what i would like to return if there is a value there.

I have tried a combination of Index, Match Index, Max and Index, Sum-product but just cant seem to get it working.

1576156578052.png



Any help would be much appreciated

Thanks,

Matthew
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What version of Xl are you using?
 
Upvote 0
In that case try
=TEXTJOIN(", ",1,IF(F3:M3<>"",F2:M2,""))

This will need array entry, Ctrl Shift Enter, unless you have the new Dynamic Array Functions
 
Upvote 0
In that case try
=TEXTJOIN(", ",1,IF(F3:M3<>"",F2:M2,""))

This will need array entry, Ctrl Shift Enter, unless you have the new Dynamic Array Functions

Ahhh yes that works perfectly thanks so much, only issue is in some of my columns further down in the data there are 0's rather than all being blank. Could there be additional criteria added to this so it ignores blanks and 0's?
 
Upvote 0
How about
=TEXTJOIN(", ",1,IF((F3:M3<>"")*(F3:M3<>0),F2:M2,""))
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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