+ Reply to Thread
Results 1 to 12 of 12

Need to compare multiple cells to find if they match exactly

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Need to compare multiple cells to find if they match exactly

    Hi, I'm trying to compare values in multiple cells to see if they are all the same. If they are, I want the cell containing the compare formula to be blank. If there is at least one that is different, I want the cell containing the formula to write "Mismatch".

    Usually I'd have no problem doing this with a combination of EXACT and AND, but I want blank cells to completely be ignored.

    Is there any way to do what I need to without a long series of IF statements?
    Last edited by Cyali; 03-07-2012 at 08:58 PM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Need to compare multiple cells to find if they match exactly

    can you provide an example sheet?
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    I put the formula I'm using in the Mismatch column. Currently I'm comparing two columns, but I need to be able to compare as many as needed.

    And an additional note, in the original spreadsheet the columns being compared are not right next to each other as in the example below. And only the line for Item1 should be returned as a mismatch.


    Example.xlsx
    Last edited by Cyali; 03-05-2012 at 04:05 PM.

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Need to compare multiple cells to find if they match exactly

    try using this you just need to put the columns in the count ranges

    =IF(COUNTIF(C3:F3,C3)=COUNTA(C3:F3),"","Mismatch")

  5. #5
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    Is there a way to use COUNTIF and COUNTA for when the columns are not right next to each other? I have other data in between each unit column. If not, it's not a big deal; I can create some hidden columns to use for the formula. This was a huge help, thanks!

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Need to compare multiple cells to find if they match exactly

    you cannot use those functions on non contiguous ranges, but hiddne helper columns would make it work.

  7. #7
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    Excellent, thanks! That's a lot less daunting then a ton of nested IFs.

  8. #8
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    Ok, so I had a chance to try that formula out, and it didn't work - any blank cells were seen as mismatches. I think it's because in the empty cells I have formulas (since the unit in the cells is derived from a larger unit - the item/pack size - and if there is no larger unit because the vendor doesn't supply an item, then the cell stays blank). How can I change it around so that it will work?

    Edit: Here's an updated example sheet.
    Example2.xlsx
    Last edited by Cyali; 03-05-2012 at 10:17 PM.

  9. #9
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    Sorry for the bump, but I still need help with this issue.

  10. #10
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Need to compare multiple cells to find if they match exactly

    Hi

    Hows this
    Please Login or Register  to view this content.
    rylo

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Need to compare multiple cells to find if they match exactly

    Maybe try this formula:

    Please Login or Register  to view this content.
    entered with Ctrl + Shift + Enter instead of Enter only as it is an array formula.

    It first checks to make sure all the cells from C3:F3 are not empty and then if they are not checks to make sure that they are all the same.

    Hope this helps.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  12. #12
    Registered User
    Join Date
    03-05-2012
    Location
    Chicago
    MS-Off Ver
    2007
    Posts
    25

    Re: Need to compare multiple cells to find if they match exactly

    Thank you both, both formulas worked perfectly!

+ 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