ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unable to add numbers from another sheet (https://www.excelbanter.com/excel-discussion-misc-queries/170271-unable-add-numbers-another-sheet.html)

UT

Unable to add numbers from another sheet
 
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.

joel

Unable to add numbers from another sheet
 
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.


T. Valko

Unable to add numbers from another sheet
 
Look for unseen characters like leading/trailing spaces in the ranges. The
numbers in column D may be TEXT.

I see you're referencing 2 different sheets.

See if this works:

=SUMPRODUCT(--(TRIM(Sheet1!B7:B238)="abc"),Sheet2!D7:D238+0)

--
Biff
Microsoft Excel MVP


"UT" wrote in message
...
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.




UT

Unable to add numbers from another sheet
 
"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

Unable to add numbers from another sheet
 
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

UT

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



All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com