Compare two ranges and list the elements that are in the first but not in the second
=FILTER(range1, NOT(COUNTIF(range2, range1)))This function will compare two ranges and list down the elements that are present in the first range but not in the second. To use the "COMPARE_LISTS" function input two ranges: "range1" and "range2". "range1" is the list you want to compare against "range2" to find unique items. For example, if you have a list of employee IDs in cells "A2:A10" that you want to compare against a list of IDs in "B2:B10" to identify IDs only present in the first list, you would enter the function in a cell as "=COMPARE_LISTS(A2:A10, B2:B10)". This function will then display all the unique IDs from "A2:A10" that do not appear in "B2:B10", listed vertically starting from the cell where you entered the function.
Use the inputs below to create COMPARE_LIST as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsCOMPARE_LIST
Compare two ranges and list the elements that are in the first but not in the second
=FILTER(range1, NOT(COUNTIF(range2, range1)))
range1
range2
The first list of cells you want to compare
A2:A10
The second list of cells you want to compare against the first
B2:B10
Other functions in the same category: List & Array Operations
Returns the first non-blank value in a range
Concatenates multiple ranges or arrays and removes duplicates
Extract a list of unique values from a range
Return the top N items ranked by scores
Return the botttom N items ranked by scores
Named functions enable the creation of custom, reusable formulas that mimic built-in functions, streamlining calculations and data manipulations. These functions simplify complex formulas, making spreadsheets more readable and less prone to errors. By encapsulating intricate logic within a single function call, they enhance consistency across your data. Utilizing named functions reduces the need to write lengthy formulas repeatedly, thereby improving workflow efficiency and productivity in data analysis and management.
Download and import — fastest way to add the function but does not include argument descriptions and examples
Follow these simple steps to download and import a function into your spreadsheet. This method is the quickest and easiest way to add the named function to your Google Sheets document, but will not include the argument description and examples.
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.
Copy and paste — copy and paste each property one at a time
Follow these simple steps to integrate a custom named function into your spreadsheet:
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.