Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Ive been trying different ways all day to get this to work..thats how i
found this thread..nothing ive tried off of here so far has worked and
im sure its simple and the answer is here somewhere but my eyes are
starting to go the shape of my monitor..

The problem is...
i recieve data in email ...copy n paste to Excel ...try to SUM but
blahhh..

Snapshot of part of a column im trying to SUM

1.32 DR
1.34 DR
1.42 DR

0

i got the following formula off of one thread and it worked with data i
typed into cells manually but did not work with the data pasted from
email

=SUM(IF(ISNUMBER(--SUBSTITUTE(UPPER(A1:C1925),"V","")),
--SUBSTITUTE(UPPER(A1:C1925),"V","")))

ive tried copying clear cell.. special paste ..values /add...still no
good....

where to next???

Any thoughts greatly appreciated.

Regards Andy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

=SUM(IF(ISNUMBER(--LEFT(A1:A10,FIND(" ",A1:A10)-1)),--LEFT(A1:A10,FIND("
",A1:A10)-1)))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Andy" wrote in message
oups.com...
Ive been trying different ways all day to get this to work..thats how i
found this thread..nothing ive tried off of here so far has worked and
im sure its simple and the answer is here somewhere but my eyes are
starting to go the shape of my monitor..

The problem is...
i recieve data in email ...copy n paste to Excel ...try to SUM but
blahhh..

Snapshot of part of a column im trying to SUM

1.32 DR
1.34 DR
1.42 DR

0

i got the following formula off of one thread and it worked with data i
typed into cells manually but did not work with the data pasted from
email

=SUM(IF(ISNUMBER(--SUBSTITUTE(UPPER(A1:C1925),"V","")),
--SUBSTITUTE(UPPER(A1:C1925),"V","")))

ive tried copying clear cell.. special paste ..values /add...still no
good....

where to next???

Any thoughts greatly appreciated.

Regards Andy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Thanks Heaps Bob for your prompt reply ..but unfortunatly it didnt work

Regards Andy

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Hi Andy

With the data selected, try:

Edit | Replace | What: DR | With: (nothing)


---
Regards,
Norman



"Andy" wrote in message
oups.com...
Ive been trying different ways all day to get this to work..thats how i
found this thread..nothing ive tried off of here so far has worked and
im sure its simple and the answer is here somewhere but my eyes are
starting to go the shape of my monitor..

The problem is...
i recieve data in email ...copy n paste to Excel ...try to SUM but
blahhh..

Snapshot of part of a column im trying to SUM

1.32 DR
1.34 DR
1.42 DR

0

i got the following formula off of one thread and it worked with data i
typed into cells manually but did not work with the data pasted from
email

=SUM(IF(ISNUMBER(--SUBSTITUTE(UPPER(A1:C1925),"V","")),
--SUBSTITUTE(UPPER(A1:C1925),"V","")))

ive tried copying clear cell.. special paste ..values /add...still no
good....

where to next???

Any thoughts greatly appreciated.

Regards Andy



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Hi & Thanks Norman...

The DR disappears but it still wont SUM

Regards Andy



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Norman!!!!
Close...how can i delete the space between the numbers and the Text?

Andy

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Hi Andy

the following array formula works for me
(Array formulae must be entered or edited using Ctrl+Shift+Enter not
just Enter. Excel will insert the curly braces { }. Do not type them
yourself)
{=SUM(--SUBSTITUTE(A1:A3," DR",""))}
Note the space in front of DR within the quotes.

It works with or without the space for me in XL2003, but you may need
the space substituted as well in your version.

--
Regards

Roger Govier


"Andy" wrote in message
oups.com...
Norman!!!!
Close...how can i delete the space between the numbers and the Text?

Andy



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Hi Roger,

Tried it =SUM(--SUBSTITUTE(A1:A3," DR","")) but nope... got
#value!

tried to modify what you said to...
=SUM(SUBSTITUTE(H22:H24,H22:H24,"")) and got a 0 . I think the
problem is that space between the numbers and text

Thanks anyhow
Andy

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

On 29 Jan 2006 03:59:43 -0800, "Andy" wrote:

Ive been trying different ways all day to get this to work..thats how i
found this thread..nothing ive tried off of here so far has worked and
im sure its simple and the answer is here somewhere but my eyes are
starting to go the shape of my monitor..

The problem is...
i recieve data in email ...copy n paste to Excel ...try to SUM but
blahhh..

Snapshot of part of a column im trying to SUM

1.32 DR
1.34 DR
1.42 DR

0


Try this:

This assumes your format is as above -- a number followed by <space and then
non-numeric characters:

The **array formula**

=SUM(IF(ISERR(-LEFT(rng,FIND(" ",A1)-1)),0,--LEFT(rng,FIND(" ",A1)-1)))

To enter an array formula, hold down <ctrl<shift while hitting <enter.
Excel will place braces {...} around the formula.

If your formats can be more complicated, other solutions are available.

If the above doesn't work on the data from your email that you have pasted into
Excel, then there is likely some non-printing characters within the string. If
that is the case, you could either figure out exactly what they are by using
the CODE function, or you could download and install Longre's free morefunc.xll
add-in from http://xcell05.free.fr/

and use this regular expression **array** formula:

=SUM(IF(ISERR(-REGEX.MID(rng,"\d*\.?\d+")),
0,--REGEX.MID(rng,"\d*\.?\d+")))

This should pull out the first number in the string, and ignore non-printing
characters.


--ron
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Thanks Ron,
Assuming that my data is in cells H22:H24 i would enter as follows....

=SUM(IF(ISERR(-LEFT(rng,FIND(" ",A1)-1)),0,--LEFT(rng,FIND(" ",A1)-1)))
becomes
=SUM(IF(ISERR(-LEFT(H22:H24,FIND(" ",A1)-1)),0,--LEFT(H22:H24,FIND("
",A1)-1)))

Is this correct?... if so no good ...and i must try the other option.

Regards Andy



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

On 29 Jan 2006 06:16:40 -0800, "Andy" wrote:

Thanks Ron,
Assuming that my data is in cells H22:H24 i would enter as follows....

=SUM(IF(ISERR(-LEFT(rng,FIND(" ",A1)-1)),0,--LEFT(rng,FIND(" ",A1)-1)))
becomes
=SUM(IF(ISERR(-LEFT(H22:H24,FIND(" ",A1)-1)),0,--LEFT(H22:H24,FIND("
",A1)-1)))

Is this correct?... if so no good ...and i must try the other option.

Regards Andy


What you did with the first formula is correct: Substituting H22:H24 for rng.

An alternate option would be to NAME (Insert/Name/Define) the range H22:H24 as
rng.

What kind of result do you get?

My suspicion, as I mentioned, is that either you have a non-printing character
in the string, or perhaps what looks like a <space is really something
different.

But the regular expression should sort that out as it is set up to only pick
out digits and the optional dot.
--ron
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

Hi Ron,
Thanks again,
....i got a 0 when i tried the last one....

But Bob Phillips has solved it for me with this...

=SUM(IF(ISNUMBER(--LEFT(B1:B10,FIND(CHAR(160),B1:B10)-1)),
--LEFT(B1:B10,FIND(CHAR(160),B1:B10)-1)))

Thanks heaps for all your help
Regards Andy

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How do i SUM data in Excel ex:email that contains "Numbers and Text"???

On 29 Jan 2006 15:03:20 -0800, "Andy" wrote:

Hi Ron,
Thanks again,
...i got a 0 when i tried the last one....

But Bob Phillips has solved it for me with this...

=SUM(IF(ISNUMBER(--LEFT(B1:B10,FIND(CHAR(160),B1:B10)-1)),
--LEFT(B1:B10,FIND(CHAR(160),B1:B10)-1)))

Thanks heaps for all your help
Regards Andy


I'm glad you got it working, although the one I supplied, if properly
implemented, will work whether the space is a normal space, or a no-break space
(char(160))


--ron
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
How can I convert numbers (ex. "4") to text (ex. "four") Help! Excel Discussion (Misc queries) 4 January 21st 08 09:36 PM
Excel 2007 - Email as "Body Text" Alistair Excel Discussion (Misc queries) 4 May 16th 07 05:59 PM
Formating numbers &"Text" to appear as currency &"Text" in formula Robin K. Excel Discussion (Misc queries) 6 May 7th 07 02:03 PM


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