LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bobadigilatis
 
Posts: n/a
Default isolating a string containing a % symbol

i am trying to extract a percentage from a longer string of data, till now i
have been using the following formula:

Data within Cell A3: bunnies 12/18 40% 22.7 ABCD
=MID(A3,(FIND("%",A3)-2),FIND("%",A3,3)-(FIND("%",A3)-3))

This formula will return the value 40%.

My problem is i am now using percentages with decimals, eg: 40.2%, the above
formula returns:

Data within Cell A3: bunnies 12/18 40.2% 22.7 ABCD
=MID(A3,(FIND("%",A3)-2),FIND("%",A3,3)-(FIND("%",A3)-3))
..2% is returned.

Unfortunatly the number of digits the percentage value contains is not fixed
(which is what my last formula was based upon) eg: the values 40% 40.1% or
42.52% may appear, not 40.00% or 40.10%

Only one % symbol will appear wihin the string, the percentage value will
always be directly preceded by the % cymbol (i.e. no space between the number
and the symbol), if the percentage is to be a decimal it will only be a
maximum of two decimal places. There will always be a space between the
unwanted data and the first number of the percentage. The 'decimal point' (.)
is not unique to the percentage value within the string

E.g.

12. bunnies 42% abc
1.3 bunnies 42.25% 123
12 ele.-cats 41.3% juka 15


 
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
Need to do a fancy string copy plus Sally Excel Discussion (Misc queries) 7 November 4th 05 02:06 PM
Looking up a string of text within a string of text tobriant Excel Worksheet Functions 4 September 20th 05 06:59 PM
Auto convert an alphanumeric string (CIS9638S) to numbers only? Gary L Brown Excel Worksheet Functions 1 September 7th 05 01:17 AM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
How do I use 3 cells to create the string for a lookup function? Bencomo Excel Worksheet Functions 1 May 15th 05 07:17 AM


All times are GMT +1. The time now is 11:36 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"