SUMPRODUCT use

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142
I think this is an incorrect use of sumproduct but im trying to total a column (QAMT) pulling the result to relevant column headings (B2,B3, etc Months of the years) based on whether the month are in any of four possible columns (QUART1,QUART2, etc) and there is a match in a property number column as well (QPROP) on a spearate table.



=SUMPRODUCT((QAMT),(OR(QUART1=B2,QUART2=B2,QUART3=B2,QUART4=B2))*(QPROP=A6))


I am assuming that SUMPRODUCT doesnt like my use of OR? How do I get around this?

Thanks in advance
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142
After some googling Ive seen how SUMPRODUCT users ORs so adapted my formula but still with no luck:

=SUMPRODUCT((QAMT),(QUART1=B2)+(QUART2=B2)+(QUART3=B2)+(QUART4=B2)*(QPROP=A6))
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
After some googling Ive seen how SUMPRODUCT users ORs so adapted my formula but still with no luck:

=SUMPRODUCT((QAMT),(QUART1=B2)+(QUART2=B2)+(QUART3=B2)+(QUART4=B2)*(QPROP=A6))

Does this...

Rich (BB code):
=SUMPRODUCT(
   QAMT,
   --((QUART1=B2)+(QUART2=B2)+(QUART3=B2)+(QUART4=B2))>0),
   --(QPROP=A6))
help?
 

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142
Unfortunately not. When I copy and paste straight from your post excel says theres an error and trys to correc tit.

What should I try?

Thanks for your help
 

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142

ADVERTISEMENT

If it helps:

QUART1,QUART2, etc will NEVER have the same infornmation as eachother on the same row


I have checked my named ranges are all the same size and cover the same row numbers
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Unfortunately not. When I copy and paste straight from your post excel says theres an error and trys to correc tit.

What should I try?

Thanks for your help

Oops... I meant:
Rich (BB code):
=SUMPRODUCT(
  QAMT,
  --((QUART1=B2)+(QUART2=B2)+(QUART3=B2)+(QUART4=B2)>0),
  --(QPROP=A6))
 

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142

ADVERTISEMENT

Still just getting #N/A error?
 

crocco

Board Regular
Joined
Jan 28, 2010
Messages
142
398 for all of them. I checked the ranges were definitely the same size already.

thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,610
Members
414,080
Latest member
penguin23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top