Here’s an example of how you can implement a function to check if a value from one column exists in another.
Download the Practice Workbook
5 Methods to Return TRUE If a Value Exists in a Column in Excel
Method 1 – Use a Simple Formula to Find TRUE If the Columns Match
Steps:
- Use the following formula in the first cell of the result column (here, Cell D5).
=B5=C5
- You will get TRUE as output if both column values match.
- Use autofill (+) to drag down the formula to the rest of the column.
Method 2 – Return TRUE Using the EXACT Function If Values Match in Two Columns
Steps:
- Use the following formula:
- Here’s our result after applying AutoFill.
Method 3 – Use a Combination of MATCH, ISERROR, and NOT Functions to Get TRUE If a Value Exists in a Range
We have a fruit dataset and we will look for a particular fruit name (from column B) in a column containing a list of other fruits (column C).
Steps:
- Use the following formula:
=NOT(ISERROR(MATCH(B5,$C$5:$C$13,0)))
➤ MATCH(B5,$C$5:$C$13,0)
The MATCH function returns the relative position of an item in an array that matches a specified value in a specified order.
➤ ISERROR(MATCH(B5,$C$5:$C$13,0))
The ISERROR function checks whether a value is an error and returns TRUE or FALSE.
➤ NOT(ISERROR(MATCH(B5,$C$5:$C$13,0)))
The NOT function changes FALSE to TRUE or FALSE to TRUE.
- You will get the following result if the formula is entered correctly.
Method 4 – Return TRUE If a Value Is Present in an Excel Column Using the Combination of IF, ISERROR, and VLOOKUP Functions
Steps:
- Insert the following formula:
=IF(ISERROR(VLOOKUP(B5,$C$5:$C$13,1,FALSE)),FALSE,TRUE)
➤ VLOOKUP(B5,$C$5:$C$13,1,FALSE) The VLOOKUP function looks for a value in the leftmost column of a table and then returns a value in the same row from a column you specify. The function will look for the value of Cell B5 in range C5:C13. ➤ ISERROR(VLOOKUP(B5,$C$5:$C$13,1,FALSE)) The ISERROR function checks whether a value is an error, and returns TRUE or FALSE. Finally, ➤ IF(ISERROR(VLOOKUP(B5,$C$5:$C$13,1,FALSE)),FALSE,TRUE) The IF function checks whether a condition is met, and returns one value if TRUE, and another value if FALSE. We want to find any month of column B in the month list of column C. Steps: The MATCH function will look and match the value of Cell B5 in the range C5:C13, and the ISNUMBER function checks whether a value is a number and returns TRUE or FALSE. If the MATCH fails to find, it won’t return a number, so ISNUMBER will go to FALSE.
Method 5 – Use the Combination of ISNUMBER and MATCH Functions to Get TRUE If a Value Is Found in a Column in Excel
=ISNUMBER(MATCH(B5,$C$5:$C$13,0))
Get FREE Advanced Excel Exercises with Solutions!