A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Finding a position in a Cell using a formula



 
 
Thread Tools Display Modes
  #11  
Old May 29th, 2009, 06:28 PM posted to microsoft.public.excel.misc
JLatham
external usenet poster
 
Posts: 1,896
Default Finding a position in a Cell using a formula

Another way of explaining that need is that by adding "0123456789" to the end
of the contents of A1 is that
#1 it guarantees some match (see David Biddulph's comment) and if it turns
out that the match is in that group, the position will be greater than the
length of the original string in A1 and so the test against LEN(A1) will
fail, telling the formula that there aren't any digits in the original string.

"jxbeeman" wrote:

What is the reason for the "0123456789" at the end -- A1&"0123456789"
Thanks,
Josh
"Jacob Skaria" wrote:

Another one to find the first position...

=MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789") )

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


"jxbeeman" wrote:

Hi,
I'm trying to find a certain data type in a cell and the position it is in.

For example I have a text cell with the following in it "SomePartName
12345 ".

How would i be able to find the first number position in this cell using a
formula?
How would i be able to find the last number position in this cell using a
formula?

The reason i'm looking for something like this is to be able to separate
strings of text which contain the parts name and then a number after it along
with spaces inbetween.

Thanks for the help.
Josh

  #12  
Old May 30th, 2009, 02:40 AM posted to microsoft.public.excel.misc
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Finding a position in a Cell using a formula

Hi Jacob,

Your formula will return a false match where the string has no number. Hence the extra testing in the version I posted.

--
Cheers
macropod
[Microsoft MVP - Word]


"Jacob Skaria" wrote in message ...
Another one to find the first position...

=MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789") )

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


"jxbeeman" wrote:

Hi,
I'm trying to find a certain data type in a cell and the position it is in.

For example I have a text cell with the following in it "SomePartName
12345 ".

How would i be able to find the first number position in this cell using a
formula?
How would i be able to find the last number position in this cell using a
formula?

The reason i'm looking for something like this is to be able to separate
strings of text which contain the parts name and then a number after it along
with spaces inbetween.

Thanks for the help.
Josh

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.