ButtahNBred
ButtahNBred

Reputation: 470

Excel - Text validation against cell range

I am looking to use Excel's data validation feature with text. I have a cell which will be compared against data found in a 4 cell data range (F22:F25). I have tried creating my own formula to test inputs. For example, Let's say F22:F25 had the following fruits: Apples, Grapes, Oranges, Pears. If cell B5 had either of these fruits then it a pop up window should appear indicating that the fruit is already within that range.

I have tried OR(B5<>F22, B5<>F23, B5<>F24, B5<>F25), the NOT function, and a couple of others. Am I missing something obvious?

Upvotes: 0

Views: 155

Answers (1)

Abdul Hameed
Abdul Hameed

Reputation: 1145

Custom Data Validation is working for me. I am using excel 2010 (Windows 7).

I have F2 to F5 as Apples, Grapes, Oranges, Pears. I added Data validation in B2 such that =IF(COUNTIF($F$2:$F$5,$B$2)=0,TRUE,FALSE) with Allow drop down as Custom.

If I enter value in B2 which is in the ranges from F2 to F5 then count if becomes 1 so data validation fails. If I enter rest of data then works fine. Please refer below images.

DataValidation

ValidationOne

ValidationTwo

Upvotes: 1

Related Questions