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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
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)
 

caroline.vanbommel

New Member
Joined
Aug 21, 2006
Messages
27
oops

I tried this, but i kept on getting errors
I just noticed i forgot to add an extra set of parenthesis!
Oops, thnx
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
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.
 

Forum statistics

Threads
1,136,352
Messages
5,675,269
Members
419,558
Latest member
Ryanms

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
Top