+ Reply to Thread
Results 1 to 8 of 8

Formula to detect possible duplicate invoice entries

  1. #1
    Registered User
    Join Date
    11-19-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    21

    Formula to detect possible duplicate invoice entries

    Hello Guys! Hope you can provide some help. I want to detect possible duplicate invoice entries in my database by looking on 4 categories/columns in excel. I have no idea how to start working with the formula so I searched the net and I have found some but it takes forever for excel to finish the calculation. Most of the time, the application crashes and it notifies me that the excel is running out of resources. It seems that this is happening because I'm using the formula on more than 100,000 rows. Please check the attachment if you can modify below formula so the calculations will run much faster.

    =IF(SUMPRODUCT((A$2:A$12=A2)*1,(D$2:D$12=D2)*1,(E$2:E$12=E2)*1,--ISNUMBER(SEARCH("*"&G2&"*",G$2:G$12)))>1,"Duplicate","")

    Also, I want to improve the formula that can detect or distinguish a slight irregularity on the Invoice No. field.

    For example, 11695 & I1695, 120A67 & 12OA67, IN123 & lN123, are not being detected as possible duplicates despite the other 3 categories have the same information.

    Any help would be greatly appreciated. Thanks!

    Note: I noticed that there is a 1MB limit for the attachment so i just only included few rows.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,291

    Re: Formula to detect possible duplicate invoice entries

    Try this without test for Invoice number to see if it improves performance

    =IF(COUNTIFS($A$2:$A$150000,A2,$D$2:$D$150000,D2,$E$2:$E$150000,E2)>1,"Duplicate","")

    Testing "irregularities" in invoice number is difficult because you are likely to want a range of "rules" for matching.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,925

    Re: Formula to detect possible duplicate invoice entries

    This will get you part of the way there. As John said, you'll need some sort of a "rule book" to convert the invoice numbers to a common base such as all letter "O" will be converted to zero(0), All lower case "l" to the numeral 1, remove trailing alphabetical numbers and so forth.

    When you get that working, then you can add invoice number to the composite.
    Attached Files Attached Files
    Last edited by dflak; 10-10-2016 at 03:36 PM. Reason: Add attachment
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Registered User
    Join Date
    11-19-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    21

    Re: Formula to detect possible duplicate invoice entries

    Thanks John & dflak!

    I have tried the formula and it is a lot faster now but the problem is, it has detected a lot of false positive duplicates. I have tested it on 80,000 rows and more than 10,000 were detected as dup.

    I understand that the irregularities on invoice reference is difficult to implement and requires more complex formula but if we can integrate the previous formula =SUMPRODUCT(--ISNUMBER(SEARCH("*"&G2&"*",G$2:G$12)))) to check for the invoice nos. on the countifs function will greatly lessen the detected false positives. I have tried to insert this but it seems that it is not working on countifs.

  5. #5
    Registered User
    Join Date
    11-19-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    21

    Re: Formula to detect possible duplicate invoice entries

    Hi Guys,

    I'm thinking of an alternative formula to detect the irregularity on the invoice nos. still using the sumproduct function.

    I will temporarily use this for now since I'm working on a smaller database but if this can be improve to a faster formula, this will be greatly appreciated.

    As an addition to detect the string that may be added on the start and end of the invoice, this will search for the first 3 digits starting on the 2nd character from the left or 3 digits starting on the 2nd to the last character starting from the right. of the invoice reference to capture those errors on spelling.

    Please see the attached file as I'm clueless how to insert properly the added steps from the original formula and I'm getting a #VALUE! error.
    Attached Files Attached Files

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Formula to detect possible duplicate invoice entries

    Hey gehI7,

    See if using two helper columns makes your answer faster. See the attached. I've substituted Oh with zero and Eye with One before creating the helper column.
    Substitute for Typos and Countif Helper.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Registered User
    Join Date
    11-19-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    21

    Re: Formula to detect possible duplicate invoice entries

    Hi Marvin,

    Many thanks for the provided solution.

    The spelling mistakes are not fixed to O and I. These can be used interchangeably depending on the characters on the invoice reference. The formula should be flexible that may capture the spelling error on the first, middle, and last character of the invoice reference. I understand that this may not detect the exact duplicate match but an approximate one will do.

    Please see my comment on my post#5 above as well as the formula on the attached file to give you an insight on what I am trying to accomplish. I'm getting a result when I only use one criteria when using search but when I insert OR, I'm getting a #VALUE! error. It will be a big help if this can be rectified or if the conditions can be converted to countifs function and any other solutions similar to this.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,596

    Re: Formula to detect possible duplicate invoice entries

    As this thread has not received additional replies in a couple of days I thought that the following might be appropriate. Looking at the file attached to post #5, I'd suggest using only the first part of the formula in column H as in:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This would identify where the Vendor, Document Date and Amount are the same. From there you might be able to find those invoice numbers that are closely related using the Microsoft Excel add-on "Fuzzy Lookup".
    Note: I have never used the Fuzzy Lookup add on, however I found it referenced in a thread, on another forum site, that seemed to be related.
    I hope that this is helpful.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Replies: 2
    Last Post: 03-05-2015, 04:10 PM
  2. Need a Formula to Detect Duplicate Numerical Entries and Highlight Them
    By jsw1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-12-2014, 01:10 AM
  3. Replies: 0
    Last Post: 06-14-2012, 12:38 PM
  4. Detect if entries have duplicate criteria
    By Philster in forum Excel General
    Replies: 5
    Last Post: 10-15-2010, 10:30 AM
  5. Replies: 3
    Last Post: 03-03-2007, 10:41 AM
  6. Formula for duplicate entries?
    By JENNYC in forum Excel General
    Replies: 2
    Last Post: 02-08-2006, 04:27 PM
  7. Need Formula to detect duplicate invoices
    By XYZ via OfficeKB.com in forum Excel General
    Replies: 1
    Last Post: 10-11-2005, 06:05 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