Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: Singapore
Posts: 20
Send a message via Skype™ to GijsKijlstra
Default IF statement with multiple VLOOKUPs

Despite many searches I've been unable to embed multiple nested 'IF' formulas in VLOOPKUP. And I'm starting to wonder if my problem is solvable.

The following 3 sheets (2, 3 and 4) contain data regarding the 600+ names, here illustrated as 6 names (Tom, William, Harry, John, Mary and Joyce)
sheet 2 Tom data (sheet 2) William data (sheet 2) John data (sheet 2) Joyce data (sheet 2) and Mary NO DATA
sheet 3 William data (sheet 3) Mary data (sheet 3)
sheet 4 Harry data (sheet 4) Joyce data (sheet 4)

Sheet 2 has the most recent info, then sheet 3, sheet 4 contains the oldest data

What I want to obtain in sheet 1 is: if the name and associated data in sheet 2 is <"", get it from sheet 2, if the name is not found OR when the name is found but the associated data is not, go to sheet 3, etc.

Sheet 1 Want to achieve What I got
Tom Tom data (sheet 2) Tom data (sheet 2)
William William data (sheet 2) William data (sheet 2)
Harry Harry data (sheet 4) #N/A
John John data (sheet 2) John data (sheet 2)
Mary Mary data (sheet 3) Mary data (sheet 3)
Joyce Joyce data (sheet 2) Joyce data (sheet 2)

I can't apply a simple 'IF' formula, since there are 600+ names and they are not on the same rows.

I've tried VLOOKUP, but got #N/A response (see Harry):
=IF(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0)<””,VLOOKUP( A13,Sheet2!$A$1:$B$8,2,0),IF(VLOOKUP(A13,Sheet3!$A $1:$B$8,2,0)<””,VLOOKUP(A13,Sheet3!$A$1:$B$8,2,0) ,IF(VLOOKUP(A13,Sheet4!$A$1:$B$8,2,0)<””,VLOOKUP( A13,Sheet4!$A$1:$B$8,2,0),"No Matching Data Found")))

I've tried IFERROR but got the error message "too many arguments":
=IFERROR(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0),VLOOKUP (A13,Sheet2!$A$1:$B$8,2,0),IFERROR(VLOOKUP(A13,She et3!$A$1:$B$8,2,0),VLOOKUP(A13,Sheet3!$A$1:$B$8,2, 0),IFERROR(VLOOKUP(A13,Sheet4!$A$1:$B$8,2,0),VLOOK UP(A13,Sheet4!$A$1:$B$8,2,0)))

I've tried =IFERROR(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0),IFERROR (VLOOKUP(A13,Sheet3!$A$1:$B$8,2,0),IFERROR(VLOOKUP (A13,Sheet4!$A$1:$B$8,2,0),"")))
but when the name is there e.g. Mary' name be on sheet 2, but the associated data for Mary is not, it returns an unwanted '0' instead of checking the next sheet.

I hope someone can help me, thank you in advance,

Gijs
Attached Files
File Type: zip IF statement with multiple VLOOKUPs.xls.zip (52.3 KB, 75 views)
  #2   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by GijsKijlstra View Post
Despite many searches I've been unable to embed multiple nested 'IF' formulas in VLOOPKUP. And I'm starting to wonder if my problem is solvable.

The following 3 sheets (2, 3 and 4) contain data regarding the 600+ names, here illustrated as 6 names (Tom, William, Harry, John, Mary and Joyce)
sheet 2 Tom data (sheet 2) William data (sheet 2) John data (sheet 2) Joyce data (sheet 2) and Mary NO DATA
sheet 3 William data (sheet 3) Mary data (sheet 3)
sheet 4 Harry data (sheet 4) Joyce data (sheet 4)

Sheet 2 has the most recent info, then sheet 3, sheet 4 contains the oldest data

What I want to obtain in sheet 1 is: if the name and associated data in sheet 2 is <"", get it from sheet 2, if the name is not found OR when the name is found but the associated data is not, go to sheet 3, etc.

