Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to determine if a cell has a text string with a specific format.
Example: SO#8058416, PO#LW10179863 Rev2.a I need to determine if the cell has a string with the format AlphaApha followed immediately by 8 digits. In the example this would find the LW10179863. Thanks for any help you can provide. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Wed, 16 Apr 2008 12:57:01 -0700, KCK wrote:
I am trying to determine if a cell has a text string with a specific format. Example: SO#8058416, PO#LW10179863 Rev2.a I need to determine if the cell has a string with the format AlphaApha followed immediately by 8 digits. In the example this would find the LW10179863. Thanks for any help you can provide. Fairly simple with a UDF. So long as your strings will never be longer than 255 characters, I would recommend you download and install Longre's free morefunc.xll add-in from http://xcell05.free.fr/morefunc/english/ Then use this "regular expression" formula: =REGEX.MID(A1,"[A-Za-z]{2}\d{8}") The Pattern in the function does the extraction: ---------------------------- Extract 2 leters followed by 8 digits [A-Za-z]{2}\d{8} Match a single character present in the list below «[A-Za-z]{2}» Exactly 2 times «{2}» A character in the range between “A” and “Z” «A-Z» or A character in the range between “a” and “z” «a-z» Match a single digit 0..9 «\d{8}» Exactly 8 times «{8}» -------------------------------------- --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
extact text string from specific cell except three last characters | Excel Worksheet Functions | |||
Find specific value in a string | Excel Discussion (Misc queries) | |||
Fing a specific string in a Cell | Excel Discussion (Misc queries) | |||
can you find specific text in a string ignoring any other text | Excel Discussion (Misc queries) | |||
How to make a cell return the formatted value in a text string (i. | Excel Worksheet Functions |