Find Value in Table and Return Column Header/Row Header for Each Occurrence

jrussell19

New Member
Joined
May 16, 2013
Messages
7
Hi all,

I'll simplify the table to help, but effectively I need to return the Column Header and Row Header of each occurrence of a specific value in a table. i.e.

Value: A

A B C D E F G
1 X X X X A X X
2 X X A X X X X
3 X X X X X X X
4 X X X X X X A
5 X X X X X X X
6 X X X A X X X
7 X X X X X A X

This needs to return:
Row Header Column Header
1 E
2 C
4 G
6 D
7 F

The initial table does not have a defined amount of rows. Additional rows will be added throughout the year.

I've been pulling my hair out with match,index,offset etc but can't for the life of me work it out! Any help would be absolutely amazing!

Thanks very much.
 
However, the values in column A is not a numeric values. it's alphabetic. But I wouldn't think it would make a difference, would it?

For example: Values in A2:A8 is a,b,c,d,e,f,g instead of 1,2,3,4,5,6,7
No, still works for me. Here it is.

Excel Workbook
ABCDEFGHIJKL
1ABCDEFGValue:A0
2aXAXXAXX1
3bXXAAAXA2
4cXXXXXXX
5dXXXXXXA3
6eXXXXXXX
7fXXXAXXX4
8gXXXXXAX5
9
10aBE
11bCDEG
12dG
13fD
14gF
15
Headers Multiple (2)


1. Does the column L formula appear to be marking the correct rows?

2. Is the column A formula producing the correct letters in A10:A14?

3. If you still cannot resolve the problem, can you upload your sample file to a file-share site (eg Dropbox) and post a link here to that file?

4. What version of Excel & what operating system are you using?
 
Last edited:
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
It was an user error. I selected the incorrect range in the formula in cell B10.

{=IFERROR(INDEX($B$1:$H$1,SMALL(IF(INDEX($B$2:$H$8,MATCH($A10,$A$2:$A$8,0),0)=$K$1,COLUMN($B$1:$H$1)-COLUMN($B$1)+1),COLUMNS($B10:B10))),"")}

Again, thank you for your help.

Cheer!
 
Upvote 0
Welcome to the MrExcel board!

See if this would suffice.
K1 houses the value of interest.
L1 houses a zero.
L2 copied down.
A10 copied down
B10 copied across and down.

Excel Workbook
ABCDEFGHIJKL
1ABCDEFGValue:A0
21XAXXAXX1
32XXAAAXA2
43XXXXXXX
54XXXXXXA3
65XXXXXXX
76XXXAXXX4
87XXXXXAX5
9
101BE
112CDEG
124G
136D
147F
15
Headers Multiple

Hi Peter, gang!

New member here - found this post from Google which is EXACTLY what I need for my work however, I'm not sure if it's an office 2016 thing, but when I paste the array formula (CTRL + SHIFT + ENTER) for B10, The range (B10:H14) populates with ALL 'B' values. I've tried this both on my work PC and laptop and can't get the values showing.

Any help would be much appreciated!

Regards,
Peter
 
Upvote 0
Welxome to the MrExcel board!

when I paste the array formula (CTRL + SHIFT + ENTER) for B10, The range (B10:H14) populates with ALL 'B' values.
When you did the Ctrl+Shift+Enter, did you have the whole range B10:H14 selected? You should only have B10 selected and then after doing the C+S+E on that cell copy or drag the formula to the other cells.
 
Upvote 0
When you did the Ctrl+Shift+Enter, did you have the whole range B10:H14 selected? You should only have B10 selected and then after doing the C+S+E on that cell copy or drag the formula to the other cells.

Yep I did all that! Here are my steps:
1) Select range B10:H14,
2) Press F2
3) Pasted the following
=IFERROR(INDEX($B$1:$H$1,SMALL(IF(INDEX($B$2:$H$8,MATCH($A10,$A$2:$A$8,0),0)=$K$1,COLUMN($B$1:$H$1)-COLUMN($B$1)+1),COLUMNS($B10:B10))),"")
4) Press C+S+E

Result is B10:H14 full of B's!

To show it was in fact an array, I attempt to change a value in E12 for example, and I get an error: "You can't change part of an array" :(
 
Upvote 0
No, that's not what I suggested.
You should only have B10 selected

First remove all the formulas from B10:H14
Now
- Select B10 only
- Paste the formula in that cell only
- F2 (if you are not already in edit mode) and confirm with CSE
- Now copy or drag to the other cells in the B10,H14 range.
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,348
Members
452,638
Latest member
Oluwabukunmi

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