Formula to pull up column/row head based on cell in data set

cee_real

New Member
Joined
Mar 31, 2016
Messages
8
Hello,

I'm looking for 2 formulas to identify:

1. Column header for selected cell.
2. Row header for selected cell.

Example:
JanFebMarApr
Company A1234
Company B5678
Company C9101112
Company D13141516

<tbody>
</tbody>

If the value selected is 10, I want cell F1 to return column (Mar) and cell G1 to return row (Company C).
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try

=INDEX(B1:E1,MIN(IF(B2:E5=10,COLUMN(B1:E1)-MIN(COLUMN(B1:E1))+1,"")))

=INDEX(A2:A5,MIN(IF(B2:E5=10,ROW(A2:A5)-MIN(ROW(A2:A5))+1,"")))

both array formulas
 
Upvote 0
How about, put the value you want to find in F1


Book1
ABCDEFG
1JanFebMarApr10Feb
2Company A1234Company C
3Company B5678
4Company C9101112
5Company D13141516
Dropdowns
Cell Formulas
RangeFormula
G1=INDEX(B1:E1,SUMPRODUCT((B2:E5=F1)*COLUMN(B2:E5))-COLUMN(B2:E5)+1)
G2=INDEX(A2:A5,SUMPRODUCT((B2:E5=F1)*ROW(B2:E5))-ROW(B2:E5)+1)
 
Upvote 0
How about, put the value you want to find in F1

ABCDEFG
1JanFebMarApr10Feb
2Company A1234Company C
3Company B5678
4Company C9101112
5Company D13141516

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Dropdowns

Worksheet Formulas
CellFormula
G1=INDEX(B1:E1,SUMPRODUCT((B2:E5=F1)*COLUMN(B2:E5))-COLUMN(B2:E5)+1)
G2=INDEX(A2:A5,SUMPRODUCT((B2:E5=F1)*ROW(B2:E5))-ROW(B2:E5)+1)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

This worked. Thanks!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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