ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if a cell = a particular letter or even contains that letter (https://www.excelbanter.com/excel-worksheet-functions/15281-if-cell-%3D-particular-letter-even-contains-letter.html)

Brian

if a cell = a particular letter or even contains that letter
 
=IF(M22="all","a",IF(M22="e","r","a"))

Notice the "e", how can I insert the following:

....If m22 contains "e" anywhere,"r","a"))

Thanks

Brian

Ron Rosenfeld

On Sun, 27 Feb 2005 16:31:03 -0800, "Brian"
wrote:

=IF(M22="all","a",IF(M22="e","r","a"))

Notice the "e", how can I insert the following:

...If m22 contains "e" anywhere,"r","a"))

Thanks

Brian


.... =IF(COUNTIF(m22,"*e*")0,"r","a")


--ron

Ragdyer

Try this:

=IF(M22="all","a",IF(ISNUMBER(SEARCH("e",M22)),"r" ,"a"))
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Brian" wrote in message
...
=IF(M22="all","a",IF(M22="e","r","a"))

Notice the "e", how can I insert the following:

...If m22 contains "e" anywhere,"r","a"))

Thanks

Brian



Rob van Gelder

=IF(LEN(A1)LEN(SUBSTITUTE(A1, "e","")), "r", "a")

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Brian" wrote in message
...
=IF(M22="all","a",IF(M22="e","r","a"))

Notice the "e", how can I insert the following:

...If m22 contains "e" anywhere,"r","a"))

Thanks

Brian





All times are GMT +1. The time now is 01:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com