Match formula to exclude criteria

McNeil87

New Member
Joined
Dec 6, 2019
Messages
31
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’
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

6StringJazzer

Well-known Member
Joined
Jan 27, 2010
Messages
720
Office Version
  1. 365
Platform
  1. Windows
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.
 

McNeil87

New Member
Joined
Dec 6, 2019
Messages
31
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Thank you for your detailed explanation and recommendation!!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,940
Messages
5,598,975
Members
414,270
Latest member
skipolmsted

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
Top