Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 334
Default Sumproduct - Multiple Criteria

Hi,

I have the below formula, for a particular product add up sales in column M
for 3 criteria in column C then subtract another criteria from it. There are
several other codes in Column C I am trying to exclude but the formula seems
to add everything then subtract the other criteria.

How do I get the formula to only add up the required 3 not ALL of them
before subtracting the other.

Hope you can read the formula, I am using 2007. I have tried using as an
array but doesn't make any difference.

=SUMPRODUCT(('October NR Sales invoices 2'!$M$3:$M$104551)*--OR(('October NR
Sales invoices 2'!$C$3:$C$104551='October NR Sales invoices
2'!$C$104556),('October NR Sales invoices 2'!$C$3:$C$104551='October NR Sales
invoices 2'!$C$104561),('October NR Sales invoices 2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104562))*('October NR Sales invoices
2'!$K$3:$K$104551=$A3))-SUMPRODUCT(('October NR Sales invoices
2'!$M$3:$M$104551)*--('October NR Sales invoices 2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104565)*--('October NR Sales invoices
2'!$K$3:$K$104551=$A3))

Thanks
Rick
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Sumproduct - Multiple Criteria

Put the values of your "OR" criteria in a contiguous range of cells.

B1: ='sheetname'!C104556
B2: ='sheetname'!C104561
B3: ='sheetname'!C104562

Then:

=SUMPRODUCT(--(ISNUMBER(MATCH('sheetname'!C3:C104551,B1:B3,0))),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )-SUMPRODUCT(--('sheetname'!C3:C104551='sheetname'!C104565),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )



--
Biff
Microsoft Excel MVP


"Rick" wrote in message
...
Hi,

I have the below formula, for a particular product add up sales in column
M
for 3 criteria in column C then subtract another criteria from it. There
are
several other codes in Column C I am trying to exclude but the formula
seems
to add everything then subtract the other criteria.

How do I get the formula to only add up the required 3 not ALL of them
before subtracting the other.

Hope you can read the formula, I am using 2007. I have tried using as an
array but doesn't make any difference.

=SUMPRODUCT(('October NR Sales invoices 2'!$M$3:$M$104551)*--OR(('October
NR
Sales invoices 2'!$C$3:$C$104551='October NR Sales invoices
2'!$C$104556),('October NR Sales invoices 2'!$C$3:$C$104551='October NR
Sales
invoices 2'!$C$104561),('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104562))*('October NR Sales invoices
2'!$K$3:$K$104551=$A3))-SUMPRODUCT(('October NR Sales invoices
2'!$M$3:$M$104551)*--('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104565)*--('October NR Sales invoices
2'!$K$3:$K$104551=$A3))

Thanks
Rick



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 334
Default Sumproduct - Multiple Criteria

Thanks worked great.

"T. Valko" wrote:

Put the values of your "OR" criteria in a contiguous range of cells.

B1: ='sheetname'!C104556
B2: ='sheetname'!C104561
B3: ='sheetname'!C104562

Then:

=SUMPRODUCT(--(ISNUMBER(MATCH('sheetname'!C3:C104551,B1:B3,0))),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )-SUMPRODUCT(--('sheetname'!C3:C104551='sheetname'!C104565),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )



--
Biff
Microsoft Excel MVP


"Rick" wrote in message
...
Hi,

I have the below formula, for a particular product add up sales in column
M
for 3 criteria in column C then subtract another criteria from it. There
are
several other codes in Column C I am trying to exclude but the formula
seems
to add everything then subtract the other criteria.

How do I get the formula to only add up the required 3 not ALL of them
before subtracting the other.

Hope you can read the formula, I am using 2007. I have tried using as an
array but doesn't make any difference.

=SUMPRODUCT(('October NR Sales invoices 2'!$M$3:$M$104551)*--OR(('October
NR
Sales invoices 2'!$C$3:$C$104551='October NR Sales invoices
2'!$C$104556),('October NR Sales invoices 2'!$C$3:$C$104551='October NR
Sales
invoices 2'!$C$104561),('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104562))*('October NR Sales invoices
2'!$K$3:$K$104551=$A3))-SUMPRODUCT(('October NR Sales invoices
2'!$M$3:$M$104551)*--('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104565)*--('October NR Sales invoices
2'!$K$3:$K$104551=$A3))

Thanks
Rick




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Sumproduct - Multiple Criteria

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Rick" wrote in message
...
Thanks worked great.

"T. Valko" wrote:

Put the values of your "OR" criteria in a contiguous range of cells.

B1: ='sheetname'!C104556
B2: ='sheetname'!C104561
B3: ='sheetname'!C104562

Then:

=SUMPRODUCT(--(ISNUMBER(MATCH('sheetname'!C3:C104551,B1:B3,0))),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )-SUMPRODUCT(--('sheetname'!C3:C104551='sheetname'!C104565),--('sheetname'!K3:K104551=A3),'sheetname'!M3:M104551 )



--
Biff
Microsoft Excel MVP


"Rick" wrote in message
...
Hi,

I have the below formula, for a particular product add up sales in
column
M
for 3 criteria in column C then subtract another criteria from it.
There
are
several other codes in Column C I am trying to exclude but the formula
seems
to add everything then subtract the other criteria.

How do I get the formula to only add up the required 3 not ALL of them
before subtracting the other.

Hope you can read the formula, I am using 2007. I have tried using as
an
array but doesn't make any difference.

=SUMPRODUCT(('October NR Sales invoices
2'!$M$3:$M$104551)*--OR(('October
NR
Sales invoices 2'!$C$3:$C$104551='October NR Sales invoices
2'!$C$104556),('October NR Sales invoices 2'!$C$3:$C$104551='October NR
Sales
invoices 2'!$C$104561),('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104562))*('October NR Sales invoices
2'!$K$3:$K$104551=$A3))-SUMPRODUCT(('October NR Sales invoices
2'!$M$3:$M$104551)*--('October NR Sales invoices
2'!$C$3:$C$104551='October
NR Sales invoices 2'!$C$104565)*--('October NR Sales invoices
2'!$K$3:$K$104551=$A3))

Thanks
Rick






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
Sumproduct-multiple criteria = and not = Tasha Excel Worksheet Functions 4 September 22nd 08 10:10 PM
SUMPRODUCT / SUMIF on Multiple Worksheets with Multiple Criteria kazoo Excel Discussion (Misc queries) 2 August 21st 08 06:22 PM
HELP...SUMPRODUCT with multiple criteria Cita Excel Discussion (Misc queries) 0 July 14th 08 07:03 PM
Sumproduct multiple criteria Scott Kieta[_2_] Excel Worksheet Functions 6 May 29th 08 08:44 PM
sumproduct using multiple criteria tifosi3 Excel Worksheet Functions 2 January 6th 05 08:46 PM


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