Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tim Sampson
 
Posts: n/a
Default 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
  #2   Report Post  
 
Posts: n/a
Default

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
.

  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

=--(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



  #4   Report Post  
Tim Sampson
 
Posts: n/a
Default

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
  #5   Report Post  
Ken Wright
 
Posts: n/a
Default

=--(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





  #6   Report Post  
Tim Sampson
 
Posts: n/a
Default

"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
  #7   Report Post  
Tim Sampson
 
Posts: n/a
Default

"Ken Wright" wrote in news:#LEJasDFFHA.4072
@TK2MSFTNGP10.phx.gbl:

=--(COUNTIF(A1,"*fred*")0)


What is the =-- for?

Tim
  #8   Report Post  
Ken Wright
 
Posts: n/a
Default

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
inserting data from a row to a cell, when the row number is specified by a formula in a cell [email protected] New Users to Excel 2 January 6th 05 07:18 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"