Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to extract only the valid values from a cell and remove all the
invalid values, like * / # etc. For example, in cell A1, the value is *8930**/*. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
As long as the numbers are in a single block then this should work =LOOKUP(10^23,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW($1:$10000)))) Mike "Francis Ang" wrote: I am trying to extract only the valid values from a cell and remove all the invalid values, like * / # etc. For example, in cell A1, the value is *8930**/*. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
=SUBSTITUTE(A1,CHAR(160),"") -- __________________________________ HTH Bob "Francis Ang" wrote in message ... I am trying to extract only the valid values from a cell and remove all the invalid values, like ? / # etc. For example, in cell A1, the value is ?8930??/?. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the quick response Mike. I'll have a go with your suggestion.
Thanks again. "Mike H" wrote: Hi, As long as the numbers are in a single block then this should work =LOOKUP(10^23,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW($1:$10000)))) Mike "Francis Ang" wrote: I am trying to extract only the valid values from a cell and remove all the invalid values, like * / # etc. For example, in cell A1, the value is *8930**/*. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks you for the quick response, Bob.
Thank you very much. "Bob Phillips" wrote: Try =SUBSTITUTE(A1,CHAR(160),"") -- __________________________________ HTH Bob "Francis Ang" wrote in message ... I am trying to extract only the valid values from a cell and remove all the invalid values, like ? / # etc. For example, in cell A1, the value is ?8930??/?. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If your "invalid characters" **always** follow the number (that is, you have
a number and then non-digits following it), then you can just use the Val function... TextValue = "8930/#dfs" NumberOnly = Val(TextValue) If your numbers can have decimal points in them, then the above Val suggestion will only work if your regional setting for the decimal point is a "dot" character. -- Rick (MVP - Excel) "Francis Ang" wrote in message ... I am trying to extract only the valid values from a cell and remove all the invalid values, like * / # etc. For example, in cell A1, the value is *8930**/*. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the tip, Rick.
"Francis Ang" wrote: I am trying to extract only the valid values from a cell and remove all the invalid values, like * / # etc. For example, in cell A1, the value is *8930**/*. The length of the value is variable and the placement of the invalid values are not fixed. How do I extract only 8930? I have tried, TRIM, LTRIM, RTRIM functions but it does not work! Any help would be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking for Invalid filename characters | Excel Programming | |||
Preventing Invalid Characters using data Validation | Excel Programming | |||
Invalid Characters in Worksheet Name (International) | Excel Programming | |||
List of invalid sheet tab characters? | Excel Programming | |||
Invalid characters in Excel | Excel Programming |