Sheet 1 Want to achieve What I got
Tom Tom data (sheet 2) Tom data (sheet 2)
William William data (sheet 2) William data (sheet 2)
Harry Harry data (sheet 4) #N/A
John John data (sheet 2) John data (sheet 2)
Mary Mary data (sheet 3) Mary data (sheet 3)
Joyce Joyce data (sheet 2) Joyce data (sheet 2)

I can't apply a simple 'IF' formula, since there are 600+ names and they are not on the same rows.

I've tried VLOOKUP, but got #N/A response (see Harry):
=IF(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0)<””,VLOOKUP( A13,Sheet2!$A$1:$B$8,2,0),IF(VLOOKUP(A13,Sheet3!$A $1:$B$8,2,0)<””,VLOOKUP(A13,Sheet3!$A$1:$B$8,2,0) ,IF(VLOOKUP(A13,Sheet4!$A$1:$B$8,2,0)<””,VLOOKUP( A13,Sheet4!$A$1:$B$8,2,0),"No Matching Data Found")))

I've tried IFERROR but got the error message "too many arguments":
=IFERROR(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0),VLOOKUP (A13,Sheet2!$A$1:$B$8,2,0),IFERROR(VLOOKUP(A13,She et3!$A$1:$B$8,2,0),VLOOKUP(A13,Sheet3!$A$1:$B$8,2, 0),IFERROR(VLOOKUP(A13,Sheet4!$A$1:$B$8,2,0),VLOOK UP(A13,Sheet4!$A$1:$B$8,2,0)))

I've tried =IFERROR(VLOOKUP(A13,Sheet2!$A$1:$B$8,2,0),IFERROR (VLOOKUP(A13,Sheet3!$A$1:$B$8,2,0),IFERROR(VLOOKUP (A13,Sheet4!$A$1:$B$8,2,0),"")))
but when the name is there e.g. Mary' name be on sheet 2, but the associated data for Mary is not, it returns an unwanted '0' instead of checking the next sheet.

I hope someone can help me, thank you in advance,

Gijs
Hi,

Would there only ever be the three sheets to lookup against, or could there possibly be more?

If more, how many max?
  #3   Report Post  
Junior Member
 
Location: Singapore
Posts: 20
Send a message via Skype™ to GijsKijlstra
Default

Quote:
Originally Posted by Spencer101 View Post
Hi,

Would there only ever be the three sheets to lookup against, or could there possibly be more?

If more, how many max?
Thank you Spencer for helping me. The maximum is 5 sheets.

Gijs
  #4   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by GijsKijlstra View Post
Thank you Spencer for helping me. The maximum is 5 sheets.

Gijs
Your current formula appears to work if every name is on each sheet.
The fact that Harry does not appear on Sheet2 or Sheet3 means the formula stumbles with an #N/A at that point and cannot carry on.

Leave it with me and I shall see what I can do for you.

S.
  #5   Report Post  
Junior Member
 
Location: Singapore
Posts: 20
Send a message via Skype™ to GijsKijlstra
Default

Quote:
Originally Posted by Spencer101 View Post
Your current formula appears to work if every name is on each sheet.
The fact that Harry does not appear on Sheet2 or Sheet3 means the formula stumbles with an #N/A at that point and cannot carry on.

Leave it with me and I shall see what I can do for you.

S.
That would be great Spencer. Looking forward to it,

Gijs


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
vlookups and if statement excelrookie Excel Worksheet Functions 3 August 27th 08 03:20 AM
multiple vlookups in one statement Dave Excel Worksheet Functions 3 January 30th 08 06:56 PM
Multiple VLookups - Can anyone help me please? certain_death Excel Discussion (Misc queries) 5 February 14th 06 06:42 PM
Multiple Vlookups shaj Excel Worksheet Functions 2 November 18th 05 06:32 PM
multiple vlookups inthestands Excel Worksheet Functions 1 January 12th 05 09:07 PM


All times are GMT +1. The time now is 02:56 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"