ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   HLOOKUP - Adjusting the lookup value... (https://www.excelbanter.com/excel-discussion-misc-queries/89473-hlookup-adjusting-lookup-value.html)

Regnab

HLOOKUP - Adjusting the lookup value...
 
I'm trying to look up a value in the same row depending on the column
header (Product Codes, looking up their prices). I'm just wondering how
people do it so I can drag the forumula down the page and it'll adjust
the row that it's looking in. I tried CELL("ROWS") but that seemed to
reak havic with the formula so then I created a row with the
appropriate row number in it (which I then hid). I figure there has got
to be a better way....

Cheers

Reg


Max

HLOOKUP - Adjusting the lookup value...
 
Assuming we want the row_index_num to start with 2 (say)
we can use in the starting cell, example: ROW(A1)+1
to increment the index as we copy down the column

Example in say, A3, copied down:
=HLOOKUP(A$1,$K$1:$L$30,ROW(A1)+1,0)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Regnab" wrote:
I'm trying to look up a value in the same row depending on the column
header (Product Codes, looking up their prices). I'm just wondering how
people do it so I can drag the forumula down the page and it'll adjust
the row that it's looking in. I tried CELL("ROWS") but that seemed to
reak havic with the formula so then I created a row with the
appropriate row number in it (which I then hid). I figure there has got
to be a better way....

Cheers

Reg



Regnab

HLOOKUP - Adjusting the lookup value...
 
I'll give it a shot - thanks for your help...


Max

HLOOKUP - Adjusting the lookup value...
 
"Regnab" wrote:
I'll give it a shot - thanks for your help...


You're welcome.
It should work fine ..

And if we want it to increment
when we copy *across* from the starting cell
just swap eg: ROW(A1)+1
with: COLUMN(A1)+1

(use COLUMN instead of ROW)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


All times are GMT +1. The time now is 01:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com