+ Reply to Thread
Results 1 to 6 of 6

Identifying discrepancies between two columns of data

  1. #1
    Registered User
    Join Date
    11-19-2021
    Location
    New Brighton, England
    MS-Off Ver
    Windows 10
    Posts
    6

    Identifying discrepancies between two columns of data

    Good morning,
    I'm back, with the latest formula I've got stuck with.
    I'm trying to compare two columns, C Batch and D Expiry Date, which should be consistent.
    In the attached, I have scanned the entries and can see some inconsistencies. For example, lines 592 and 593 are both Batch 'SE30' but have different Expiry Dates (30/09/2021 and 31/01/2022).
    I am hoping to find a formula that will highlight these. I've been looking at MATCH formulas and conditional formatting rules, but haven't managed to come up with one that does what I need.
    Can anyone here advise?
    Many thanks, Tim
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    689

    Re: Identifying discrepancies between two columns of data

    Something like this will indicate the entire batch where something is missing:

    Column F: =COUNTIFS([Batch],[@Batch])-COUNTIFS([Batch],[@Batch],[Expiry Date],[@[Expiry Date]])

    It will give you values of 22 and 4 basically telling that for SE30 2 different dates are provided, of in total 26 occurrences, 22 have the same date and 4 have a different date.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Identifying discrepancies between two columns of data

    One way is a conditional format in F2

    =IF(OR(C2<>C1,C2<>C3),TRUE,AND(C2=C3,D2=D3,C2=C1,D2=D1))=FALSE

    It assumes the table is sorted by Batch and Expiry Date
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    11-19-2021
    Location
    New Brighton, England
    MS-Off Ver
    Windows 10
    Posts
    6

    Re: Identifying discrepancies between two columns of data

    Hi RaulSerg,
    This is genius. It would have taken me a long time to reach this point on my own.
    One question I do have is, the 4 that have a different date sows a value of 22, and the 22 that have the same date, a value of 4. Is there any way of flipping this around?
    Thanks again, Tim

  5. #5
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    UK
    MS-Off Ver
    365
    Posts
    689

    Re: Identifying discrepancies between two columns of data

    Can't think of anything more elegant: =IF(COUNTIFS([Batch],[@Batch])-COUNTIFS([Batch],[@Batch],[Expiry Date],[@[Expiry Date]]),COUNTIFS([Batch],[@Batch],[Expiry Date],[@[Expiry Date]]),)

  6. #6
    Registered User
    Join Date
    11-19-2021
    Location
    New Brighton, England
    MS-Off Ver
    Windows 10
    Posts
    6

    Re: Identifying discrepancies between two columns of data

    Elegance is sometimes overrated. Thank you!

+ 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. Identifying Permutations of 12 rows of data across 3 columns
    By Flipcharto in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2019, 09:54 AM
  2. [SOLVED] identifying unique data from 2 columns
    By Roshan.Shakya in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-23-2019, 01:14 PM
  3. Comparing 2 Excel Columns and displaying discrepancies
    By Aralei in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2014, 09:21 PM
  4. [SOLVED] Identifying duplicate data using multiple columns
    By DuckMan72 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-13-2013, 05:28 PM
  5. Replies: 2
    Last Post: 06-13-2013, 03:09 AM
  6. Replies: 1
    Last Post: 10-26-2011, 01:50 AM
  7. Identifying an item with data in two columns
    By BaileyWinston in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-23-2010, 11:52 AM

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