Return all column headers where the cells are not blank

rubbis_with_excel

New Member
Joined
Jan 19, 2004
Messages
28
Hi,
I'm really struggling with a formula and I was hoping someone might be able to help.

I have a table such as this:

Name__System1__System2__System3
........................................................
Adam__100%....__0%.......__0%
Bill....__50%.....__50%......__0%
Claire__25%.....__25%......__50%

And in a separate sheet I want a formula to show each header when the relevant person's cell is not blank. Such as:

Name__Systems
........................
Adam__System1
Bill....__System1,System2
Claire__System1,System2,System3

The problem is that I can't use VBA and I can't add any columns or rows, so I need to house everything in the cell only.

Does anyone have any tidy solutions in mind?

Thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Book1
ABCD
1NameSystem1System2System3
2Adam100%0%0%
3Bill50%50%0%
4Claire25%25%50%
Sheet1



Book1
ABCD
1NameSystem
2Adam1
3Bill0.50.5
4Claire0.250.250.5
Sheet2


In B2 of Sheet2 control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX(Sheet1!$B$2:$D$4,MATCH($A2,Sheet1!$A$2:$A$4,0),SMALL(IF($A$2:$A$4=$A2,IF(ISNUMBER(1/Sheet1!$B$2:$D$4),IF(Sheet1!$B$2:$D$4>0,COLUMN(Sheet1!$B$2:$D$4)-COLUMN(Sheet1!$B$2)+1))),COLUMNS($B2:B2))),"")
 
Upvote 0
Such as:

Name__Systems
........................
Adam__System1
Bill....__System1,System2
Claire__System1,System2,System3

with PowerQuery

NameSystem1System2System3NameSystem
Adam
100%​
0%​
0%​
AdamSystem1
Bill
50%​
50%​
0%​
BillSystem1,System2
Claire
25%​
25%​
50%​
ClaireSystem1,System2,System3

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> 0)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Value"}),
    #"Grouped Rows" = Table.Group(#"Removed Columns", {"Name"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "System", each Table.Column([Count],"Attribute")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"System", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns1" = Table.RemoveColumns(#"Extracted Values",{"Count"})
in
    #"Removed Columns1"[/SIZE]

result table can be loaded anywhere
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,947
Members
448,534
Latest member
benefuexx

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