EXCEL VLOOKUP and FULL OUTER JOIN

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • catlover30
    New Member
    • May 2007
    • 15

    EXCEL VLOOKUP and FULL OUTER JOIN

    HI,

    I need help with excel VLOOKUP! I am at a new job and really trying to solve this without asking anyone at work, since they seem th expect me to know this. What I am trying to acheive is the same thing as a FULL OUTER JOIN if you are familiar with sql. I tried to do this is in access, but access does not support full joins.

    Anyhow: I have two email lists, one woth 2500 entries, one with 2600. They are located in same worksheet, one in column A, one in column B. Some emails match, some do not. I want to have the two lists side-by-side in a workheet, with the matching emails next to each other, and also gaps for non-mathcing emails. If I do VLOOKUP I want the missing emails in both columns. I am not at all familiar with VLOOKUP and do not even know where to begin! I appreciate any advise.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by catlover30
    HI,

    I need help with excel VLOOKUP! I am at a new job and really trying to solve this without asking anyone at work, since they seem th expect me to know this. What I am trying to acheive is the same thing as a FULL OUTER JOIN if you are familiar with sql. I tried to do this is in access, but access does not support full joins.

    Anyhow: I have two email lists, one woth 2500 entries, one with 2600. They are located in same worksheet, one in column A, one in column B. Some emails match, some do not. I want to have the two lists side-by-side in a workheet, with the matching emails next to each other, and also gaps for non-mathcing emails. If I do VLOOKUP I want the missing emails in both columns. I am not at all familiar with VLOOKUP and do not even know where to begin! I appreciate any advise.
    You can use a UNION query to achieve the results you need in Access.
    Code:
    SELECT Table1.email, Table2.email
    FROM Table1 LEFT JOIN Table2
    ON Table1.email = Table2.email
    UNION
    SELECT Table1.email, Table2.email
    FROM Table2 LEFT JOIN Table1
    ON Table2.email = Table1.email

    Comment

    • catlover30
      New Member
      • May 2007
      • 15

      #3
      Originally posted by mmccarthy
      You can use a UNION query to achieve the results you need in Access.
      Code:
      SELECT Table1.email, Table2.email
      FROM Table1 LEFT JOIN Table2
      ON Table1.email = Table2.email
      UNION
      SELECT Table1.email, Table2.email
      FROM Table2 LEFT JOIN Table1
      ON Table2.email = Table1.email
      Hi!

      Thanks a million! It worked! That is great!

      Comment

      • catlover30
        New Member
        • May 2007
        • 15

        #4
        It does work, but one thing, I think the second join is supposed to be RIGHT?

        Thanks!

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by catlover30
          It does work, but one thing, I think the second join is supposed to be RIGHT?

          Thanks!
          You're welcome.

          If you make the second join a right join you'll have to reverse the tables.

          Comment

          • catlover30
            New Member
            • May 2007
            • 15

            #6
            Thanks! It gives me what I want!

            Comment

            Working...