VLOOKUP - using column name instead of column number

m24jones

Board Regular
Joined
May 19, 2002
Messages
61
I would like to do a VLOOKUP (or similar operation) to grab information from a column based on a column name instead of column number.

For example, instead of:

=vlookup(a2,t5:z10,4,FALSE)

I would like the formula to read:

=vlookup(a2,t5:t10,"COLUMN_NAME",FALSE)

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
"COLUMN_NAME" is where I would like to put a column header name instead of column number into the vlookup (or similar formula).
 
Upvote 0
Something like this, I intuit ... :D
Book3
ABCDE
12002200320042005
2AAA1234
3BBB8765
4CCC9101112
5DDD16151413
6
710
Sheet1
 
Upvote 0
m24jones said:
"COLUMN_NAME" is where I would like to put a column header name instead of column number into the vlookup (or similar formula).

Let T4:Z4 house these headers...

=VLOOKUP(A2,$T$5:$Z$10,MATCH("COLUMN_NAME",$T$4:$Z$4,0),0)

0 means the same thing as FALSE both in MATCH and VLOOKUP.
 
Upvote 0
All I get is "#N/A" - any idea why?

All I get is "#N/A" - any idea why?

my formula:
=VLOOKUP(J8,$D$2:$G$5,MATCH("2003",D2:G2,0),0)
 
Upvote 0
Re: All I get is "#N/A" - any idea why?

Remove double quotes around 2003...

=VLOOKUP(J8,$D$3:$G$5,MATCH(2003,$D$2:$G$2,0),0)
 
Upvote 0
PROBLEM - formula keeps pulling data from bottom of set

My Formula:
VLOOKUP($A$5,'FREEDOM'!$A$1:$R$15,MATCH("Revenue-1997",'FREEDOM'!$A$1:$R$1,0))

Result:
On the Freedom tab there are 10 lines of data
-the formula above pulls the result from the correct column, but not from the correct row (in the case of the formula above, it should pull from row 3)
-if i delete row 10 then the formula pulls data from row 9


Any ideas?
 
Upvote 0
Re: PROBLEM - formula keeps pulling data from bottom of set

m24jones said:
My Formula:
VLOOKUP($A$5,'FREEDOM'!$A$1:$R$15,MATCH("Revenue-1997",'FREEDOM'!$A$1:$R$1,0))

Result:
On the Freedom tab there are 10 lines of data
-the formula above pulls the result from the correct column, but not from the correct row (in the case of the formula above, it should pull from row 3)
-if i delete row 10 then the formula pulls data from row 9


Any ideas?

The formula

=VLOOKUP($A$5,'FREEDOM'!$A$1:$R$15,MATCH("Revenue-1997",'FREEDOM'!$A$1:$R$1,0))

does an approximate match. Try exact match...

=VLOOKUP($A$5,'FREEDOM'!$A$1:$R$15,MATCH("Revenue-1997",'FREEDOM'!$A$1:$R$1,0),0)

Why do your ranges change with every post? :D
 
Upvote 0

Forum statistics

Threads
1,214,854
Messages
6,121,941
Members
449,056
Latest member
denissimo

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