I am grabbing web query data to a sheet, but it comes in the form
212 p
954 p
25.25 p
555.00 p
etc.
How can I automate the removal of the non numeric data?If your data always start with the number and there is no chance there
will be a second number in the string, then the following *array*
formula will extract the number in another column:
=VALUE(LEFT(A2,MAX(ROW(1:100)*ISNUMBER(VALUE(LEFT( A2,ROW(1:100)))))))
Array formulas must be committed with Shift Ctrl Enter.
HTH
Kostis VezeridesIf you only need to remove the right side of the cell contents, beginning
with the space, try this:
Select your range
lt;Editgt;lt;Replacegt;
Find what: * (note: that is a space and an asterisk)
Replace with: (leave this blank)
Click the [Replace All] button
Does that help?
***********
Regards,
Ron
XL2002, WinXP-Proquot;emeraldquot; wrote:
gt; I am grabbing web query data to a sheet, but it comes in the form
gt; 212 p
gt; 954 p
gt; 25.25 p
gt; 555.00 p
gt; etc.
gt;
gt; How can I automate the removal of the non numeric data?
gt;
gt;
Kostis
I get quot;A value used in the formula is of the wrong data type.quot;
Ron
lt;lt;Does that help?
Not really - it misses the 'Automatically' bit :-)What can I say... This formula will produce #VALUE! only if the cell is
empty or does not start with a number. Are you sure you are using it
properly? In my formula, replace A2 with whatever cell reference
contains the number/text (2 replacements).
If you are guaranteed that there will be a space after the number, you
can try this simpler formula instead:
=LEFT(A2, FIND(quot; quot;,A2)-1)
This formula will also produce #VALUE! if no space is found in the text
or in any of the above conditions. This one is NOT an array formula
(simply press Enter). If used properly, the first version is more
powerful (allows for no space).
Does this help?
Kostismacrof of Ron's solution:
Range(quot;D14quot;).Replace What:=quot; *quot;, Replacement:=quot; quot;, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Just change range
quot;emeraldquot; wrote:
gt; Kostis
gt; I get quot;A value used in the formula is of the wrong data type.quot;
gt;
gt; Ron
gt; lt;lt;Does that help?
gt; Not really - it misses the 'Automatically' bit :-)
gt;
gt;
How much more automatic can you expect? It takes about 5 seconds to do an
entire list this way. There are no formulas, no copying and pasting values.
Find and Replace is usually the desired way to go, if you can do it.
Data text to columns will also take apart the cells. Just make sure there
is nothing to the right of the cells, and then select Data-gt;Text to columns.
Then select delimited and choose quot;spacequot; as your delimiter. After it's done,
just delete all the columns except the first one. If you paste as text after
you have done this once on an open document, it will split the cells
automatically. You still have to delete the cells containing text though.
quot;emeraldquot; wrote:
gt; Kostis
gt; I get quot;A value used in the formula is of the wrong data type.quot;
gt;
gt; Ron
gt; lt;lt;Does that help?
gt; Not really - it misses the 'Automatically' bit :-)
gt;
gt;
- Nov 21 Wed 2007 20:40
Removing Non-Numeric Characters
close
全站熱搜
留言列表
發表留言