Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
0-0 Wai Wai ^-^
 
Posts: n/a
Default If the cell contains..., do something

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!

--
Additional information:
- I'm using Office XP
- I'm using Windows XP


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Clivey_UK
 
Posts: n/a
Default If the cell contains..., do something


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

0-0 Wai Wai ^-^ Wrote:
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!



--
Clivey_UK
------------------------------------------------------------------------
Clivey_UK's Profile: http://www.excelforum.com/member.php...o&userid=32569
View this thread: http://www.excelforum.com/showthread...hreadid=525176

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
0-0 Wai Wai ^-^
 
Posts: n/a
Default If the cell contains..., do something


"Clivey_UK" ¦b¶l¥ó
¤¤¼¶¼g...

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!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Clivey_UK
 
Posts: n/a
Default If the cell contains..., do something


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

0-0 Wai Wai ^-^ Wrote:
"Clivey_UK"
¦b¶l¥ó
¤¤¼¶¼g...

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!



--
Clivey_UK
------------------------------------------------------------------------
Clivey_UK's Profile: http://www.excelforum.com/member.php...o&userid=32569
View this thread: http://www.excelforum.com/showthread...hreadid=525176

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default If the cell contains..., do something

On Wed, 22 Mar 2006 17:21:52 +0800, "0-0 Wai Wai ^-^" wrote:

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


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
0-0 Wai Wai ^-^
 
Posts: n/a
Default If the cell contains..., do something


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?


"Clivey_UK" ¦b¶l¥ó
¤¤¼¶¼g...

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

0-0 Wai Wai ^-^ Wrote:
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!



--
Clivey_UK
------------------------------------------------------------------------
Clivey_UK's Profile:

http://www.excelforum.com/member.php...o&userid=32569
View this thread: http://www.excelforum.com/showthread...hreadid=525176



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
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Adding a row to worksheet does not update cell references in another. blausen Excel Worksheet Functions 5 February 25th 06 09:14 PM
Instead of a negative number, I'd like to show zero... Dr. Darrell Excel Worksheet Functions 6 December 7th 05 08:21 PM
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM


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