Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
All articles DATA VALIDATION Data validation must not contain

Data validation must not contain

Read time: 15 minutes

In excel, we can easily disallow an input which contains one of many things. To do this, we can use a validation rule which utilizes the SEARCH function. In this article, we shall look at how one can carry out data validation must not contain something else in excel.

Figure 1: Data validation in Excel

General syntax of the formula

=SUMPRODUCT (--ISNUMBER (SEARCH (list, column to validate)))=0

Understanding the formula

The formula above plays a fundamental role when we want to disallow inputs that contain one or many things.

How the formula works

  • Data validation formula utilizes the SEARCH function when testing an input for each value that are in the list.
  • The function uses the logic “contains”
  • In the event that a value is found in the list, the SEARCH function will return its position as a number.
  • When no value is found, the SEARCH function will return an error.
  • The numbers will then be converted to TRUE while the errors to FALSE by the ISNUMBER function.
  • These TRUE and FALSE strings are then converted to 1s and 0s by the double negative operator.
  • These items are then summed up by the SUMPRODUCT function and then the result is tested against zero.
  • Validation will occur if all items are zero and the SUMPRODUCT returns a zero. But if it returns any other number, then a FALSE is returned, meaning validation has failed.

Cell references when doing data validation applies to the upper left cell in the range that you have selected as of the moment the data validation rule is being entered.

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc