SUMPRODUCT with multiple OR where looking at 3 columns to then sum another column

PTHops

New Member
Joined
May 18, 2016
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I have the following formula that is just not working with the ORs

=SUMPRODUCT((SSPPI!P2:P23<>"Correct")*OR(SSPPI!P2:P23<>"Correct")*OR(SSPPI!P2:P23<>"Correct")*(SSPPI!I2:I23))

I have the following worksheet with a summary sheet where I am entering the formula.

1712940919380.png

I want to find the total from Column I if either Columns P, S or V are "Incorrect". I do not want to include values if P, S, or V are "Correct". Basically, exclude any value that is associated with a Completed action.

My existing formula is not totaling correctly. On my example, the total should be $2000 as that is the only one of the 3 columns that is still marked as Incomplete. Instead, I am getting $32,000 which is the total of Rows 2, 3 and 4 (indicating that the OR is not working for Columns S and V.

Any advice is most welcome. Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
ARe the first three expressions part of an OR statement?
if so, try this (but I don't think it will give you a good result)
but all three of those expressions look to be identical. Are the only possible values "Correct", "Incorrect", or blank?
Excel Formula:
SUMPRODUCT(
((SSPPI!P2:P23<>"Correct")+(SSPPI!S2:S23<>"Correct")+(SSPPI!V2:V23<>"Correct"))*
(SSPPI!I2:I23)
)
 
Upvote 0
Is the following what you require?
Please review the formula. If it is correct, edit the ranges for your data.
The alternatives are all very similar; the syntax is just a little different.
You can copy the post to a clean sheet and review the formulas with Evaluate Formula.

Book1
DIPQRSTUV
1
23220CorrectCorrectIncorrect
33212IncorrectCorrectIncorrect
432100CorrectCorrectCorrect
5
Sheet1
Cell Formulas
RangeFormula
D2D2=SUMPRODUCT(--((P2:P4<>"Correct")+(S2:S4<>"Correct")+(V2:V4<>"Correct")>0),(I2:I4))
D3D3=SUMPRODUCT(--((P2:P4<>"Correct")+(S2:S4<>"Correct")+(V2:V4<>"Correct")>0)*(I2:I4))
D4D4=SUM(((P2:P4<>"Correct")+(S2:S4<>"Correct")+(V2:V4<>"Correct")>0)*(I2:I4))
 
Upvote 0
If I understand it correctly, you want to sum it if
• None of the 3 columns contain "Correct"
• At least 1 column contains "Incorrect"
Just using <> "Correct" means blanks are included.

I am sure someone can make it shorter but does this do what you are after.

20240413 SumProduct Or but Exclude Blank PTHops.xlsx
FGHIOPQRSTUV
1
2Formula -->5010IncorrectIncorrectIncorrect
3200IncorrectCorrectIncorrect
435IncorrectIncorrectCorrect
540Incorrect
6500
760Correct
890IncorrectCorrect
9
SSPPI
Cell Formulas
RangeFormula
G2G2=SUMPRODUCT( --( ( (P2:P23="Correct") + (S2:S23="Correct") + (V2:V23="Correct") ) = 0 ) *--( ( (P2:P23="Incorrect") + (S2:S23="Incorrect") + (V2:V23="Incorrect") ) > 0 ) *(I2:I23))


If the formula really is on another sheet then it would looks like this:
Excel Formula:
=SUMPRODUCT(
                                    --( ( (SSPPI!P2:P23="Correct") + (SSPPI!S2:S23="Correct") + (SSPPI!V2:V23="Correct") ) = 0 )
                                 *--( ( (SSPPI!P2:P23="Incorrect") + (SSPPI!S2:S23="Incorrect") + (SSPPI!V2:V23="Incorrect") ) > 0 )
                                 *(SSPPI!I2:I23))
 
Upvote 0
If I understand it correctly, you want to sum it if
• None of the 3 columns contain "Correct"
• At least 1 column contains "Incorrect"
Just using <> "Correct" means blanks are included.

I am sure someone can make it shorter but does this do what you are after.

20240413 SumProduct Or but Exclude Blank PTHops.xlsx
FGHIOPQRSTUV
1
2Formula -->5010IncorrectIncorrectIncorrect
3200IncorrectCorrectIncorrect
435IncorrectIncorrectCorrect
540Incorrect
6500
760Correct
890IncorrectCorrect
9
SSPPI
Cell Formulas
RangeFormula
G2G2=SUMPRODUCT( --( ( (P2:P23="Correct") + (S2:S23="Correct") + (V2:V23="Correct") ) = 0 ) *--( ( (P2:P23="Incorrect") + (S2:S23="Incorrect") + (V2:V23="Incorrect") ) > 0 ) *(I2:I23))


If the formula really is on another sheet then it would looks like this:
Excel Formula:
=SUMPRODUCT(
                                    --( ( (SSPPI!P2:P23="Correct") + (SSPPI!S2:S23="Correct") + (SSPPI!V2:V23="Correct") ) = 0 )
                                 *--( ( (SSPPI!P2:P23="Incorrect") + (SSPPI!S2:S23="Incorrect") + (SSPPI!V2:V23="Incorrect") ) > 0 )
                                 *(SSPPI!I2:I23))
This works perfectly!! Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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
Back
Top