Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Cell Contains Word

Hi

I have the following formula but am having some difficulty with the last bit.

If cell G7 contains the word "Total" I want the result to be 0 if the rest
of the criteria is not met.

so if cell G7 = "London Total" I want the result to be 0

=IF(A7="Y",COUNTIF(J7:Q7,"(blank)"),IF(A7="N",10,I F(SEARCH("Total",G7),0,0)))

the rest of the formula works fine...

Many thanks for your help!


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Cell Contains Word

The expression

ISNUMBER(SEARCH("total",G7))

Will return TRUE if "total" is anywhere in G7. Case insensitive. FIND
is case-sensitive.

HTH
Kostis Vezerides

On Nov 19, 6:31*pm, Tracey wrote:
Hi

I have the following formula but am having some difficulty with the last bit.

If cell G7 contains the word "Total" I want the result to be 0 if the rest
of the criteria is not met.

so if cell G7 = "London Total" I want the result to be 0

=IF(A7="Y",COUNTIF(J7:Q7,"(blank)"),IF(A7="N",10,I F(SEARCH("Total",G7),0,0)))

the rest of the formula works fine...

Many thanks for your help!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Cell Contains Word

=IF(A7="Y",COUNTIF(J7:Q7,"(blank)"),IF(A7="N",10, IF(SEARCH("Total",G7),0,0)))

There's a logic "problem" with your formula.

If the first 2 IFs are false then the last IF returns 0 whether G7 contains
"total" or not.


--
Biff
Microsoft Excel MVP


"Tracey" wrote in message
...
Hi

I have the following formula but am having some difficulty with the last
bit.

If cell G7 contains the word "Total" I want the result to be 0 if the rest
of the criteria is not met.

so if cell G7 = "London Total" I want the result to be 0

=IF(A7="Y",COUNTIF(J7:Q7,"(blank)"),IF(A7="N",10,I F(SEARCH("Total",G7),0,0)))

the rest of the formula works fine...

Many thanks for your help!




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Cell Contains Word

vezerid wrote...
....
ISNUMBER(SEARCH("total",G7))

....

COUNTIF(G7,"*Total*")

would be more efficient (shorter, faster, uses less memory in RAM and
on disk) for case insensitive searches. It returns 1 if Total occurs
in the value of G7, 0 otherwise, and Excel treats 1 as TRUE and 0 as
FALSE in the 1st argument to IF.

For case sensitive searches,

COUNT(FIND("Total",G7))

is shorter than the ISNUMBER alternative. ISNUMBER is better when you
need to return an array.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default Cell Contains Word

Thanks Harlan. I am always impressed by your posts.

Kostis

On Nov 19, 9:12*pm, Harlan Grove wrote:
wrote...

...ISNUMBER(SEARCH("total",G7))

...

COUNTIF(G7,"*Total*")

would be more efficient (shorter, faster, uses less memory in RAM and
on disk) for case insensitive searches. It returns 1 if Total occurs
in the value of G7, 0 otherwise, and Excel treats 1 as TRUE and 0 as
FALSE in the 1st argument to IF.

For case sensitive searches,

COUNT(FIND("Total",G7))

is shorter than the ISNUMBER alternative. ISNUMBER is better when you
need to return an array.


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
how to copy the first word or two words from a cell containing a complete sentence to another cell jonny Excel Discussion (Misc queries) 7 May 19th 23 03:43 AM
word match in string text in cell, color format cell jpmahony Excel Discussion (Misc queries) 1 October 31st 07 03:56 PM
How do a put a word on top of a word in a cell? Michelle Excel Discussion (Misc queries) 2 March 4th 07 11:07 PM
Add word in cell changes to word TRUE Joey041 Excel Discussion (Misc queries) 3 September 11th 06 03:47 AM
how do I make a word typed in a cell go to a specific cell in anot Lmatarazzo Excel Discussion (Misc queries) 3 April 21st 05 04:29 AM


All times are GMT +1. The time now is 05:07 PM.

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"