Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Use the EXACT Function in Excel

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can find an exact match in Excel using the EXACT function, which compares two text strings character by character and returns TRUE if they are identical, or FALSE if they differ. This is the most reliable way to check for exact matches in Excel because it respects case sensitivity, unlike standard comparison operators like equals (=). Before using this function, ensure you have two text strings you want to compare, either typed directly into the formula or referencing cells containing that data. No special installation is required, as EXACT is a built-in text function available in all modern versions of Excel, Google Sheets, and LibreOffice Calc.

What You'll Need

  • A computer with Microsoft Excel, Google Sheets, or a compatible spreadsheet application installed.
  • A dataset or two separate text strings you wish to compare for an exact match.
  • A basic understanding of cell references (e.g., A1, B2) and the ability to type formulas into a cell.

Step-by-Step

  1. Locate your data: Open your spreadsheet and identify the two cells or text values you want to compare. For example, you might have a list of names in column A and a list of expected entries in column B.
  2. Select the result cell: Click on the empty cell where you want the TRUE or FALSE result of the comparison to appear. This is typically the cell directly below or to the right of your data.
  3. Start the formula: Type an equals sign (=) to begin the formula. Excel will recognize this as the start of a calculation.
  4. Enter the EXACT function: Type EXACT(. This tells Excel you are using the exact match comparison function.
  5. Input the first value: Click on the first cell containing the text you want to check, or type the text string directly into the formula. For example, type A1 or type "apple". Close the parenthesis after this value, so the formula looks like EXACT(A1,.
  6. Input the second value: Click on the second cell containing the text you want to compare against, or type the second text string. Ensure the order does not matter for the result, but keep it consistent with your logic. The formula should now look like EXACT(A1,B1).
  7. Close the parenthesis and press Enter: Finish the formula by typing the closing parenthesis ) and then press Enter on your keyboard. Excel will calculate the result.
  8. Drag the formula: If you are comparing a list of items, you can drag the fill handle (the small square at the bottom-right corner of the result cell) down to apply the EXACT function to the rest of your dataset.

Common Mistakes

The most common mistake when using the EXACT function is relying on the standard equals operator (=) instead. The equals operator is case-insensitive, meaning it treats "Apple", "APPLE", and "apple" all as the same value. If you need to distinguish between uppercase and lowercase letters, you must use EXACT. Another frequent error is forgetting to enclose text strings in quotation marks. For example, EXACT(A1, apple) will return an error because Excel treats "apple" as a named range rather than text. Always ensure text values are wrapped in double quotes, while cell references are not.

Tips

For better data management, consider using the EXACT function as part of a larger logical test. You can nest EXACT inside an IF statement to perform actions based on the match result. For example, IF(EXACT(A1,B1), "Match Found", "No Match") will display "Match Found" only if the two cells are exactly the same. This is incredibly useful for validating data entries. Additionally, combining EXACT with the VLOOKUP function can create a case-sensitive lookup. Standard VLOOKUP is case-insensitive, but by using VLOOKUP(EXACT(A2, lookup_table), lookup_table, 2, 0), you can force Excel to find an exact match regardless of case, though this requires a slight adjustment to the lookup value syntax.

Troubleshooting

If the EXACT function returns #NAME?, check for typos in the function name. It must be spelled exactly as EXACT and written in uppercase letters. If you receive a #REF! error, one of the cell references you used is invalid, such as a reference to a cell that does not exist in the sheet. If the result is always FALSE even when the text looks identical, check for hidden characters. Sometimes, text copied from a website or PDF contains invisible line breaks or non-breaking spaces. In this case, use the TRIM function on both values before comparing them, e.g., EXACT(TRIM(A1), TRIM(B1)). This removes leading, trailing, and multiple internal spaces that might be causing the mismatch.

Frequently Asked Questions

Does the EXACT function work with numbers?

No, the EXACT function is designed specifically for text strings. If you try to use it on numbers, Excel will convert the numbers to text format during the comparison. While this often works, it is safer to convert numbers to text first or use standard equality checks for numerical values.

Can I use EXACT to compare entire columns?

You can, but it is inefficient. Using EXACT(A:A, B:B) will compare every single cell in column A to the corresponding cell in column B. For large datasets, this can slow down your spreadsheet. It is better to apply the formula to a specific range of cells that you actually need to check.

Why does EXACT return TRUE when I expect FALSE?

This usually happens due to invisible characters or formatting differences. One string might have a trailing space that the other lacks, or they might have different font encodings. Using the LEN function on both strings can reveal hidden characters, and the TRIM function is the standard fix for unwanted spaces.

Is there a way to count exact matches in a list?

Yes, you can use the SUMPRODUCT function combined with EXACT. The formula =SUMPRODUCT(--EXACT("target", A1:A10)) will count how many times the exact string "target" appears in the range A1:A10, treating each occurrence as a distinct match.

What is the difference between EXACT and EQUALS?

The equals operator (=) compares values and returns TRUE if they are equal, but it ignores case. The EXACT function compares text character by character and is case-sensitive, making it the only correct choice when the case of the letters matters for the validity of the data.