Lookup Formula for Two Letter Column Name

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,158
Office Version
  1. 365
Platform
  1. Windows
In cell E119 I have the lookup value: $AU$25

I would like to return the value/header name from column AU25 back.

My initial formula below works fine for columns A-Z, but not for columns with two letters (i.e. AU). Can someone help modify this for me or suggest a new way?

=IF(G4="","",INDEX(Sheet1!$D$4:$CX$4,1,CODE(MID(AU25,FIND("$",AU25)+1,FIND("$",AU25,FIND("$",AU25)+1)-(FIND("$",AU25)+1)))-64-3))
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

63falcondude

Well-known Member
Joined
Jan 15, 2016
Messages
3,572
How about something along the lines of =INDEX(1:1,1,COLUMN(INDIRECT($AU$25))) assuming that your headers are in row 1.
 
Upvote 0

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,158
Office Version
  1. 365
Platform
  1. Windows
Try this:

=IF(G4="","",INDEX(Sheet1!$D$4:$CX$4,1,COLUMN(INDIRECT(AU25))-3))

Can we avoid using INDIRECT since I have a large spreadsheet and don't want to use a volatile function to slow down my calcs. BTW, I need to extract AU25 from $AU$25...I don't want to hardcode it.
 
Last edited:
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Just curious but why doesn't E119 appear in the formula?
 
Upvote 0

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,158
Office Version
  1. 365
Platform
  1. Windows
My original (corrected) formula is this:

=IF(G4="","",INDEX(Sheet2!$D$4:$CX$4,1,CODE(MID(E119,FIND("$",E119)+1,FIND("$",E119,FIND("$",E119)+1)-(FIND("$",E119)+1)))-64-3))

In Sheet1, cell E119 contains the lookup value: $AU$25

However, I want to return the value from Sheet2 cell AU25 based on the lookup value from cell E119.

Note: My Mid formula is returning "AU" from cell E119.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,191,170
Messages
5,985,066
Members
439,938
Latest member
MAlhash

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
Top