Return Multiple Column headings in a single Cell

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Book1
ABCDEFGHIJK
1Mark 1Mark 2Mark 3Mark 4Mark 5Mark 6Mark 7Mark 8Mark 9Mark 10
212xx45101091Mark 3,Mark 4
35x6864985xMark 2,Mark 10
Sheet1


In K2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(",",TRUE,IF($A2:$J2="x",$A$1:$J$1,""))
 
Upvote 0
Hi Aladin,

I'm using EXCEL 2013, But when i try this it is not working.
It gives below error "#NAME?"

Plz help me with another formulas.

Thanks


[TABLE="width: 1004"]
<colgroup><col span="9"><col><col></colgroup><tbody>[TR]
[TD]Mark 1[/TD]
[TD]Mark 2[/TD]
[TD]Mark 3[/TD]
[TD]Mark 4[/TD]
[TD]Mark 5[/TD]
[TD]Mark 6[/TD]
[TD]Mark 7[/TD]
[TD]Mark 8[/TD]
[TD]Mark 9[/TD]
[TD]Mark 10[/TD]
[TD]Answer[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD]X[/TD]
[TD]X[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]=[/TD]
[TD]TEXTJOIN(",",TRUE,IF($A2:$J2="X",$A$1:$J$1,""))[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]x[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]5[/TD]
[TD]X[/TD]
[TD="align: center"]#NAME?[/TD]
[/TR]
</tbody>[/TABLE]


ABCDEFGHIJK
Mark 1Mark 2Mark 3Mark 4Mark 5Mark 6Mark 7Mark 8Mark 9Mark 10
xxMark 3,Mark 4
xxMark 2,Mark 10

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]

[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]1[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]5[/TD]

[TD="align: right"]6[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]5[/TD]

</tbody>
Sheet1

In K2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(",",TRUE,IF($A2:$J2="x",$A$1:$J$1,""))
 
Upvote 0
Hi Aladin,

I'm using EXCEL 2013, But when i try this it is not working.
It gives below error "#NAME ?"

Plz help me with another formulas.

Thanks

[…]

Excel 2013 does not have the TEXTJPOIN function, hence the #NAME ? error. Try the following instead...

Add the following VBA code to your workbook as a module, using Alt+F11...

Function aconcat(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant
If TypeOf a Is Range Then
For Each y In a.Cells
aconcat = aconcat & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
aconcat = aconcat & y & sep
Next y
Else
aconcat = aconcat & a & sep
End If
aconcat = Left(aconcat, Len(aconcat) - Len(sep))
End Function

Then invoke...

Control+shift+enter, not just enter:

=REPLACE(ACONCAT(IF($A2:$J2="x",","&$A$1:$J$1,"")),1,1,"")
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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