+ Reply to Thread
Results 1 to 23 of 23

Combining vlookup formulas

  1. #1
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Combining vlookup formulas

    I have an Excel workbook with 3 sheets. Sheet 1 has a list of all tasks that need to be completed in a month. Sheets 2 and 3 are a breakout of Sheet 1, so each task appears on either 2 or 3. In the first column are the task numbers, and then we fill in a date when a task is complete. Otherwise it stays blank.

    On Sheet 1 I would like to do a vlookup function to pull in the date that a task was complete. The tricky part is, if the task is not on Sheet 2, I want it to look at Sheet 3. If no complete date has been entered on either 2 or 3, I want it to come back with "Not Complete." I can do all of the functionality of the above just looking at Sheet 2, but I don't know how to add Sheet 3 to the mix.

    Thanks!

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Combining vlookup formulas

    Can you use an iferror VLOOKUP for sheet 2 that if it returns an error goes to sheet3?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    =IFERROR(VLOOKUP(A2, Sheet2!$A$1:$F$1000, 2, FALSE), IFERROR(VLOOKUP(A2, Sheet3!$A$1:$F$1000, 2, FALSE), "Not Complete")))

    Something like that
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Combining vlookup formulas

    =IFERROR(VLOOKUP(A2, Sheet2!$A$1:$F$1000, 2, FALSE), IFERROR(VLOOKUP(A2, Sheet3!$A$1:$F$1000, 2, FALSE), "Not Complete")))

    Something like that
    Yeah, something like that would have been mine if I wasn't too lazy to type it on my ipad

  5. #5
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    That makes sense but I'm getting a "too many arguments" error. Thanks for all of your help so far!!

    =IFerror((VLOOKUP(A24,Hospital!$A$7:$B$119,2,FALSE)),iferror(VLOOKUP(A24,Professional!$A$7:$B$124,2,FALSE)),"Not Complete")

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    =IFerror(VLOOKUP(A24,Hospital!$A$7:$B$119,2,FALSE), iferror(VLOOKUP(A24,Professional!$A$7:$B$124,2,FALSE),"Not Complete")))

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining vlookup formulas

    Quote Originally Posted by Rain78 View Post
    That makes sense but I'm getting a "too many arguments" error. Thanks for all of your help so far!!

    =IFerror((VLOOKUP(A24,Hospital!$A$7:$B$119,2,FALSE)),iferror(VLOOKUP(A24,Professional!$A$7:$B$124,2,FALSE)),"Not Complete")
    You have too many ( )...

    =IFERROR(VLOOKUP(A24,Hospital!$A$7:$B$119,2,0),IFERROR(VLOOKUP(A24,Professional!$A$7:$B$124,2,0),"Not Complete"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    Ok so that worked - thank you!! But instead of having "Not Complete" it is showing as 1/0/1900 for anything without a date. Is that just a formatting issue?

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Combining vlookup formulas

    Yes, just format to general.

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    The issue has nothing to do with "Not Complete" The problem is that your lookup value is appearing in one of the sheets BUT there's nothing in Column B so it is returning 0. The best was to fix that is to do a custom format
    mm/dd/yyyy (or whatever you want);;
    Does that work for you?

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining vlookup formulas

    Quote Originally Posted by Rain78 View Post
    Ok so that worked - thank you!! But instead of having "Not Complete" it is showing as 1/0/1900 for anything without a date. Is that just a formatting issue?
    Having just read the original post, I think that we've all missed the boat on this one!

    Assuming that the task will always be on one sheet or the other, try this...

    =IF(COUNTIF(Hospital!$A$7:$B$119,A24),IF(VLOOKUP(A24,Hospital!$A$7:$B$119,2,0)="","Not Complete",VLOOKUP(A24,Hospital!$A$7:$B$119,2,0)),IF(VLOOKUP(A24,Professional!$A$7:$B$124,2,0)="","Not Complete",VLOOKUP(A24,Professional!$A$7:$B$124,2,0)))

    Format the result as Date

  12. #12
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    I tried changing the format to General and it returns a 0 instead of the strange date. I tried what Tony mentioned and that didn't work. Thanks to you all for the suggestions! If you have any others I would love to hear them. I'm so close!! It's just the Not Complete piece.

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    Okay, let's clarify When you want "Not Complete"
    If your lookup value is on either of those sheet but there's no date, do you want "Not Complete"? or do you want it to return a blank?

    Alternately, the way you initially described it, if your lookup value doesn't appear on either worksheet, then you want a "Not Complete"
    or some combination of the above?

  14. #14
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    Yes, so if there is not a date filled in on either sheet, I would like it to return Not Complete instead of a blank.

  15. #15
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    Also, "it didn't work" doesn't help us much. It's like taking your car in because the wiper fluid doesn't spray and telling the mechanic, it doesn't work. Does the formula give you an error, if so, what is it? or the wrong result (what's the expected result)? or maybe Excel doesn't even let you enter it. This would help.

  16. #16
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    Okay, that's what Tony's formula was aiming for. The rest of us were on a different planet.

  17. #17
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    Sorry, it says #VALUE! with Tony's suggestion.

    =IF(COUNTIF(Hospital!$A$7:$B$119,A198),IF(VLOOKUP(Hospital!$A$7:$B$119,2,0)="","Not Complete",VLOOKUP(A198,Hospital!$A$7:$B$119,2,0)),IF(VLOOKUP(A198,Professional!$A$7:$B$124,2,0)="","Not Complete",VLOOKUP(A198,Professional!$A$7:$B$124,2,0)))

  18. #18
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Combining vlookup formulas

    If you go back to the formula that was giving you 1/0/1900 and select all your cells and do this custom format

    mm/dd/yyyyy;;"Not Complete";@
    Attached Images Attached Images

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining vlookup formulas

    Quote Originally Posted by Rain78 View Post
    Yes, so if there is not a date filled in on either sheet, I would like it to return Not Complete instead of a blank.
    I'm pretty sure that's what the formula in post #11 does.

    Here's what it's doing...

    It first tests to see if the lookup value is on the Hospital sheet. If it is it then checks for an empty cell. If the cell is empty the formula returns "Not Complete". If the cell is not empty it returns the date.

    If the lookup value is not on the Hospital sheet then it does the lookup on the Professional sheet. If the cell is empty the formula returns "Not Complete". If the cell is not empty it returns the date.

    The formula (I) assume the lookup value is ALWAYS present, on one sheet or the other.

  20. #20
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    ChemistB - you ROCK! Thanks so much for your help.

  21. #21
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining vlookup formulas

    A word of caution about using the custom format.

    Even though the cell may DISPLAY "Not Complete", the true underlying value of the cell is still 0.

    So, if you have downstream calculations looking for cells that contain "Not Complete", you may have problems!

  22. #22
    Registered User
    Join Date
    08-17-2015
    Location
    VT
    MS-Off Ver
    2007
    Posts
    8

    Re: Combining vlookup formulas

    Good point, Tony. I was able to get your formula to work! Thanks again to everyone. I've learned a lot.

  23. #23
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combining vlookup formulas

    Good deal. Thanks for the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Combining formulas
    By skip2mylew in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-04-2013, 10:43 PM
  2. Combining Two Formulas
    By Hornstinger in forum Excel General
    Replies: 3
    Last Post: 06-06-2012, 06:56 PM
  3. Vlookup / If combining formulas
    By ppines in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-21-2011, 07:10 AM
  4. Combining 2 formulas together.
    By cat1410 in forum Excel General
    Replies: 2
    Last Post: 08-05-2008, 02:21 PM
  5. combining 2 formulas
    By cat1410 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-02-2008, 09:34 PM
  6. combining IF and VLookup formulas
    By bby2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2008, 03:29 PM
  7. Combining Two Formulas to One
    By Jerkyboy via OfficeKB.com in forum Excel General
    Replies: 1
    Last Post: 08-17-2006, 12:35 AM
  8. combining two formulas
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-15-2006, 09:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1