Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Amanda Guenthner
 
Posts: n/a
Default If Statements - how to do is like '%value%'

Hi-

I am trying to flag a record as being either CCO or CCT, where any
record with either of the following would be flagged as CCT (else would be
CCO):
1. Domain value is at least one of the following: "Customer Contact
Transformation (CCT/ACCS, Customer Contact Transformation","Customer
Contact Transformation (Scale Play)"
OR
2. Campaign = "Customer Contact Transformation (CCT)"

I had used the following if statement:
=IF(N10&O10="","",IF(OR(N10="Customer Contact Transformation
(CCT/ACCS)",N10="Customer Contact Transformation",N10="Customer Contact
Transformation (Scale Play)",O10="Customer Contact Transformation
(CCT)"),("CCT"),("CCO")))

The problem with this, however, is that the Domain field can have multiple
values (i.e. can have one of the CCT related values in #1 plus another
unrelated value). This statement is only looking for exact matches; hence I
am not flagging all those that I need to because I want it to = CCT if any
one of the Domain values contains CCT or the Campaign value contains CCT.

Is there a way to structure IF statements to look for records that contain
certain text (i.e. like in SQL how you can do * is like %CCT%)? Perhaps I
need to do something more complex than an IF statementnot sure what this
would be though.

I would really appreciate any help with this. Thanks in advance.

Amanda

  #2   Report Post  
PC
 
Posts: n/a
Default

How about something along the lines of

IF(OR(ISERROR(FIND("CCT",A1))=FALSE,ISERROR(FIND(" CCO",A1))=FALSE),"somethin
g","something else")

You may need to fiddle with that syntaxt, but the idea is to have the
formula search the string for the three critical values.

PC

"Amanda Guenthner" wrote in
message ...
Hi-

I am trying to flag a record as being either "CCO" or "CCT", where any
record with either of the following would be flagged as CCT (else would be
CCO):
1. Domain value is at least one of the following: "Customer Contact
Transformation (CCT/ACCS", "Customer Contact Transformation","Customer
Contact Transformation (Scale Play)"
OR
2. Campaign = "Customer Contact Transformation (CCT)"

I had used the following if statement:
=IF(N10&O10="","",IF(OR(N10="Customer Contact Transformation
(CCT/ACCS)",N10="Customer Contact Transformation",N10="Customer Contact
Transformation (Scale Play)",O10="Customer Contact Transformation
(CCT)"),("CCT"),("CCO")))

The problem with this, however, is that the Domain field can have multiple
values (i.e. can have one of the CCT related values in #1 plus another
unrelated value). This statement is only looking for exact matches; hence

I
am not flagging all those that I need to because I want it to = CCT if any
one of the Domain values contains CCT or the Campaign value contains CCT.

Is there a way to structure IF statements to look for records that contain
certain text (i.e. like in SQL how you can do ? is like '%CCT%')? Perhaps

I
need to do something more complex than an IF statement.not sure what this
would be though.

I would really appreciate any help with this. Thanks in advance.

Amanda



  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sat, 4 Jun 2005 10:40:01 -0700, "Amanda Guenthner"
wrote:

Is there a way to structure IF statements to look for records that contain
certain text (i.e. like in SQL how you can do ? is like %CCT%)?


Several methods:

=COUNTIF(range_to_search,"*CCT*") will return 0 if CCT is not present. (Note
the "*" wild card characters).

=FIND("CCT",G1) will return #VALUE! if CCT not present, otherwise it will
return a positive integer. (Note NO wild card characters allowed).

=SEARCH("CCT",G1) will do the same as FIND, but is case-insensitive.


--ron
  #4   Report Post  
RagDyeR
 
Posts: n/a
Default

Don't know if I follow all your conditions, but try this concept:

=IF(N10&O10="","",IF(OR(COUNTIF(N10,"Customer Contact
Transformation*")0,O10="Customer Contact Transformation
(CCT)"),"CCT","CCO"))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Amanda Guenthner" wrote in
message ...
Hi-

I am trying to flag a record as being either "CCO" or "CCT", where any
record with either of the following would be flagged as CCT (else would be
CCO):
1. Domain value is at least one of the following: "Customer Contact
Transformation (CCT/ACCS", "Customer Contact Transformation","Customer
Contact Transformation (Scale Play)"
OR
2. Campaign = "Customer Contact Transformation (CCT)"

I had used the following if statement:
=IF(N10&O10="","",IF(OR(N10="Customer Contact Transformation
(CCT/ACCS)",N10="Customer Contact Transformation",N10="Customer Contact
Transformation (Scale Play)",O10="Customer Contact Transformation
(CCT)"),("CCT"),("CCO")))

The problem with this, however, is that the Domain field can have multiple
values (i.e. can have one of the CCT related values in #1 plus another
unrelated value). This statement is only looking for exact matches; hence I
am not flagging all those that I need to because I want it to = CCT if any
one of the Domain values contains CCT or the Campaign value contains CCT.

Is there a way to structure IF statements to look for records that contain
certain text (i.e. like in SQL how you can do ? is like '%CCT%')? Perhaps I
need to do something more complex than an IF statement.not sure what this
would be though.

I would really appreciate any help with this. Thanks in advance.

Amanda


  #5   Report Post  
Amanda Guenthner
 
Posts: n/a
Default

Thanks - that did the trick. Although I did need to create another column
that had the =COUNTIF(range_to_search,"*CCT*") formula. I then referenced
this new column with a more simple if statement (i.e.
IF(A10,("CCT"),("CCO"))).

Is there a way to combine the logic you provided to do the wildcard search
for the string embedded in my initial IF statement? No worries if this is
really complicated.

Thanks again, Amanda

"Ron Rosenfeld" wrote:

On Sat, 4 Jun 2005 10:40:01 -0700, "Amanda Guenthner"
wrote:

Is there a way to structure IF statements to look for records that contain
certain text (i.e. like in SQL how you can do ? is like %CCT%)?


Several methods:

=COUNTIF(range_to_search,"*CCT*") will return 0 if CCT is not present. (Note
the "*" wild card characters).

=FIND("CCT",G1) will return #VALUE! if CCT not present, otherwise it will
return a positive integer. (Note NO wild card characters allowed).

=SEARCH("CCT",G1) will do the same as FIND, but is case-insensitive.


--ron



  #6   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sat, 4 Jun 2005 16:47:01 -0700, "Amanda Guenthner"
wrote:

Is there a way to combine the logic you provided to do the wildcard search
for the string embedded in my initial IF statement? No worries if this is
really complicated.


You can combine things using OR constructs. (Adding things the way I do below
is the equivalent of OR).

However, since I don't know all of the possibilities, you may have to modify my
suggestion. It should give you some ideas, though:

=IF(N10&O10="","",
IF(COUNTIF(N10,"*CCT*")+
COUNTIF(N10,"*Customer Contact Transformation*")+
COUNTIF(O10,Customer Contact Transformation),
"CCT","CCO"))



--ron
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
Nesting more than nine IF statements in Excel Alexander Walsh via OfficeKB.com Excel Worksheet Functions 13 June 1st 05 06:31 PM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM
2 If Statements between 2 values Q John Excel Worksheet Functions 4 December 13th 04 03:37 PM
4 different if statements, not working Brian Excel Worksheet Functions 5 December 12th 04 08:17 PM
If statements Mark Excel Worksheet Functions 3 November 2nd 04 08:39 PM


All times are GMT +1. The time now is 06:52 AM.

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

About Us

"It's about Microsoft Excel"