Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

VLOOKUP across multiple worksheets

Hello!

I am trying to be able to search for a student name in a specific table in 4 different worksheets... Example: If John Doe isnt in worksheet 1, then check worksheet 2...

I came up with the following, which does work if the person is in the first worksheet.

Thanks!! User uploaded file

=IF(ISBLANK(VLOOKUP($A3,Lincoln Data E::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISBLANK(VLOOKUP($A3,Lincoln Data F::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISBLANK(VLOOKUP($A3,Lincoln Data G::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISBLANK(VLOOKUP($A3,Lincoln Data H::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data H::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data G::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data F::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data E::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE))

Macbook pro, Mac OS X (10.6.6), I Love It.

Posted on Mar 14, 2011 9:47 AM

Reply
13 replies

Mar 14, 2011 4:13 PM in response to jaxjason

Thanks for the quick response! That makes sense. So it partially worked too. I can now query a name from the first 3 worksheets, but if I query one from the 4th I get FALSE.

It appears that whatever query is in the "middle" gives the false. I added in one more worksheet, placed it as the last IF and now my 4 original work but the 5th wont.

Any ideas?

Thanks again!

Newest function:

=IF(ISERROR(VLOOKUP($A3,Lincoln Data E::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISERROR(VLOOKUP($A3,Lincoln Data F::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISERROR(VLOOKUP($A3,Lincoln Data G::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISERROR(VLOOKUP($A3,Lincoln Data H::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),IF(ISERROR(VLOOKUP($A3,HMS Data::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,HMS Data::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data H::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data G::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data F::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE)),VLOOKUP($A3,Lincoln Data E::Student Grades :: $A$1:$I$26,COLUMN()+1,FALSE))

Message was edited by: captainKCF

Mar 14, 2011 6:25 PM in response to captainKCF

The IFERROR idea would be cleaner and shorter I think.

But, to answer your question, starting in the middle of your formula you have
...IF(ISERROR(VLOOKUP(...HMS DATA...)), VLOOKUP(...HMS Data...),...
In other words, if the lookup is an error, you do the lookup again (which, of course, will be an error). This is where the FALSE result should be, not at the end of the formula.
...IF(ISERROR(VLOOKUP(...HMS DATA...)), FALSE, VLOOKUP(...HMS Data...),...

I recommend the cleaner and shorter IFERROR version posted by Jason. It requires half the lookups and is much easier to add onto.

Mar 15, 2011 6:12 AM in response to captainKCF

It seems that there is a limit to the length of a formula.
I guess that it's linked to the size of the dedicated buffer receiving this one to parse it.

If I am right, using shorter table and sheet names may be efficient.

I guess that you don't rule teachers's grades so maybe you may replace "Students Grades" by "Grades"

In the names of sheets, I guess that you know that they are storing datas, so maybe you may remove this word.

You may also replace the ranges descriptors $A$1:$I$26 by the shorter ones $A:$I.

Yvan KOENIG (VALLAURIS, France) mardi 15 mars 2011 14:12:36

Jul 1, 2013 1:01 PM in response to jaxjason

Hi,


Could someone please clarify Jason's forumula?


=iferror(vlookup1,iferror(vlookup2,iferror(vlookup3,"Not found")))


I tried to model after it, and it returns a syntax error.


Here is mine.


=IFERROR(VLOOKUPE2,'raw data—table123 6-27-13' :: Campus Id,IFERROR(VLOOKUPE2,raw data GR EAP—table124 :: $E$2:$E$3,IFERROR(VLOOKUPE2,'table125 intnl org 6-18-13' :: $D$2:$D$19,"Not found")))


E2 is the current table's cell used for matching.


Thanks in advance!

Jul 2, 2013 9:38 AM in response to Yellowbox

Hi Ian,


Many thanks for your post.


Yes, I understood that Jason's posting contained pseudocode. 🙂


Thanks for the helpful pointer to the Function Browser, which reminded me that I left out components in the formula. 😟


An additional problem with my formula was that it needed a close parenthesis (set in red typeface below) after each of its components. Without those close parentheses (in addition to the three after "Not found,"), the formula returned an error.


The following revision worked properly. E2 is the cell value in the current worksheet to be matched with the three other worksheets that are in the same Numbers file.


=IFERROR(VLOOKUP(E2,'raw data—table123 6-27-13' :: $G$2:$G$1204,1,0),IFERROR(VLOOKUP(E2,raw data GR EAP—table124 :: $E$2:$E$3,1,0),IFERROR(VLOOKUP(E2,'table125 intnl org 6-18-13' :: $D$2:$D$19,1,0),"Not found")))


Thanks again!


Barry

Jul 2, 2013 10:18 AM in response to Barry Fass-Holmes

Hi Barry,


Thanks for the feedback. Oh, matching those parentheses! I prefer to break long formulas into small bites in separate Columns. That makes it easier to track the errors. Hide the intermediate Columns when it works.


I seem to recall that when using HyperTalk scripting in HyperCard, the editor refused to automatically indent a line in the script if there was an error. But that was a long time ago. 20/20 hindsight through rose-coloured glasses...


Regards,

Ian.

VLOOKUP across multiple worksheets

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.