How to Compare Two Google Sheets for Matches

Managing and reconciling data across multiple spreadsheets can be a tedious task. This article addresses a common business problem: how to efficiently compare two Google Sheets to identify matching and non-matching entries, specifically focusing on comparing customer IDs. We’ll explore formulas and techniques to streamline this process, enabling quick identification of discrepancies and potential issues.

Comparing Customer IDs Across Two Lists

Let’s say you have two Google Sheets: ‘DList’ containing customer IDs collected by delivery personnel, and ‘PList’ with customer IDs and transaction details extracted from an online portal. The goal is to verify payments by comparing these two lists and identifying any discrepancies.

A simple initial approach is using VLOOKUP to check if each customer ID in ‘DList’ exists in ‘PList’:

=IF(ISNA(VLOOKUP(D2, PList!$E$2:$E$5000, 1, FALSE))," NOT RECIEVED", "RECIEVED")

This formula checks if the customer ID in cell D2 of ‘DList’ is present in column E of ‘PList’. If not found (ISNA returns TRUE), it indicates “NOT RECEIVED”; otherwise, “RECEIVED”. However, this approach falls short when a customer has multiple transactions in a month, as it only registers a single match.

To address this, SUMPRODUCT and COUNTIF can be used to count the number of matches for each customer ID:

=SUMPRODUCT(COUNTIF(D2,PList!$E$2:$E$5000))

This formula counts how many times the customer ID in D2 appears in ‘PList’. A result greater than 1 signifies multiple transactions. While this helps identify customers with multiple orders, manually verifying each instance using Ctrl + F is time-consuming.

Advanced Comparison Techniques in Google Sheets

For a more efficient solution, consider using the QUERY function combined with conditional formatting. QUERY allows for complex data filtering and manipulation, enabling you to create a separate table listing all matching and non-matching entries.

First, create a helper column in ‘DList’ using the previous SUMPRODUCT formula to count matches. Then, use QUERY to extract rows from ‘PList’ where the customer ID appears more than once in ‘DList’:

=QUERY(PList!A:F, "select * where E matches '"&JOIN("|",FILTER(DList!D:D,DList!G:G>1))&"'")

This formula dynamically builds a regular expression using customer IDs with multiple matches and filters ‘PList’ accordingly.

Furthermore, apply conditional formatting to highlight rows in ‘PList’ where the customer ID count in ‘DList’ is greater than 1. This visual cue instantly highlights potential discrepancies. You can use a custom formula for conditional formatting like this:

=COUNTIF(DList!$D:$D,E1)>1

Conclusion

Efficiently comparing two Google Sheets for matching data is crucial for data reconciliation and identifying discrepancies. By leveraging advanced formulas like QUERY and incorporating conditional formatting, you can streamline this process significantly. This method enables accurate verification, reduces manual effort, and provides a clear overview of potential issues requiring further investigation. Remember to adjust the formulas and ranges to match your specific spreadsheet structure.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *