View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
UT UT is offline
external usenet poster
 
Posts: 39
Default Unable to add numbers from another sheet

You are right. The numbers are inserted as strings. Many thanks for the tip.

"Dave Peterson" wrote:

Maybe your data that looks like numbers aren't really numbers.

If you put
=count(d7:d238)
what do you see?

This should count all the entries that are numeric.

If you see 0 with this formula, then maybe your data has extra stuff in the
cell.

Depending on what it is, there are different ways of cleaning this up.

David McRitchie has a macro:
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
(look for "Sub Trimall()")

And if you're new to macros, you may want to read David's intro:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

===
If that doesn't clean up all the data, you can use Chip Pearson's CellView Addin
to find out what's really in the cells:

http://www.cpearson.com/excel/CellView.aspx


UT wrote:

"SUMIF" seems to be obvious choice but it shows a value of 0. Does it matter
that I am trying to add numbers imported from a database?

Thanks!!

"Joel" wrote:

Why are you using sumproduct? SumIF should work

"=SUMIF(Sheet1!B7:B238,"ABC",Sheet1!D7:D238)"

"UT" wrote:

I have a sheet that imports data from a database. In another sheet I want to
add the numbers in a column B if the string in column Is "ABC".

I have tried different functions such as
"=SUMPRODUCT(--(Sheet1!B7:B238="ABC")*Sheet2!D7:D238)" AND
"=SUMIF(Sheet1!B7:B238,"ABC",Sheet1!D7:D238)"

Nothing seems to work. Any suggestion will be a great help. I am on deadline
here.

Thanks.


--

Dave Peterson