SOLVED

Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-3281234%22%20slang%3D%22en-US%22%3EExcel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281234%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20to%20match%20a%20value%20in%20a%20cell%20to%20a%20value%20within%20a%20column%20using%20an%20if%20then%20statement.%26nbsp%3B%20Example%20-%3C%2FP%3E%3CP%3EIf%20cell%20A1%20%3D%20a%20value%20within%20the%20column%20B1%20through%20B25%2C%20then%20the%20value%20for%20C1%20%3D%20%22Yes%22%3C%2FP%3E%3CP%3EWhat%20would%20my%20formula%20look%20like%20to%20accomplish%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3281234%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3281313%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281313%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1359021%22%20target%3D%22_blank%22%3E%40PHBExcelQs%3C%2FA%3E%26nbsp%3B%2C%20you%20are%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3281287%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281287%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20formula%20worked.%26nbsp%3B%20Thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3281250%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281250%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1359021%22%20target%3D%22_blank%22%3E%40PHBExcelQs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(COUNT(SEARCH(A1%2C%24B%241%3A%24B%2425))%26gt%3B0%2C%22yes%22%2C%22no%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EMaybe%20with%20this%20formula.%20Enter%20the%20formula%20with%20ctrl%2Bshift%2Benter%20if%20you%20don't%20work%20with%20Office365%20or%202021.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3281244%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281244%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1359021%22%20target%3D%22_blank%22%3E%40PHBExcelQs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DIF(%20COUNTIF(%20%24B%241%3A%24B%2425%2C%20A1%20)%2C%20%22Yes%22%2C%20%22No%22%20)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3281243%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3281243%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1359021%22%20target%3D%22_blank%22%3E%40PHBExcelQs%3C%2FA%3E%26nbsp%3BHi.%20You%20can%20use%3C%2FP%3E%3CP%3E%3DIF(ISERROR(MATCH(A1%3BB1%3AB25%3B0))%3B%22%22%3B%22Yes%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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