Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
Default Find text and enter in new cell

Text in column A cells may contain 1 of the following: alpha, beta, gamma,
delta.

I want to search cells in column A for all of these values and, if one is
found, insert that value in the same cell of column B.

For example, cell A3 contains beta, kappa, and tau. I want to check for
alpha, beta, gamma, or delta. The search should determine that beta is
present and then place beta in cell B3.

If the search does not find alpha, beta, gamma, or delta, then "other"
should be placed in the corresponding cell of column B.

Is this possible?

Thanks,
Tom
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default Find text and enter in new cell

=if(countif(a1,"*alpha*")0,"alpha",if(countif(a1, "*beta*")0,"beta",if(countif(a1,"*gamma*")0,"gam ma",if(countif(a1,"*delta*")0,"delta","other")) ))
--
Please remember to indicate when the post is answered so others can benefit
from it later.


"tommcbrny" wrote:

Text in column A cells may contain 1 of the following: alpha, beta, gamma,
delta.

I want to search cells in column A for all of these values and, if one is
found, insert that value in the same cell of column B.

For example, cell A3 contains beta, kappa, and tau. I want to check for
alpha, beta, gamma, or delta. The search should determine that beta is
present and then place beta in cell B3.

If the search does not find alpha, beta, gamma, or delta, then "other"
should be placed in the corresponding cell of column B.

Is this possible?

Thanks,
Tom

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
Default Find text and enter in new cell

Awesome, thank you!

"KC Rippstein" wrote:

=if(countif(a1,"*alpha*")0,"alpha",if(countif(a1, "*beta*")0,"beta",if(countif(a1,"*gamma*")0,"gam ma",if(countif(a1,"*delta*")0,"delta","other")) ))
--
Please remember to indicate when the post is answered so others can benefit
from it later.


"tommcbrny" wrote:

Text in column A cells may contain 1 of the following: alpha, beta, gamma,
delta.

I want to search cells in column A for all of these values and, if one is
found, insert that value in the same cell of column B.

For example, cell A3 contains beta, kappa, and tau. I want to check for
alpha, beta, gamma, or delta. The search should determine that beta is
present and then place beta in cell B3.

If the search does not find alpha, beta, gamma, or delta, then "other"
should be placed in the corresponding cell of column B.

Is this possible?

Thanks,
Tom

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
Default Find text and enter in new cell

Folllow-up question to this, although the solution works quite nicely:
Is the number of iterations of the if statements limited?
Thanks again
Tom

"KC Rippstein" wrote:

=if(countif(a1,"*alpha*")0,"alpha",if(countif(a1, "*beta*")0,"beta",if(countif(a1,"*gamma*")0,"gam ma",if(countif(a1,"*delta*")0,"delta","other")) ))
--
Please remember to indicate when the post is answered so others can benefit
from it later.


"tommcbrny" wrote:

Text in column A cells may contain 1 of the following: alpha, beta, gamma,
delta.

I want to search cells in column A for all of these values and, if one is
found, insert that value in the same cell of column B.

For example, cell A3 contains beta, kappa, and tau. I want to check for
alpha, beta, gamma, or delta. The search should determine that beta is
present and then place beta in cell B3.

If the search does not find alpha, beta, gamma, or delta, then "other"
should be placed in the corresponding cell of column B.

Is this possible?

Thanks,
Tom

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Find text and enter in new cell

On Fri, 9 May 2008 08:31:02 -0700, tommcbrny
wrote:

Text in column A cells may contain 1 of the following: alpha, beta, gamma,
delta.

I want to search cells in column A for all of these values and, if one is
found, insert that value in the same cell of column B.

For example, cell A3 contains beta, kappa, and tau. I want to check for
alpha, beta, gamma, or delta. The search should determine that beta is
present and then place beta in cell B3.

If the search does not find alpha, beta, gamma, or delta, then "other"
should be placed in the corresponding cell of column B.

Is this possible?

Thanks,
Tom


Enter your allowed words in some column, one word to a cell, and name that
range "List".

Then enter this "array-entered" formula in B1, and fill down as far as
required:

=IF(SUM(-ISNUMBER(SEARCH(List,A1)))=0,"Other",
INDEX(List,MATCH(TRUE,ISNUMBER(SEARCH(List,A1)),0) ))

To **array-enter** a formula, after typing or pasting the formula into the
formula bar, confirm it by holding down <ctrl<shift while you hit <enter.
Excel will place braces {...} around the formula if you did it correctly.

List can be any size, so long as it is in a single column.
--ron


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
Enter text and formula in a cell Carter68 Excel Worksheet Functions 7 January 27th 09 03:41 PM
Enter text in a cell to return a text value in same cell Danno 24/7[_2_] Excel Discussion (Misc queries) 6 May 9th 08 06:26 AM
What is the Chr() code for Alt+Enter in a cell when entering text? Dennis Excel Discussion (Misc queries) 2 July 20th 06 11:49 PM
in cell allow to enter only text and number refrenced from other c Rozeta Excel Discussion (Misc queries) 1 April 17th 05 05:39 PM
Replace ALT+ENTER from multiple text cell Johnd Excel Discussion (Misc queries) 1 February 11th 05 10:57 AM


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