Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Invalid characters in cells

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Invalid characters in cells

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
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
Checking for Invalid filename characters John Keith[_2_] Excel Programming 2 May 8th 07 08:31 PM
Preventing Invalid Characters using data Validation NLiles Excel Programming 3 April 30th 07 08:25 PM
Invalid Characters in Worksheet Name (International) Drew Lettington Excel Programming 18 October 11th 06 09:31 PM
List of invalid sheet tab characters? quartz[_2_] Excel Programming 1 December 5th 05 05:10 PM
Invalid characters in Excel Andy Excel Programming 3 December 4th 03 04:34 PM


All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"