Forum Discussion
Remya Ramakrishnan
Jan 31, 2018Copper Contributor
How to retrieve column header for non empty zero values as rows in a seperate sheet?
I have been playing around with a problem for a few days, if you could help me to derive a solution, it would be great!
Resource 1
Resour...
Willy Lau
Jan 31, 2018Iron Contributor
Assumption:
- your table on A1:AY501 in sheet1, where project column on column a, and resource headers from B1 to AY1.
- project selection cell on A1 in sheet2
- resource listing from A3:B53. Its size matches with total number of resource
- resource with empty cell or 0(zero) will not be listed
Steps:
- In Name manager, create a name, ProjectData
=Sheet1!$A$2:$A$501
- In Name manager, create a name, ResourceData
=Sheet1!$B$2:$AY$501
- In Name manager, create a name, ResourceHeaders
=Sheet1!$B$1:$AY$1
- In Name manager, create a name, SelectedProject
=Sheet2!$A$1
- In Name manager, create a name, ProjectResourceRow
=INDEX(ResourceData, MATCH(SelectedProject,ProjectData,0),0)
- In Name manager, create a name, ColumnList
=IF(--(ProjectResourceRow<>0)=0,NA(),--(ProjectResourceRow<>0)*(COLUMN(ProjectResourceRow)-COLUMN(Sheet1!$A:$A)))
- In Sheet2, cell A3
=IFERROR(INDEX(ResourceHeaders, 1, AGGREGATE(15,3,ColumnList,ROW(Sheet2!A3)-ROW(Sheet2!$A$2))),"")
- In Sheet2, cell B3
=IFERROR(INDEX(ProjectResourceRow, 1, AGGREGATE(15,3,ColumnList,ROW(Sheet2!A3)-ROW(Sheet2!$A$2))),"")
- Copy Sheet2!A3:B3, and paste the formula to Sheet2!A4:B53.
Try it.
- Remya RamakrishnanFeb 05, 2018Copper Contributor
Hello Willy Lau,
Thank you for the explanation, I could solve my problem using this formula too.
Really overwhelmed by the response I got from this community, and hats off to all your logic, most of the solutions suggested by community members
Willy Lau wrote:
Assumption:
- your table on A1:AY501 in sheet1, where project column on column a, and resource headers from B1 to AY1.
- project selection cell on A1 in sheet2
- resource listing from A3:B53. Its size matches with total number of resource
- resource with empty cell or 0(zero) will not be listed
Steps:
- In Name manager, create a name, ProjectData
=Sheet1!$A$2:$A$501
- In Name manager, create a name, ResourceData
=Sheet1!$B$2:$AY$501
- In Name manager, create a name, ResourceHeaders
=Sheet1!$B$1:$AY$1
- In Name manager, create a name, SelectedProject
=Sheet2!$A$1
- In Name manager, create a name, ProjectResourceRow
=INDEX(ResourceData, MATCH(SelectedProject,ProjectData,0),0)
- In Name manager, create a name, ColumnList
=IF(--(ProjectResourceRow<>0)=0,NA(),--(ProjectResourceRow<>0)*(COLUMN(ProjectResourceRow)-COLUMN(Sheet1!$A:$A)))
- In Sheet2, cell A3
=IFERROR(INDEX(ResourceHeaders, 1, AGGREGATE(15,3,ColumnList,ROW(Sheet2!A3)-ROW(Sheet2!$A$2))),"")
- In Sheet2, cell B3
=IFERROR(INDEX(ProjectResourceRow, 1, AGGREGATE(15,3,ColumnList,ROW(Sheet2!A3)-ROW(Sheet2!$A$2))),"")
- Copy Sheet2!A3:B3, and paste the formula to Sheet2!A4:B53.
Try it.
worked for me. Thank you once again.- Willy LauFeb 06, 2018Iron Contributor
In fact, I am waiting the community members to update me there is a better solution for this topic (easier to accomplish the goal/better performance). They are really great.