If cell contains one of many values
This tutorial shows how to check if a cell contains at least one of many items and return a value using an Excel formula, with the SUMPRODUCT function
Hard coded formula
Cell reference formula
=SUMPRODUCT(--(B5={"Tennis","Cricket","Netball"}))>0
=SUMPRODUCT(--(B5=$F$5:$F$7))>0
|
GENERIC FORMULA
=SUMPRODUCT(--(cell={value1,value2,...}))>0
ARGUMENTS GENERIC FORMULA
=SUMPRODUCT(--(cell=rng_values))>0
ARGUMENTS EXPLANATION This formula uses the SUMPRODUCT function to check if a selected cell contain one of many values. The formula will return a value of TRUE if the one of the values is equal to the value in the selected cell, otherwise it will return a value FALSE.
Click on either the Hard Coded or Cell Reference button to view the formula that has the text value to be tested for directly entered into the formula or referenced to a range of cells. |
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
If range contains one of many values | How to check if a range contains at least one of many items and return a value |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
SUMPRODUCT Function | The Excel SUMPRODUCT function multiplies corresponding ranges and returns the sum of these values |