If the cell contains..., do something

0

0-0 Wai Wai ^-^

If the cell contains..., do something

Hi.

1)
How to do the following:
a) If the cell starts with "senior", do something... (eg count that cell if the
cell starts with "senior")
b) If the cell has "March" in the middle, do something...
c) If the cell ends with "boy", do something...
d) If the cell contains the word (it doesn't matter where the word locates), do
something...
??

2) Can you answers in Q1 be used in "conditional formatting"?
I need these conditons to format my cells too!
Thank you!
 
C

Clivey_UK

I'm not sure how you could do this with conditional formatting, which i
what you need for the last part of your question.
However, you also need to say do a count, so try the following fo
point 1)
a) =IF(LEFT(A1,6)="senior","Yes","")
b) =IF(ISERR(IF(SEARCH("March",A1,1)>0,1,"")),"","Yes")
c) =IF(RIGHT(A1,3)="boy","Yes","")
d) As b) which just finds the word March anywhere in the text.
Hope this helps.
Clive
 
0

0-0 Wai Wai ^-^

Clivey_UK said:
I'm not sure how you could do this with conditional formatting, which is
what you need for the last part of your question.
However, you also need to say do a count, so try the following for
point 1)
a) =IF(LEFT(A1,6)="senior","Yes","")
b) =IF(ISERR(IF(SEARCH("March",A1,1)>0,1,"")),"","Yes")
c) =IF(RIGHT(A1,3)="boy","Yes","")
d) As b) which just finds the word March anywhere in the text.
Hope this helps.
Clive

As to (b), my intention is to find word which happens in the middle only! Eg:
- March 30
- 30 March
- 2 March., 2000

The first one: Wrong! The word is at the start!
The second one: Wrong! The word is at the end!
Only the last one is true.

Any way to do so?
Thank you!
 
C

Clivey_UK

Try this to find March when not at start, not at end, but appears i
text:
=IF(ISERR(IF(SEARCH("March",A1,2)>1,1,"")),"",IF(RIGHT(A1,5)<>"March","Yes",""))
Clive
 
R

Ron Rosenfeld

If the cell contains..., do something

Hi.

1)
How to do the following:
a) If the cell starts with "senior", do something... (eg count that cell if the
cell starts with "senior")

=LEFT(A1,7) = "senior "

=IF(LEFT(A1,7) = "senior ","Do Something","Do Nothing")
b) If the cell has "March" in the middle, do something...

=ISNUMBER(FIND(" March ",A1)) for conditional formatting.

(note the space before and after March in the FIND function).

=IF(ISNUMBER(FIND(" March ",A1)),"do something","DO NOTHING")
c) If the cell ends with "boy", do something...
d) If the cell contains the word (it doesn't matter where the word locates), do
something...
??

2) Can you answers in Q1 be used in "conditional formatting"?
I need these conditons to format my cells too!
Thank you!

--ron
 
0

0-0 Wai Wai ^-^

Thanks!
As to b, my intention is it returns true only if the string is in the middle
only.
- 12 Mar
- Mar 12
-12 Mar 1999
The first two is false since "Mar" is at the end & start respectively.
Only the third one is counted.

Any help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top