Advanced SUMPRODUCT

Gabriel222

New Member
Joined
Oct 24, 2008
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello everyone !

I have an issue with the following and I was wondering whether anyone knows the solution ?

Goal : to recreate the below value of 3 in cell C6 using only formulas (no VBA or PowerQuery allowed),
the formula in C6 is saying how many Men with the QPV attribute from Sheet2 have "Values" between 5 and 7 (inclusive)
the value for a given person is the amount of "Noticed problem" and "No issues" that he or she has in sheet3

Constraints: the ONLY thing allowed is to add formulas in the cell C6, I cannot add to (or modify) in ANY way the other sheets, or the other cells of the current sheet

So far : I have managed to get the desired result, but I have had to create column D in sheet 2, which is forbidden.
I would love to calculate and evaluate the array in sheet 2 D2:D13 , directly within the formula in sheet 1 C6, but I can't find out how.

Thank you for your help !

Sheet1
Advanced Sumproduct ENG.xlsx
ABCD
1Values = "Noticed problem" + "Being resolved" by line
2IndicatorMen
3Totalof which QPV
4<2
52 to 4
65 to 73
78 +
Sheet1
Cell Formulas
RangeFormula
C6C6=SUMPRODUCT(--(Sheet2!$D$2:$D$13<=7)*(Sheet2!$D$2:$D$13>=5)*--(Sheet2!$B$2:$B$13="Male")*--(Sheet2!$C$2:$C$13="QPV"))


Sheet 2
Advanced Sumproduct ENG.xlsx
ABCD
1NameGenderZoneValues = "Noticed problem" + "Being resolved" by line
2AurélieFemaleQPV4
3ClaudeMaleVille7
4JeanMaleVille4
5JustineFemaleVille6
6LaurentMaleQPV6
7LucMaleQPV7
8MarieFemaleQPV3
9NicolasMaleVille5
10PaulMaleVille5
11PierreMaleVille8
12SofianeMaleQPV5
13ThéoMaleVille7
Sheet2
Cell Formulas
RangeFormula
D2:D13D2=SUMPRODUCT(--(Sheet3!2:2="Noticed problem")--(Sheet3!2:2="Being resolved"))


Sheet 3
Advanced Sumproduct ENG.xlsx
ABCDEFGHIJ
1NameFamily StatusJustice StatusLodging StatusEconomical StatusEmployed StatusAdmin StatusCity StatusKnowledge StatusOther Status
2AurélieNo issuesNoticed problemNo issuesNoticed problemNo issuesNoticed problemNo issuesNo issuesNoticed problem
3ClaudeNoticed problemNoticed problemBeing resolvedNoticed problemBeing resolvedNoticed problemBeing resolvedNo issuesNo issues
4JeanNo issuesBeing resolvedBeing resolvedNoticed problemNo issuesNo issuesNo issuesNo issuesBeing resolved
5JustineNo issuesNoticed problemNoticed problemNoticed problemNo issuesBeing resolvedBeing resolvedNo issuesNoticed problem
6LaurentNo issuesNo issuesBeing resolvedBeing resolvedNo issuesBeing resolvedBeing resolvedNoticed problemBeing resolved
7LucNoticed problemNoticed problemNoticed problemNoticed problemNo issuesBeing resolvedNo issuesNoticed problemBeing resolved
8MarieNo issuesNo issuesNo issuesNo issuesNoticed problemNo issuesNoticed problemBeing resolvedNo issues
9NicolasNoticed problemNoticed problemNo issuesNoticed problemBeing resolvedNo issuesNoticed problemNo issuesNo issues
10PaulBeing resolvedBeing resolvedNo issuesNo issuesBeing resolvedNoticed problemNo issuesNo issuesBeing resolved
11PierreNoticed problemNo issuesNoticed problemNoticed problemNoticed problemNoticed problemNoticed problemNoticed problemNoticed problem
12SofianeNo issuesNo issuesBeing resolvedNo issuesNo issuesBeing resolvedBeing resolvedNoticed problemBeing resolved
13ThéoBeing resolvedBeing resolvedNoticed problemNoticed problemNoticed problemNoticed problemNo issuesNo issuesBeing resolved
14Noticed problemNo issuesNo issuesNo issuesNo issuesNo issuesNo issuesNo issuesNo issues
Sheet3
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Thank you for your reply, I've updated my account details now.

I am on Windows and am using Excel 365, although this particular solution needs to work on Excel 2016.
 
Upvote 0
this particular solution needs to work on Excel 2016.
Ouch.
With 365 you could have used
Excel Formula:
=LET(f,FILTER(Sheet3!B2:J14,ISNUMBER(MATCH(Sheet3!A2:A14,FILTER(Sheet2!A2:A13,(Sheet2!B2:B13="Male")*(Sheet2!C2:C13="QPV")),0))),m,MMULT((f="noticed problem")+(f="being resolved"),SEQUENCE(COLUMNS(f),,,0)),SUM((m>=5)*(m<=7)))
I'll see if I can do-it without Let or Filter, but it won't be pretty & no guarantee it will work for 2016.
 
Upvote 0
Will the names on sheets 2 & 3 always be in the same order?
 
Upvote 0
Ok, in that case you could try
Excel Formula:
=SUMPRODUCT((MMULT((Sheet2!B2:B13="male")*(Sheet2!C2:C13="Qpv")*((Sheet3!B2:J13="noticed problem")+(Sheet3!B2:J13="being resolved")),TRANSPOSE(COLUMN(Sheet3!B2:J2)^0))>=5)*(MMULT((Sheet2!B2:B13="male")*(Sheet2!C2:C13="Qpv")*((Sheet3!B2:J13="noticed problem")+(Sheet3!B2:J13="being resolved")),TRANSPOSE(COLUMN(Sheet3!B2:J2)^0))<=7))
 
Upvote 0
Solution
Wow! Thank you so much Fluff !!
it works on my Excel 365

I am going to check now to see if it works on Excel 2016 (it most likely will, I don't see why it wouldn't)
and then I am going to try and understand the formula (I am mainly not accustomed to using MMULT)

Thanks a ton ! :)
 
Upvote 0
Another possibility:

Excel Formula:
=SUMPRODUCT(ISNUMBER(MATCH(MMULT((--ISNUMBER((MATCH(Sheet3!$B$2:$J$13,{"Being resolved","Noticed problem"},0)))),TRANSPOSE(COLUMN(INDIRECT("B:J")))^0),{5,6,7},0))*(Sheet2!$B$2:$B$13="Male")*(Sheet2!$C$2:$C$13="QPV"))

By the way, is this a contest or something where you have to be so constrained?
 
Upvote 0

Forum statistics

Threads
1,214,419
Messages
6,119,389
Members
448,891
Latest member
tpierce

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