#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Cell Formula

I need an Excel 2003 formula: If the first cell contains the letter Y then a
second cell will display a name contained in a third cell - The second cell
needs the formula.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Cell Formula

"Mike H" wrote:
I need an Excel 2003 formula: If the first cell contains
the letter Y then a second cell will display a name
contained in a third cell - The second cell needs the
formula.


If "Y" will be the entire cell value, then in the second cell (A1 and A3
represent the first and third cells):

=if(A1="Y", C1, "")

Note that this returns the null string ("") if A1 does not contain "Y", a
condition you neglected to cover.

If "Y" will always be the first character of the cell, then:

=if(left(A1,1)="Y", C1, "")

If "Y" might be anywhere within the cell, and you want to recognize "y"
(lowercase) as well, then:

=if(isnumber(search("y",A1)), C1, "")

If you want to recognize only "Y" (uppercase), change SEARCH to FIND, and
change "y" to "Y". But note that the other two formulas recognize match "y"
and "Y". See the EXACT function if you need to distinguish between them.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Cell Formula

=if(isnumber(search("y",A1)),A3,"No Y")
=search() is not case sensitive (Y and y will both be ok).

If you need to match case, use =find() instead of =search().

Another non-case sensitive way:
=if(countif(a1,"*y*")0,A3,"No Y")

I'm checking A1 and using the name in A3. My formula was in A2.

Mike H wrote:

I need an Excel 2003 formula: If the first cell contains the letter Y then a
second cell will display a name contained in a third cell - The second cell
needs the formula.


--

Dave Peterson
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 can I make a blank cell in a formula cell with a range of cell Vi Excel Discussion (Misc queries) 5 June 21st 07 02:46 PM
adding a formula in a cell but when cell = 0 cell is blank Mike T Excel Worksheet Functions 5 May 31st 05 01:08 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


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