Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Finding Values in a cell

I have cells that have phrases written in them. Now I wish to assign a value
to the corresponding cell in the next column if a particular word is present
in the phrase.

e.g. Column A Column B
Johnny Passed the exam If A1 contains Johnny,
write 1 else 2
Rita missed the train If A1 contains Johnny,
write 1 else 2

How do I achieve the formula for column B?
Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Finding Values in a cell

Try the following:-

=IF(ISERROR(FIND("Johnny",A1,1)),"2", "1")

FIND is case sensitive. Use SEARCH in lieu as follows for non case sensitive:-

=IF(ISERROR(SEARCH("johnny",A3,1)),"2", "1")

--
Regards,

OssieMac


"Malik" wrote:

I have cells that have phrases written in them. Now I wish to assign a value
to the corresponding cell in the next column if a particular word is present
in the phrase.

e.g. Column A Column B
Johnny Passed the exam If A1 contains Johnny,
write 1 else 2
Rita missed the train If A1 contains Johnny,
write 1 else 2

How do I achieve the formula for column B?
Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default Finding Values in a cell

thanks.
wt shud i do if I have more than one words to search for? I know I can use
IF as many times as the words but the words that I have to search for are
around 35.

I want to search that "is any of these 35 words present in the phrase in A2?
If yes, condition1, if no condition2".

Your help is much appreciated.

Thanks again.

"OssieMac" wrote:

Try the following:-

=IF(ISERROR(FIND("Johnny",A1,1)),"2", "1")

FIND is case sensitive. Use SEARCH in lieu as follows for non case sensitive:-

=IF(ISERROR(SEARCH("johnny",A3,1)),"2", "1")

--
Regards,

OssieMac


"Malik" wrote:

I have cells that have phrases written in them. Now I wish to assign a value
to the corresponding cell in the next column if a particular word is present
in the phrase.

e.g. Column A Column B
Johnny Passed the exam If A1 contains Johnny,
write 1 else 2
Rita missed the train If A1 contains Johnny,
write 1 else 2

How do I achieve the formula for column B?
Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Finding Values in a cell

If I were doing it for myself then I would use a macro. If you want a macro
then let me know. Otherwise you could use 35 columns; one for each word and
then sum the values in the next column. If sum of values greater than 35 then
one of the words exists.

--
Regards,

OssieMac


"Malik" wrote:

thanks.
wt shud i do if I have more than one words to search for? I know I can use
IF as many times as the words but the words that I have to search for are
around 35.

I want to search that "is any of these 35 words present in the phrase in A2?
If yes, condition1, if no condition2".

Your help is much appreciated.

Thanks again.

"OssieMac" wrote:

Try the following:-

=IF(ISERROR(FIND("Johnny",A1,1)),"2", "1")

FIND is case sensitive. Use SEARCH in lieu as follows for non case sensitive:-

=IF(ISERROR(SEARCH("johnny",A3,1)),"2", "1")

--
Regards,

OssieMac


"Malik" wrote:

I have cells that have phrases written in them. Now I wish to assign a value
to the corresponding cell in the next column if a particular word is present
in the phrase.

e.g. Column A Column B
Johnny Passed the exam If A1 contains Johnny,
write 1 else 2
Rita missed the train If A1 contains Johnny,
write 1 else 2

How do I achieve the formula for column B?
Thanks in advance.

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
Finding Most Recent Values in Col1 -- Summing Matching Values Rothman Excel Discussion (Misc queries) 5 December 20th 07 08:19 PM
Finding Min Cell values excluding zero in alternate columns MichaelC Excel Worksheet Functions 9 July 7th 06 06:14 AM
Finding Min Cell values excluding zero in alternate columns bpeltzer Excel Worksheet Functions 0 November 5th 05 01:41 AM
finding cell values mellowe Excel Discussion (Misc queries) 2 October 20th 05 09:08 PM
finding values and displaying adjacent values willy3211 Excel Worksheet Functions 1 October 12th 05 04:49 PM


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