Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default DBSUM function but with function as criterion, not a range

Let me try to give a simple example of what I want:
I have two worksheets: "WorkSheet1" and "WorkSheet2". WorkSheet1 contains a
column with as column header "IDNr.".
WorkSheet2 contains 2 columns: "IDNr." and "Amount". The IDNr refers to the
IDNr. on WorkSheet1 and the Amount column is used to add an amount.
On WorkSheet1 I want to add a second column, in which all Amounts from
WorkSheet2 are summed which have the same IDNr. as the specific row in
WorkSheet1. So:

WorkSheet1
IDNr. - Totals
1 - 11 (5+4+2)
2 - 8 (3+5)

WorkSheet2:
IDNr. - Amount
1 - 5
2 - 3
1 - 4
1 - 2
2 - 5

I tried to use DMSUM('WorkSheet2'!A1:B5;2;A1:A2) on WorkSheet1. This works
fine for B2, but when I want to do B3: I get the following:
DMSUM('WorkSheet2'!A1:B5;2;A1:A3), which gives me the sum of all appearences
on WorkSheet2 having 1 or 2 as ID.

Can anybody help me out here?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default DBSUM function but with function as criterion, not a range

Using your posted example...

Try this on Sheet1:
A1: IDNr
A2: 1
A3: 2

B1: Amount
B2: =SUMIF(Sheet2!$A$1:$A$10,Sheet1!A2,Sheet2!$B$1:$B$ 10)
(Copy that formula down through B3)

With your sample data
B2 returns 11
B3 returns 8

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"corne_mo" wrote:

Let me try to give a simple example of what I want:
I have two worksheets: "WorkSheet1" and "WorkSheet2". WorkSheet1 contains a
column with as column header "IDNr.".
WorkSheet2 contains 2 columns: "IDNr." and "Amount". The IDNr refers to the
IDNr. on WorkSheet1 and the Amount column is used to add an amount.
On WorkSheet1 I want to add a second column, in which all Amounts from
WorkSheet2 are summed which have the same IDNr. as the specific row in
WorkSheet1. So:

WorkSheet1
IDNr. - Totals
1 - 11 (5+4+2)
2 - 8 (3+5)

WorkSheet2:
IDNr. - Amount
1 - 5
2 - 3
1 - 4
1 - 2
2 - 5

I tried to use DMSUM('WorkSheet2'!A1:B5;2;A1:A2) on WorkSheet1. This works
fine for B2, but when I want to do B3: I get the following:
DMSUM('WorkSheet2'!A1:B5;2;A1:A3), which gives me the sum of all appearences
on WorkSheet2 having 1 or 2 as ID.

Can anybody help me out here?

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default DBSUM function but with function as criterion, not a range

Thanks Ron,

I was so pinned to the DBSUM function that I coulnd't find an other function.

Thanks again. Works perfectly.
Cheers,
Corné

"Ron Coderre" wrote:

Using your posted example...

Try this on Sheet1:
A1: IDNr
A2: 1
A3: 2

B1: Amount
B2: =SUMIF(Sheet2!$A$1:$A$10,Sheet1!A2,Sheet2!$B$1:$B$ 10)
(Copy that formula down through B3)

With your sample data
B2 returns 11
B3 returns 8

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"corne_mo" wrote:

Let me try to give a simple example of what I want:
I have two worksheets: "WorkSheet1" and "WorkSheet2". WorkSheet1 contains a
column with as column header "IDNr.".
WorkSheet2 contains 2 columns: "IDNr." and "Amount". The IDNr refers to the
IDNr. on WorkSheet1 and the Amount column is used to add an amount.
On WorkSheet1 I want to add a second column, in which all Amounts from
WorkSheet2 are summed which have the same IDNr. as the specific row in
WorkSheet1. So:

WorkSheet1
IDNr. - Totals
1 - 11 (5+4+2)
2 - 8 (3+5)

WorkSheet2:
IDNr. - Amount
1 - 5
2 - 3
1 - 4
1 - 2
2 - 5

I tried to use DMSUM('WorkSheet2'!A1:B5;2;A1:A2) on WorkSheet1. This works
fine for B2, but when I want to do B3: I get the following:
DMSUM('WorkSheet2'!A1:B5;2;A1:A3), which gives me the sum of all appearences
on WorkSheet2 having 1 or 2 as ID.

Can anybody help me out here?

Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default DBSUM function but with function as criterion, not a range

Thanks for the feedback....I'm glad that worked for you.


***********
Regards,
Ron

XL2002, WinXP


"corne_mo" wrote:

Thanks Ron,

I was so pinned to the DBSUM function that I coulnd't find an other function.

Thanks again. Works perfectly.
Cheers,
Corné

"Ron Coderre" wrote:

Using your posted example...

Try this on Sheet1:
A1: IDNr
A2: 1
A3: 2

B1: Amount
B2: =SUMIF(Sheet2!$A$1:$A$10,Sheet1!A2,Sheet2!$B$1:$B$ 10)
(Copy that formula down through B3)

With your sample data
B2 returns 11
B3 returns 8

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"corne_mo" wrote:

Let me try to give a simple example of what I want:
I have two worksheets: "WorkSheet1" and "WorkSheet2". WorkSheet1 contains a
column with as column header "IDNr.".
WorkSheet2 contains 2 columns: "IDNr." and "Amount". The IDNr refers to the
IDNr. on WorkSheet1 and the Amount column is used to add an amount.
On WorkSheet1 I want to add a second column, in which all Amounts from
WorkSheet2 are summed which have the same IDNr. as the specific row in
WorkSheet1. So:

WorkSheet1
IDNr. - Totals
1 - 11 (5+4+2)
2 - 8 (3+5)

WorkSheet2:
IDNr. - Amount
1 - 5
2 - 3
1 - 4
1 - 2
2 - 5

I tried to use DMSUM('WorkSheet2'!A1:B5;2;A1:A2) on WorkSheet1. This works
fine for B2, but when I want to do B3: I get the following:
DMSUM('WorkSheet2'!A1:B5;2;A1:A3), which gives me the sum of all appearences
on WorkSheet2 having 1 or 2 as ID.

Can anybody help me out here?

Thanks in advance.

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
Multiple Criterion in a SUMIF function IPerlovsky Excel Worksheet Functions 6 March 9th 07 06:33 PM
Sum a range based on a criterion gerryboy458 Excel Worksheet Functions 3 January 20th 06 08:36 PM
Range function Manos Excel Worksheet Functions 1 October 3rd 05 10:54 AM
Multiple criterion including wildcards to sum in a range JEH Excel Worksheet Functions 6 June 12th 05 10:55 AM
How do I put more than one criterion in a SUMIF function? Bryan Brassell Excel Worksheet Functions 4 June 1st 05 11:51 AM


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