Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default IF function and wildcards

Is it possible to use wildcards in an IF function to test a text string in a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default IF function and wildcards

try:

=IF(ISNUMBER(SEARCH("300",A1)),"300
Found",IF(ISNUMBER(SEARCH("600",A1)),"600 Found","Neither found"))

"Chacky" wrote:

Is it possible to use wildcards in an IF function to test a text string in a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default IF function and wildcards

Something for you to experiment with:
=IF(ISNUMBER(FIND("300",A1)),"X","Y")
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Chacky" wrote in message
...
Is it possible to use wildcards in an IF function to test a text string in
a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell
in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF function and wildcards

You can use Find for case insensitive searches like this....

=IF(ISNUMBER(FIND(300,A2)),"Yes","No")

If you need case sensitivity, then you would use the SEARCH function
instead.

Rick


"Chacky" wrote in message
...
Is it possible to use wildcards in an IF function to test a text string in
a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell
in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default IF function and wildcards

Thought it was the other way round ? <g
FIND is case sensitive while SEARCH is not
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Rick Rothstein (MVP - VB)" wrote:
You can use Find for case insensitive searches like this....

=IF(ISNUMBER(FIND(300,A2)),"Yes","No")

If you need case sensitivity, then you would use the SEARCH function
instead.

Rick




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF function and wildcards

LOL... I think my mind wandered there a little bit, huh? What I was talking
about when I **started** me response was the fact that values such as 300,
where there was no case to worry about, work fine with the FIND function...
and then I have no idea what happened to my response by the time I finished
it. And I can't even use "it was a long response" to explain it either (that
was one of my shorter responses). Thanks for catching that.

Rick


"Max" wrote in message
...
Thought it was the other way round ? <g
FIND is case sensitive while SEARCH is not
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Rick Rothstein (MVP - VB)" wrote:
You can use Find for case insensitive searches like this....

=IF(ISNUMBER(FIND(300,A2)),"Yes","No")

If you need case sensitivity, then you would use the SEARCH function
instead.

Rick



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF function and wildcards

As Max has pointed out elsewhere, FIND is a case **sensitive** function
whereas SEARCH is not. What I was trying to say, before I screwed my
response up royally, is that you can use FIND for this case because you are
looking for a value (300) which does not have upper/lower case issues.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
You can use Find for case insensitive searches like this....

=IF(ISNUMBER(FIND(300,A2)),"Yes","No")

If you need case sensitivity, then you would use the SEARCH function
instead.

Rick


"Chacky" wrote in message
...
Is it possible to use wildcards in an IF function to test a text string
in a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell
in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation



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
Wildcards and if Arlene Excel Worksheet Functions 3 June 21st 07 12:05 AM
Wildcards in SUMIF Function Ron Excel Worksheet Functions 9 February 13th 07 08:17 PM
Wildcards in RTD JKC Excel Discussion (Misc queries) 0 February 3rd 06 07:35 PM
Can wildcards be used in the Logic Test of an Excel "IF" function? Monte Excel Worksheet Functions 3 August 15th 05 01:25 PM
Problems with SUMIF function and Wildcards (* and ?) J1J Excel Worksheet Functions 4 June 27th 05 04:25 PM


All times are GMT +1. The time now is 09:33 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"