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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|