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

In one column I have a text contaning numbers and letters e.g.:
10S1
143W1
1A9
etc.
I want a second column containing only the first letter of these text. This
letter can be found anywhere between the 1st and 5th position in the cell and
can be any capital letter.

Can anyone help me with this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Find the first letter in a cell

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"


=MID(A1,COUNT(1*MID(A1,ROW($1:$9),1)),1)

If this post helps click Yes
---------------
Jacob Skaria


"Corne" wrote:

In one column I have a text contaning numbers and letters e.g.:
10S1
143W1
1A9
etc.
I want a second column containing only the first letter of these text. This
letter can be found anywhere between the 1st and 5th position in the cell and
can be any capital letter.

Can anyone help me with this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 118
Default Find the first letter in a cell

Corne, Jacob's Soln above is the best but here is one that doesn't need to be
entered as an array. You can also drag it down/copy it to any other cell.

=IF(ISERROR(VALUE(MID(A1,1,1))),MID(A1,1,1),IF(ISE RROR(VALUE(MID(A1,2,1))),MID(A1,2,1),IF(ISERROR(VA LUE(MID(A1,3,1))),MID(A1,3,1),IF(ISERROR(VALUE(MID (A1,4,1))),

--
If this helps, please click "Yes"
<<<<<<<<<<<


"Corne" wrote:

In one column I have a text contaning numbers and letters e.g.:
10S1
143W1
1A9
etc.
I want a second column containing only the first letter of these text. This
letter can be found anywhere between the 1st and 5th position in the cell and
can be any capital letter.

Can anyone help me with this?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Find the first letter in a cell

This will return the first non-numeric character (not always a letter) in A1:

=MID(A1,MATCH(FALSE,
ISNUMBER(-MID(A1&"-",ROW(INDIRECT("1:"&LEN(A1&"-"))),1)),0),1)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

The extra "-" is just in case the cell contains nothing but digits.




Corne wrote:

In one column I have a text contaning numbers and letters e.g.:
10S1
143W1
1A9
etc.
I want a second column containing only the first letter of these text. This
letter can be found anywhere between the 1st and 5th position in the cell and
can be any capital letter.

Can anyone help me with this?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Find the first letter in a cell

On Mon, 26 Oct 2009 07:44:01 -0700, Corne
wrote:

In one column I have a text contaning numbers and letters e.g.:
10S1
143W1
1A9
etc.
I want a second column containing only the first letter of these text. This
letter can be found anywhere between the 1st and 5th position in the cell and
can be any capital letter.

Can anyone help me with this?


This will return the first capital letter in the string, provided it occurs, as
you write, in the first five characters:

=MID(A1,MATCH(1,(CODE(MID(A1,{1,2,3,4,5},1))=65)* (CODE(MID(A1,{1,2,3,4,5},1))<=90),0),1)

--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Find the first letter in a cell

On Mon, 26 Oct 2009 07:51:01 -0700, Jacob Skaria
wrote:

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"


=MID(A1,COUNT(1*MID(A1,ROW($1:$9),1)),1)

If this post helps click Yes
---------------
Jacob Skaria


This seems to fail with certain combinations:

10S11
A143
1A99

--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
Find cell containing a letter Jon Hebert Excel Discussion (Misc queries) 6 July 24th 09 04:43 PM
Find column letter of the first unused cell John Excel Worksheet Functions 2 May 10th 09 09:06 PM
FIND LETTER IN CELL (cond. form mult entries not wrking) Nastech Excel Discussion (Misc queries) 14 October 17th 08 06:42 AM
find column letter Stuart WJG[_2_] Excel Discussion (Misc queries) 13 August 29th 08 11:27 PM
How do I find a cell starting with a specific letter? Bking Excel Discussion (Misc queries) 5 July 18th 05 05:14 AM


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