

- #Compare two columns in excel and highlight matches how to#
- #Compare two columns in excel and highlight matches full#
- #Compare two columns in excel and highlight matches download#
UniMord created this formula for a project at work, where he needed to compare old and new addresses. =EXACT(RIGHT(TRIM(A2),3),RIGHT(TRIM(B2),3))įinally, here’s a formula from UniMord, that checks how much of a match there is between two cells.This formula will ignore extra spaces, but checks the case: You can combine LEFT or RIGHT with TRIM, if you’re not concerned about the space characters:Īnd combine LEFT or RIGHT with EXACT, to check if upper/lower case match too. For example, check the last 3 characters: To compare characters at the end of the cells, use the RIGHT function. For example, check the first 3 characters: To compare characters at the beginning of the cells, use the LEFT function. The following examples use the LEFT and RIGHT functions to compare partial text in two different cells.

#Compare two columns in excel and highlight matches full#
Sometimes you don’t need a full comparison of two cells – you just need to check the first few characters at the left, or a 3-digit code at the right end of a string.
#Compare two columns in excel and highlight matches download#
You can download the sample file there too. For each example shown in the video, you'll find the written steps for each example on the EXACT Function Examples page. This video shows a few more EXACT function examples. If one cell has some or all of the characters in bold, and the other cell doesn’t, the EXACT function could still return TRUE. If you need to compare two cells for contents, including a case sensitive comparison of letters, use the EXACT function.Īs its name indicates, the EXACT function can check for an exact match between text strings, including upper and lower case.įormatting: This function doesn’t test the cell formatting though, so it won’t compare how you format cells. There are written steps on the VLOOKUP Examples page. Has text numbers that cause a mismatch, watch this short video. To see the steps for fixing VLOOKUP formula when the lookup table
#Compare two columns in excel and highlight matches how to#
In the video below, I show how to change a VLOOKUP formula, so it will fix the mismatched data problem of real numbers vs text numbers. That's why Excel couldn't find matching data for product code 123 (real number) in the lookup table, and returned an #NA error.įormula Fix - Real Numbers and Text Numbers The results for the above formulas show that the:Ī real number is not a match for a text number. To check, I entered the following formulas, to test for numberss: Sometimes cells contain "text" numbers, instead of real numbers, especially if the data was imported, or copied from a website. In the screen shot below, the VLOOKUP formula includes TRIM, to remove extra spaces, and SUBSTITUTE, to remove the leading slash character, in the lookup value.įor my third test, I'll use the ISNUMBER function, to see if the two cell values are real numbers. For detailed step, see this VLOOKUP example on my Contextures Blog. To fix a VLOOKUP formula, so it will ignore extra spaces, you can use the TRIM function inside the VLOOKUP. The result for both formulas is 3, so there are no extra characters in one cell, and not in the other cell. I entered the following formulas, to check the lengths: Sometimes there are extra spaces in a cell, at the start, or at the end, or between words. Next, I'll use the Excel LEN function, to see if the two cell values are the same length. Note: Upper and lower case letters are treated as equal

The result of that formula is a Boolean value - TRUE or FALSE For example, in the next screen shot, I entered the following formula in cell A9: There are 3 quick tests, shown below, that I usually start with, when I need to compare two cells on a worksheet.įirst, I use the equal sign in a formula, to compare the two cells. I can see code 123 in the lookup table, so why can't Excel find it?.Instead, the result is an #N/A error, which means there is missing data.VLOOKUP formula should return the product name, Paper, in the second column, for code 123.After that, we'll try different tests, for more complex comparisons of the contents of two cells on an Excel worksheet.ĭo you ever have problems with the VLOOKUP function, like the one shown in the screen shot below? In the sections below, we'll start with a simple check of the cell contents. How can you compare two cells in Microsoft Excel, to see if they are exactly the same, or partially match? On this page, there are a few functions and formulas that check the contents of two cells, to see if they are the same. Download the Workbook Introduction: Compare Cell Values
