Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default 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.



  #4   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

"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.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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


  #6   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

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
Unable to see or show sheet 1 in excel blank flange New Users to Excel 0 February 21st 07 02:38 PM
Unable to see or show sheet 1 in excel john New Users to Excel 0 February 21st 07 02:32 PM
Unable to see or show sheet 1 in excel Mike New Users to Excel 0 February 21st 07 02:29 PM
Excel unable to sort any numbers Jeffry61 Excel Discussion (Misc queries) 1 May 19th 06 08:17 PM
am unable to view or use sheet tabs dazed and confused New Users to Excel 3 April 12th 05 12:29 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"