return row and column headers for matrix for duplicate values

DeonRobbie

New Member
Joined
Oct 8, 2021
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hi all
I am busting my head for past few days in getting the formulas to work. I have a building condition survey spreadsheet where the physical condition of different items in different rooms get evaluated. Each item in each room receive a value from 0 to 3. 0=good and 3 = severe / critical.
The matrix is 17 rows by 12 columns, with items inspected in the first column, and rooms inspected in the first row.I need a method to find all cells with condition 3 to return the corresponding column header and row. Any possible suggestions?


1633694320633.png

Regards DeonRobbie
 

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.
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQ
1Room 1Room 2Room 3Room 4Room 5Room 6Room 7Room 8Room 9Room 10Room 11Room 12
2ABRoom 2
3B33BRoom 5
4CDRoom 5
5D3RRoom 1
6ERRoom 12
7F  
8G
9H
10I
11J
12K
13L
14M
15N
16O
17P
18Q
19R33
Master
Cell Formulas
RangeFormula
P2:P7P2=IFERROR(INDEX($A$2:$A$19,AGGREGATE(15,6,(ROW($A$2:$A$19)-ROW($A$2)+1)/($C$2:$N$19=3),ROWS(P$2:P2))),"")
Q2:Q7Q2=IFERROR(INDEX($C$1:$N$1,AGGREGATE(15,6,(COLUMN($C$1:$N$1)-COLUMN($C$1)+1)/($A$2:$A$19=P2)/($C$2:$N$19=3),COUNTIFS(P$2:P2,P2))),"")
 
Upvote 0
Solution
Looks like @Fluff and I came up with the same approach...

DeonRobbie.xlsx
ABCDEFGHI
1OutsideBedroom 1Bedroom 2Bedroom 3BathroomToiletLoungeKitchen
2Structure11111111
3Roof13111110
4Walls11301100
5Floors11133331
6Ceilings111113
7Stairs1111300
8Windows111111
9Doors1111111
10
11Severe and Critical Defects (only items marked "3" above).
12RoofBedroom 1
13WallsBedroom 2
14FloorsBedroom 3
15FloorsBathroom
16FloorsToilet
17FloorsLounge
18CeilingsKitchen
19StairsToilet
20  
Sheet1
Cell Formulas
RangeFormula
A12:A20A12=IFERROR(INDEX($A$2:$A$9,AGGREGATE(15,6,ROW($B$2:$I$9)-ROW($A$1)/($B$2:$I$9=3),ROW()-ROW($A$11))),"")
B12:B20B12=IFERROR(INDEX($B$1:$I$1,AGGREGATE(15,6,COLUMN($B$1:$I$1)-COLUMN($A$1)/(($A$2:$A$9=$A12)*($B$2:$I$9=3)),COUNTIF($A$12:$A12,$A12))),"")
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQ
1Room 1Room 2Room 3Room 4Room 5Room 6Room 7Room 8Room 9Room 10Room 11Room 12
2ABRoom 2
3B33BRoom 5
4CDRoom 5
5D3RRoom 1
6ERRoom 12
7F  
8G
9H
10I
11J
12K
13L
14M
15N
16O
17P
18Q
19R33
Master
Cell Formulas
RangeFormula
P2:P7P2=IFERROR(INDEX($A$2:$A$19,AGGREGATE(15,6,(ROW($A$2:$A$19)-ROW($A$2)+1)/($C$2:$N$19=3),ROWS(P$2:P2))),"")
Q2:Q7Q2=IFERROR(INDEX($C$1:$N$1,AGGREGATE(15,6,(COLUMN($C$1:$N$1)-COLUMN($C$1)+1)/($A$2:$A$19=P2)/($C$2:$N$19=3),COUNTIFS(P$2:P2,P2))),"")
Is there a way to do exactly this but return cells with any value not equal to zero? I am trying to get the Row and Column Header into one dynamic list for each non zero cell in the array.
 
Upvote 0
Is there a way to do exactly this but return cells with any value not equal to zero?
Welcome to the MrExcel board!
Is this what you mean?

23 11 25.xlsm
ABCDEFGHIJKLMNOPQ
1Room 1Room 2Room 3Room 4Room 5Room 6Room 7Room 8Room 9Room 10Room 11Room 12
2ABRoom 2
3B33000BRoom 5
4C000DRoom 5
5D3000ERoom 1
6E5000GRoom 10
7F000LRoom 9
8G00022RRoom 1
9H000RRoom 5
10I0000RRoom 10
11J000RRoom 11
12K000RRoom 12
13L33  
14M  
15N  
16O  
17P  
18Q  
19R32000983  
Row Col Headers
Cell Formulas
RangeFormula
P2:P19P2=IFERROR(INDEX($A$2:$A$19,AGGREGATE(15,6,(ROW($A$2:$A$19)-ROW($A$2)+1)/($C$2:$N$19<>0),ROWS(P$2:P2))),"")
Q2:Q19Q2=IFERROR(INDEX($C$1:$N$1,AGGREGATE(15,6,(COLUMN($C$1:$N$1)-COLUMN($C$1)+1)/($A$2:$A$19=P2)/($C$2:$N$19<>0),COUNTIFS(P$2:P2,P2))),"")
 
Last edited:
Upvote 0
Hi Peter, thanks for the quick reply. I have tried <>O but this returns the column and row header corresponding to A1 in my matrix, for all results, and A1 is blank.
 
Upvote 0
and A1 is blank.
.. but perhaps contains a formula returning "" so is not in fact blank?
Try these instead
P2 copied down:
Excel Formula:
=IFERROR(INDEX(A$2:A$19,AGGREGATE(15,6,(ROW(A$2:A$19)-ROW(A$2)+1)/(C$2:N$19<>"")/(C$2:N$19<>0),ROWS(P$2:P2))),"")

Q2 copied down:
Excel Formula:
=IFERROR(INDEX(C$1:N$1,AGGREGATE(15,6,(COLUMN(C$1:N$1)-COLUMN(C$1)+1)/(A$2:A$19=P2)/(C$2:N$19<>"")/(C$2:N$19<>0),COUNTIFS(P$2:P2,P2))),"")
 
Upvote 0
.. but perhaps contains a formula returning "" so is not in fact blank?
Try these instead
P2 copied down:
Excel Formula:
=IFERROR(INDEX(A$2:A$19,AGGREGATE(15,6,(ROW(A$2:A$19)-ROW(A$2)+1)/(C$2:N$19<>"")/(C$2:N$19<>0),ROWS(P$2:P2))),"")

Q2 copied down:
Excel Formula:
=IFERROR(INDEX(C$1:N$1,AGGREGATE(15,6,(COLUMN(C$1:N$1)-COLUMN(C$1)+1)/(A$2:A$19=P2)/(C$2:N$19<>"")/(C$2:N$19<>0),COUNTIFS(P$2:P2,P2))),"")
Hi Peter, sorry I should have specified. You are correct in that it`s reading from a dynamically calculated matrix. I tried <>0, and <>"", both of which return the row and column headers corresponding to the A1 position of the matrix. It`s as if without a specific value to search for it just looks to the first poition and says "I found it". This is a challenging problem for sure, the equations above are the closest I`ve seen.
 
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

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