Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search function in Excel

Search function
I need a help with the search function in Excel one or more text
strings

Example

cell B3 contains an address 1560 main road Montreal Quebec Canada

I would like such result to be True if either Montreal or Quebec or
both found in the D3 cell

I tried the two search formula but it does not work, both formula
looks for both conditions

=AND(SEARCH("montreal",B3),SEARCH("quebec",B3))

=OR(AND(SEARCH("montreal",B3),SEARCH("quebec",B3)) )

Any help would be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Search function in Excel

Hi,

Am Sat, 7 Jan 2012 06:25:12 -0800 (PST) schrieb siddique:

cell B3 contains an address 1560 main road Montreal Quebec Canada

I would like such result to be True if either Montreal or Quebec or
both found in the D3 cell


try:
=COUNT(SEARCH({"montreal","quebec"},B3))0


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Search function in Excel

On Sat, 7 Jan 2012 06:25:12 -0800 (PST), siddique wrote:

Search function
I need a help with the search function in Excel one or more text
strings

Example

cell B3 contains an address 1560 main road Montreal Quebec Canada

I would like such result to be True if either Montreal or Quebec or
both found in the D3 cell

I tried the two search formula but it does not work, both formula
looks for both conditions

=AND(SEARCH("montreal",B3),SEARCH("quebec",B3))

=OR(AND(SEARCH("montreal",B3),SEARCH("quebec",B3) ))

Any help would be appreciated



=OR(ISNUMBER(SEARCH({"montreal","quebec"},A1)))

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Search function in Excel

"siddique" wrote:
cell B3 contains an address 1560 main road Montreal Quebec Canada
I would like such result to be True if either Montreal or Quebec
or both found in the D3 cell


Ostensibly the following normal (non-array) formula (just press Enter):

=OR(ISNUMBER(SEARCH({"montreal","quebec"},B3)))

But bewa that will return TRUE for the address 1560 Montreal Road Ottawa
Canada, among others.

I wonder if you would need a more sophisticated search/comparison function.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Search function in Excel

On Sat, 7 Jan 2012 10:24:49 -0800, "joeu2004" wrote:

"siddique" wrote:
cell B3 contains an address 1560 main road Montreal Quebec Canada
I would like such result to be True if either Montreal or Quebec
or both found in the D3 cell


Ostensibly the following normal (non-array) formula (just press Enter):

=OR(ISNUMBER(SEARCH({"montreal","quebec"},B3)))

But bewa that will return TRUE for the address 1560 Montreal Road Ottawa
Canada, among others.

I wonder if you would need a more sophisticated search/comparison function.



If "B3" is a "city" "field", then it should already be separated.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Search function in Excel

"CellShocked" <cellshocked@thecellvalueattheendofthespreadsheet. org wrote:
"siddique" wrote:
cell B3 contains an address 1560 main road Montreal Quebec Canada

[....]
If "B3" is a "city" "field", then it should already be separated.


Maybe if you took the time to read the OP's explanation above, you would
know that it isn't.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Search function in Excel

On Sat, 7 Jan 2012 23:13:49 -0800, "joeu2004" wrote:

"CellShocked" <cellshocked@thecellvalueattheendofthespreadsheet. org wrote:
"siddique" wrote:
cell B3 contains an address 1560 main road Montreal Quebec Canada

[....]
If "B3" is a "city" "field", then it should already be separated.


Maybe if you took the time to read the OP's explanation above, you would
know that it isn't.

Some things should be pre-parsed, and if they are not, we should not
let those who would have us run circles to get to a point of consistency,
get away with 'improper behavior' from a basic computer science
perspective, when what they should be doing is modifying their basic
paradigm.

There is too much "It's all good" going on in too many places these
days.
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
excel function search excel novice New Users to Excel 1 February 1st 10 05:36 AM
Excel Search Function cmason Excel Discussion (Misc queries) 1 September 26th 07 06:25 PM
Excel search function Thyag Excel Discussion (Misc queries) 4 August 10th 07 05:53 PM
excel search function Thyag Excel Programming 1 August 10th 07 05:32 PM
Excel search function LegalPC Excel Discussion (Misc queries) 2 August 8th 06 07:47 PM


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