Solved

HLOOKUP in Excel- increment row_index_num

Posted on 2011-03-17
6
1,220 Views
Last Modified: 2012-05-11
Hi Experts,

I have a HLOOKUP formula:
=HLOOKUP(QR5,$B$3:$QO$5000,2) where 2 is the row_index_num

I need to be able to increment that row index num by 1 each when the formula is copied to the next row. I tried using a simple counter and referencing that row_index_num to the cell containing the counter, but returned an error message (#VALUE)

Any help appreciated...
Kevin
0
Comment
Question by:KevinHatt
6 Comments
 
LVL 33

Accepted Solution

by:
jppinto earned 500 total points
ID: 35156747
Try like this:

=HLOOKUP(QR5,$B$3:$QO$5000,ROW(A2))

jppinto
0
 
LVL 33

Expert Comment

by:jppinto
ID: 35156847
ROW(A2) will give the row number 2. When you copy this formula to the next row, it will change to ROW(A3) thus giving you the row number of 3, and so on...
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 35156855
You can also use the ROW function with no reference which will return the row on which the formula is being used, then plus or minus a number to adjust if necessary.

For example if the above formula from jppinto was on row 2 there would be no need for an adjustment but if it is on row 5 it would be:

=HLOOKUP(QR5,$B$3:$QO$5000,ROW()-3)

Cheers
Rob h

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 85

Expert Comment

by:Rory Archibald
ID: 35156984
Is the formula in the next row supposed to be:
=HLOOKUP(QR5,$B$3:$QO$5000,3)
or:
=HLOOKUP(QR6,$B$3:$QO$5000,3)
?

0
 

Author Closing Comment

by:KevinHatt
ID: 35157019
Hi jppinto...thanks for the prompt help
Full points and gratitude :-)
0
 
LVL 33

Expert Comment

by:jppinto
ID: 35157104
Glad I could help!

Thanks for the grade and the kind words.

jppinto
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel ODBC connection error 3 31
Excel macro runs twice 13 46
Filling Blank Cells 14 15
Pivot help - Display only Is Not Null 7 14
Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now