Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default VLookup Function over Multiple Worksheets

I am trying to use the VLOOKUP function over multiple worksheets, can this be
done on Excel 2003?

I am trying to automatically retrieve data that is dependent on previously
entered fields in drop down lists that I have created.

Regards,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default VLookup Function over Multiple Worksheets

A semi-exoctic formula from Peo S a few years ago, this looks up across
eight sheets. It is an array-entered formula... CTRL+SHIFT+ENTER

If you wnt to tackle this I will help you, I don't completely understand the
formula but I believe I can guide you through it to lookup over many
worksheets. (formula is all one one line in both cases, wrap kinda sucks
here on my screen)

=VLOOKUP(A1,INDIRECT("'"&INDEX({"Sheet1";"Sheet2"; "Sheet3";"Sheet4";"Sheet5";"Sheet6";"Sheet7";"Shee t8"},MATCH(1,--(COUNTIF(INDIRECT("'"&{"Sheet1";"Sheet2";"Sheet3"; "Sheet4";"Sheet5";"Sheet6";"Sheet7";"Sheet8"}&"'!A 2:A200"),A1)0),0))&"'!A2:C200"),2,0)

Or using a named range of the sheets instead of each sheet name...

=VLOOKUP(A1,INDIRECT("'"&INDEX(MySheets,MATCH(1,--(COUNTIF(INDIRECT("'"&MySheets&"'!A2:A200"),A1)0) ,0))&"'!A2:C200"),3,0)

HTH
Regards,
Howard

"cp402" wrote in message
...
I am trying to use the VLOOKUP function over multiple worksheets, can this
be
done on Excel 2003?

I am trying to automatically retrieve data that is dependent on previously
entered fields in drop down lists that I have created.

Regards,



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default VLookup Function over Multiple Worksheets

I don't completely understand the formula

It's actually quite simple and your reaction will be: "Of course, it's so
simple!".

The first thing that happens is the COUNTIF checks each sheet to see if the
lookup_value exists on any of the sheets.

COUNTIF(Sheet1!A2:A200,A1)0
COUNTIF(Sheet2!A2:A200,A1)0
COUNTIF(Sheet3!A2:A200,A1)0
etc
etc

If the lookup_value exists on any of the sheets then one of the above
expressions will return TRUE:

COUNTIF(Sheet1!A2:A200,A1)0 = FALSE
COUNTIF(Sheet2!A2:A200,A1)0 = FALSE
COUNTIF(Sheet3!A2:A200,A1)0 = TRUE
etc
etc

The double unary -- will convert the logical TRUE or FALSE to 1 or 0
respectively:

--(COUNTIF(Sheet1!A2:A200,A1)0) = 0
--(COUNTIF(Sheet2!A2:A200,A1)0) = 0
--(COUNTIF(Sheet3!A2:A200,A1)0) = 1
etc
etc

MATCH then looks for the first instance of 1 and if present returns it's
relative position within the array of results from the COUNTIF functions:

MATCH(1,{0;0;1},0) = 3 (the lookup_value 1 is found at relative position 3).

This result is then passed to the INDEX function:

INDEX({"Sheet1";"Sheet2";"Sheet3"},3)

That tells INDEX we want the 3rd value of the indexed array Sheet1, Sheet2,
Sheet3

INDEX({"Sheet1";"Sheet2";"Sheet3"},3) = Sheet3

This result is then added to a string of concatenation processes:

"'"&"Sheet3"&"'!A2:C200" = 'Sheet3'!A2:C200 (as a TEXT string)

Since we're "building" the range reference to be used in the VLOOKUP
function, the "built" reference will be a *TEXT* string that looks like a
valid range reference. So, we have to convert this *TEXT* string into a
valid range reference that the VLOOKUP can use. We do this using the
INDIRECT function.

INDIRECT("'"&"Sheet3"&"'!A2:C200") = 'Sheet3'!$A$2:$C$200 as a valid range
reference that VLOOKUP can use:

=VLOOKUP(A1,'Sheet3'!$A$2:$C$200,2,0)


exp101
--
Biff
Microsoft Excel MVP


"L. Howard Kittle" wrote in message
...
A semi-exoctic formula from Peo S a few years ago, this looks up across
eight sheets. It is an array-entered formula... CTRL+SHIFT+ENTER

If you wnt to tackle this I will help you, I don't completely understand
the formula but I believe I can guide you through it to lookup over many
worksheets. (formula is all one one line in both cases, wrap kinda sucks
here on my screen)

=VLOOKUP(A1,INDIRECT("'"&INDEX({"Sheet1";"Sheet2"; "Sheet3";"Sheet4";"Sheet5";"Sheet6";"Sheet7";"Shee t8"},MATCH(1,--(COUNTIF(INDIRECT("'"&{"Sheet1";"Sheet2";"Sheet3"; "Sheet4";"Sheet5";"Sheet6";"Sheet7";"Sheet8"}&"'!A 2:A200"),A1)0),0))&"'!A2:C200"),2,0)

Or using a named range of the sheets instead of each sheet name...

=VLOOKUP(A1,INDIRECT("'"&INDEX(MySheets,MATCH(1,--(COUNTIF(INDIRECT("'"&MySheets&"'!A2:A200"),A1)0) ,0))&"'!A2:C200"),3,0)

HTH
Regards,
Howard

"cp402" wrote in message
...
I am trying to use the VLOOKUP function over multiple worksheets, can this
be
done on Excel 2003?

I am trying to automatically retrieve data that is dependent on
previously
entered fields in drop down lists that I have created.

Regards,





  #4   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default VLookup Function over Multiple Worksheets

Numeric value:

For Sheet1,...,Sheet4

=SumProduct(Sumif(INDIRECT("Sheet"&Row(1:4)&"!A2:A 6"),$A
$2,INDIRECT("Sheet"&Row(1:4)&"!B2:B6")))

http://boisgontierjacques.free.fr/fi...rcheV3DNum.xls

AlphaNumeric value:

=VlookUp(A2,INDIRECT("Sheet"&Match(True,
(CountIf(INDIRECT("Sheet"&Row(1:4)&"!A2:B6"),A2)0 ),0)&"!A2:B6"),
2,False)
valid with Shift+Ctrl+Enter

http://boisgontierjacques.free.fr/fi...heV3DAlpha.xls

http://boisgontierjacques.free.fr/pa...3D.htm#Rechv3D

JB
http://boisgontierjacques.free.fr/

On 11 mar, 01:33, cp402 wrote:
I am trying to use the VLOOKUP function over multiple worksheets, can this be
done on Excel 2003?

I am trying to automatically retrieve data that is dependent on previously
entered fields in drop down lists that I have created.

Regards,


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup Function with multiple worksheets Dahliahlu Excel Worksheet Functions 6 July 4th 08 10:55 PM
Vlookup for multiple criteria, multiple worksheets jtoy Excel Worksheet Functions 4 January 25th 07 09:26 PM
Vlookup multiple worksheets jschillin38 Excel Discussion (Misc queries) 0 September 29th 05 05:06 PM
VLOOKUP Function using multiple worksheets Fiona Excel Discussion (Misc queries) 1 March 10th 05 08:55 AM
VLOOKUP Function using multiple worksheets Fiona Excel Discussion (Misc queries) 0 March 10th 05 05:24 AM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"