SOLVED

Excel

Copper Contributor

I want to match a value in a cell to a value within a column using an if then statement.  Example -

If cell A1 = a value within the column B1 through B25, then the value for C1 = "Yes"

What would my formula look like to accomplish this?

5 Replies

@PHBExcelQs Hi. You can use

=IF(ISERROR(MATCH(A1;B1:B25;0));"";"Yes")

 

best response confirmed by Hans Vogelaar (MVP)
Solution

@PHBExcelQs 

That could be

=IF( COUNTIF( $B$1:$B$25, A1 ), "Yes", "No" )

@PHBExcelQs 

=IF(COUNT(SEARCH(A1,$B$1:$B$25))>0,"yes","no")

Maybe with this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021. 

@Sergei Baklan 

Your formula worked.  Thank you.

@PHBExcelQs , you are welcome

1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@PHBExcelQs 

That could be

=IF( COUNTIF( $B$1:$B$25, A1 ), "Yes", "No" )

View solution in original post