Home

Excel formulas

%3CLINGO-SUB%20id%3D%22lingo-sub-849648%22%20slang%3D%22en-US%22%3EExcel%20formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-849648%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20find%20the%20right%20formula%20for%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20a%20certain%20text%20is%20within%20a%20range%20of%20cells%2C%20then%20it%20returns%20a%20value%2C%20if%20not%20it%20returns%20another%20value.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20close%20to%20the%20IF%20function%2C%20but%20not%20exactly%20because%20instead%20of%20the%20logical%20test%20being%20%3D%20to%20one%20specific%20cell%2C%20i%20want%20it%20to%20search%20within%20a%20range%20of%20cells.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-849648%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-849842%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formulas%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-849842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F407507%22%20target%3D%22_blank%22%3E%40laurenhall7589%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(%20COUNTIF(%3CRANGE%3E%2C%3CTEXT%3E)%2C%20Value1%2C%20Value2)%3C%2FTEXT%3E%3C%2FRANGE%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
laurenhall7589
Occasional Visitor

I am trying to find the right formula for this:

 

If a certain text is within a range of cells, then it returns a value, if not it returns another value.

 

It is close to the IF function, but not exactly because instead of the logical test being = to one specific cell, i want it to search within a range of cells.

1 Reply

@laurenhall7589 

As variant

=IF( COUNTIF(<range>,<text>), Value1, Value2)

 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies