+ Reply to Thread
Results 1 to 10 of 10

Matching Data with multiple columns

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    13

    Matching Data with multiple columns

    Hi All,

    I am trying to sanity check data between two sets.

    By way of example, the first set contains three columns - Name, Food, Band (columns A,B&C). The second set contains identical headings (columns D,E & F)

    I need Excel to match the contents of column D with column A and the test whether column E matches column B and column F matches column C. Where this is true, I then need excel to display "TRUE", and "FALSE" where this is not the case (example attached with my formula).

    I have tried to do this with a combination of IF, VLOOKUP and AND - but its not working. Can anyone suggest what I am doing wrong, or a better way to do this?#

    Please see attached example.

    Thanks,


    Jim,
    Attached Files Attached Files

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Matching Data with multiple columns

    Are you trying to find exact matches of all three in the row (A=D, B=E, and C+F)? If so, you could use:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-02-2010
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Matching Data with multiple columns

    Hi,

    Thanks for the speedy response!

    I've tried this formula, but sadly it isn't working either.

    I think the problem is that the VLOOKUP function is stopping at the first instance it finds.

    For instance the first item is "Mike, Cheese, Pink". But this doesn't appear until then sixth row. Therefore excel returns FALSE as it has found (& stopped at) "Mike, Sandwich, Red" in the third row and just stopped looking.

    Can you suggest anything else I could try?

    Many thanks,



    Jim

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Matching Data with multiple columns

    Well, it's cheating a bit, but how about the attached?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-02-2010
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Matching Data with multiple columns

    Hi Bob,

    Again thanks for the reply, forgive me if i'm being dumb - but this formula just seems to be cocantenating the data?

  6. #6
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Matching Data with multiple columns

    Right, but now you have a single "value" to check against a comparable data set, so you can find values that exactly match. That's the cheat. So then the formula in Column H is very simple, as you see in the example, and gets all instances of matching all three columns.

  7. #7
    Registered User
    Join Date
    09-02-2010
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Matching Data with multiple columns

    Right, absolutely with you now. Did't realise you'd amended the formula in H as well!

    I see how this is working, but to complicate matters somewhat further I still need the N/A value to be returned in H7 - rather than the FALSE value currently returned.

    Do you think I'd be better going about this with INDEX and MATCH instead? Or is there a fix for this problem?

    Thanks again,

    Jim

  8. #8
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Matching Data with multiple columns

    In your example, you get NA only because "bill" is not in Column A. Would you also want NA if D7 was "mike" and E7 was "orange"? Either way, I would simply test for those condition in the "FALSE" part of the formula.
    This formula tests only for Column A, but it's easy enough to add a test for Column B.
    Please Login or Register  to view this content.
    Last edited by bentleybob; 04-01-2011 at 01:48 PM.

  9. #9
    Registered User
    Join Date
    09-02-2010
    Location
    Bristol, UK
    MS-Off Ver
    Office 365
    Posts
    13

    Re: Matching Data with multiple columns

    There will be some occasions when names will not appear in one set of data - such as Bill. Otherwise where "Mike" appears with "cheese" and "blue" it should appear as an error as it is not in both data sets (ie false).

  10. #10
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Matching Data with multiple columns

    Sorry, I don't follow. I see why Bill would be NA since he's not even on the list in Column A. But Cheese and Blue are, only the combination of Mike, Cheese, and Blue isn't a match. I'm trying to understand the rules for what should be FALSE and what should be NA.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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