Excel question - HL...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Excel question - HLOOKUP

7 Posts
5 Users
0 Reactions
43 Views
Posts: 0
Free Member
Topic starter
 

I'm using HLOOKUP and want to drag down the formula for multiple rows. The row_index_number therefore is wrong after the first row (the fifth row becomes the fourth). Is there specific the precise row to return answers from?

[img] [/img]

In this example, is there a way to specify row 12, or to automatically alter the '9' to an '8', then a '7' etc as the formula is dragged down?


 
Posted : 22/06/2015 2:55 pm
Posts: 24498
Free Member
 

If you prefix the cell reference in a formula with $ then it fixes it.

Hence if you always want Column I, but the row to change, instead of I12, use $I12

If you want to fix row, but allow column to change - I$12

If you want to absolutely fix the cell, $I$12


 
Posted : 22/06/2015 2:59 pm
Posts: 0
Free Member
Topic starter
 

That doesn't work in this case as the row_index_number specifies which row you want in the array, not which row in the sheet. Unless i'm misunderstanding you.


 
Posted : 22/06/2015 3:04 pm
Posts: 4097
Free Member
 

In your example, in row j, run the numbers down in a list: '9' in J4, '8' in J5 etc.

Then HLOOKUP(blahblah,J4,false) for your first one. As you pull the formula down it will reference J5, then J6 etc.

Not particularly elegant, but quick and easy. The index doesn't need to be adjacent to the table, btw, can be stashed away in a hidden column, on another sheet etc if needed.


 
Posted : 22/06/2015 3:09 pm
Posts: 0
Free Member
Topic starter
 

edlong - Member
In your example, in row j, run the numbers down in a list: '9' in J4, '8' in J5 etc.

Then HLOOKUP(blahblah,J4,false) for your first one. As you pull the formula down it will reference J5, then J6 etc.

Not particularly elegant, but quick and easy. The index doesn't need to be adjacent to the table, btw, can be stashed away in a hidden column, on another sheet etc if needed.

Genius! Thankyou!


 
Posted : 22/06/2015 3:15 pm
Posts: 7270
Free Member
 

or replaces number ROWS($A:A) and that copies down

EDIT:Actually 10-ROWS($D:D)


 
Posted : 22/06/2015 3:40 pm
Posts: 0
Free Member
 

You could have also just filled the bottom row down 9 times and used your original formula, but again that's a little bit ugly.


 
Posted : 22/06/2015 6:17 pm
Posts: 0
Free Member
 

=HLOOKUP("YES",D4:I$12,COUNT(D4:I$12),FALSE)

That's definitely more graceful. Does it all in the formula and doesn't require you to mucky the sheet with anything else. Allows fill down and will reduce the count as you move down.


 
Posted : 22/06/2015 6:22 pm

6 DAYS LEFT
We are currently at 95% of our target!