Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 96
Default using hlookup to reference a column in a vlookup formula?

i am looking to have a specific spreadsheet reference a second sheet that is
variable daily in both rows and columns...a vlookup takes care of the rows,
but since the number of columns and/or column order may change, i cannot
hardcode the column index number in the vlookup formula.


i thought i could use a vlookup formula where the column referenced is based
on a column and hlookup function...i tried the following, but received an
error message:

=vlookup(a2,myrange,column(hlookup(b1,myrange,1,fa lse)),false)

is there a way to accomplish this?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 171
Default using hlookup to reference a column in a vlookup formula?

Instead of the hlookup, I think you want match(b1,myrange,false).

"joemeshuggah" wrote:

i am looking to have a specific spreadsheet reference a second sheet that is
variable daily in both rows and columns...a vlookup takes care of the rows,
but since the number of columns and/or column order may change, i cannot
hardcode the column index number in the vlookup formula.


i thought i could use a vlookup formula where the column referenced is based
on a column and hlookup function...i tried the following, but received an
error message:

=vlookup(a2,myrange,column(hlookup(b1,myrange,1,fa lse)),false)

is there a way to accomplish this?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default using hlookup to reference a column in a vlookup formula?

=INDEX(MyRange,MATCH(A2,INDEX(MyRange,,1),0),MATCH (B1,INDEX(MyRange,1,),0))


a a1 a2 a3 a4
b 20 30 40 50
c 15 10 5 4
d 80 70 90 150

assume the above table called MyRange

you have c in A2 and a3 in B1 and you want to return
number 5 basically where the intersection of those 2 is

Of course if the table was D2:H5 you could use


=INDEX(D2:H5,MATCH(A2,D2:D5,0),MATCH(B1,D2:H2,0))


if you have a named range like MyRange and use that in the formula you would
need the extra INDEX



--


Regards,


Peo Sjoblom

"joemeshuggah" wrote in message
...
i am looking to have a specific spreadsheet reference a second sheet that
is
variable daily in both rows and columns...a vlookup takes care of the
rows,
but since the number of columns and/or column order may change, i cannot
hardcode the column index number in the vlookup formula.


i thought i could use a vlookup formula where the column referenced is
based
on a column and hlookup function...i tried the following, but received an
error message:

=vlookup(a2,myrange,column(hlookup(b1,myrange,1,fa lse)),false)

is there a way to accomplish this?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 96
Default using hlookup to reference a column in a vlookup formula?

Thanks!!!!!

"Peo Sjoblom" wrote:

=INDEX(MyRange,MATCH(A2,INDEX(MyRange,,1),0),MATCH (B1,INDEX(MyRange,1,),0))


a a1 a2 a3 a4
b 20 30 40 50
c 15 10 5 4
d 80 70 90 150

assume the above table called MyRange

you have c in A2 and a3 in B1 and you want to return
number 5 basically where the intersection of those 2 is

Of course if the table was D2:H5 you could use


=INDEX(D2:H5,MATCH(A2,D2:D5,0),MATCH(B1,D2:H2,0))


if you have a named range like MyRange and use that in the formula you would
need the extra INDEX



--


Regards,


Peo Sjoblom

"joemeshuggah" wrote in message
...
i am looking to have a specific spreadsheet reference a second sheet that
is
variable daily in both rows and columns...a vlookup takes care of the
rows,
but since the number of columns and/or column order may change, i cannot
hardcode the column index number in the vlookup formula.


i thought i could use a vlookup formula where the column referenced is
based
on a column and hlookup function...i tried the following, but received an
error message:

=vlookup(a2,myrange,column(hlookup(b1,myrange,1,fa lse)),false)

is there a way to accomplish this?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column reference in Vlookup formula Kevin K[_2_] Excel Worksheet Functions 1 August 26th 08 08:16 PM
Can you use HLOOKUP inside VLOOKUP to tell it what column 2 return Otter Excel Worksheet Functions 1 February 8th 08 03:43 PM
vlookup and hlookup in the same formula lindsayhyle Excel Discussion (Misc queries) 6 August 3rd 07 03:46 PM
Vlookup/hlookup without using row or column numbers Dawn - KY Excel Worksheet Functions 6 May 7th 07 05:09 PM
formula using both vlookup & hlookup xFreeAdvice Excel Worksheet Functions 2 November 17th 04 11:19 PM


All times are GMT +1. The time now is 08:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"