![]() |
If cell contains...
Hi
I'm sure this must be the easiest question ever but it's proving very difficult for me to find in the help and on Google. What is the Excel function that says "if A1 contains "fred" then 1, else 0". Note, A1 might contain Fred, Freddy or Alfredo, all should match. TIA Tim |
hi
=IF(A1="Fred",1,IF(A1="Freddy",1,if(A1="Alfredo",1 ,0))) -----Original Message----- Hi I'm sure this must be the easiest question ever but it's proving very difficult for me to find in the help and on Google. What is the Excel function that says "if A1 contains "fred" then 1, else 0". Note, A1 might contain Fred, Freddy or Alfredo, all should match. TIA Tim . |
=--(ISNUMBER(SEARCH("fred",A1)))
-- Regards, Peo Sjoblom "Tim Sampson" wrote in message . 2... Hi I'm sure this must be the easiest question ever but it's proving very difficult for me to find in the help and on Google. What is the Excel function that says "if A1 contains "fred" then 1, else 0". Note, A1 might contain Fred, Freddy or Alfredo, all should match. TIA Tim |
wrote in news:0fae01c51438$df781480
: hi =IF(A1="Fred",1,IF(A1="Freddy",1,if(A1="Alfredo",1 ,0))) Thanks but that's not quite what I was asking for. I might not know all the different permutations. I want contains "fred". Tim |
=--(COUNTIF(A1,"*fred*")0)
-- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Tim Sampson" wrote in message . 2... Hi I'm sure this must be the easiest question ever but it's proving very difficult for me to find in the help and on Google. What is the Excel function that says "if A1 contains "fred" then 1, else 0". Note, A1 might contain Fred, Freddy or Alfredo, all should match. TIA Tim |
"Peo Sjoblom" wrote in news:usYMxjDFFHA.3492
@TK2MSFTNGP12.phx.gbl: =--(ISNUMBER(SEARCH("fred",A1))) ISNUMBER, SEARCH and FIND all added to my portfolio. Thanks very much Tim |
"Ken Wright" wrote in news:#LEJasDFFHA.4072
@TK2MSFTNGP10.phx.gbl: =--(COUNTIF(A1,"*fred*")0) What is the =-- for? Tim |
Without it the formula will return TRUE or FALSE. The -- will convert TRUE
to 1 and FALSE to 0 http://www.mcgimpsey.com/excel/formulae/doubleneg.html -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Tim Sampson" wrote in message . 2... "Ken Wright" wrote in news:#LEJasDFFHA.4072 @TK2MSFTNGP10.phx.gbl: =--(COUNTIF(A1,"*fred*")0) What is the =-- for? Tim |
All times are GMT +1. The time now is 09:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com