HLOOKUP AND MATCH in one formula?

caroline.vanbommel

New Member
Joined
Aug 21, 2006
Messages
27
Hi,

I have a HLOOKUP formula eg.
=HLOOKUP(B4,'[anotherfile.xls]Sheet1'$B$2:$BO$220,219,FALSE
B4 is an sub account of A2

I want the 219 to be replaced the following formula,
=MATCH(A2,'[anotherfile.xls]Sheet1!$B$2:$B$250,FALSE)
A2 is an account name

the point of this formula is that this account name row location changes from sheet to sheet and i dont want to manually fill it in each time over and over.

Does anyone know how to properly combine these two formulas in one?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hello

Is it not just

=HLOOKUP(B4,'[anotherfile.xls]Sheet1'$B$2:$BO$220,MATCH(A2,'[anotherfile.xls]Sheet1!$B$2:$B$250,FALSE),FALSE)
 
Upvote 0
MATCH will return a row index. Is that what you want? Or is it something like?

INDEX('[anotherfile.xls]Sheet1!$A$2:$A$250,MATCH(A2,'[anotherfile.xls]Sheet1!$B$2:$B$250,FALSE))

That looks up A2 in column B and returns what's on the same row in column A.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

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