Match formula to exclude criteria

McNeil87

Board Regular
Joined
Dec 6, 2019
Messages
55
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hello!

Wondering if could have feedback on writing a formula that excludes specific criteria from a list. I started a formula that saysIF(ISERROR(MATCH(cellA1,lookupcolumn,0))=FALSE.

I’m confused by ISERROR. That essentially returns true if there is an error or false?
I want to write a formula that says ‘if cellB2 is in this list, then exclude but if cell B2 is not in this list, then include. But I’d like to return a true/false statement instead of saying ‘include’ or exclude’
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
ISERROR is a function that returns TRUE if the part inside the parentheses results in an error. In this case, ISERROR is TRUE if MATCH cannot find a match. Your IF function is testing to see if ISERROR is FALSE, which is to say that MATCH did find a match.

What you showed is only a fragment of a formula. It is not a complete formula. The complete formula would look something like this.

=IF(ISERROR(MATCH(cellA1,lookupcolumn,0))=FALSE, found_a_match, no_match)

The parts in parentheses is where you put the results you want under these two conditions.

If you just want to return TRUE if B2 is found, and FALSE if it is not, then you can use this formula (you do not need an IF):
=ISNUMBER(MATCH(B2,lookupcolumn,0))

ISNUMBER will be TRUE if MATCH returns any number, meaning that B2 was found. It will be FALSE if MATCH returns an error.
 
Upvote 0
Thank you for your detailed explanation and recommendation!!
 
Upvote 0

Forum statistics

Threads
1,213,557
Messages
6,114,291
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top