Help with SUMPRODUCT

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
719
Office Version
  1. 2010
Platform
  1. Windows
Hi:

Formula in B3 and B5 is not returning required value.
Could you help please?

Ana North & South rents.xlsm
ABCDEFG
106/01/23Required value
2Rent - Tax6.876.87
3Rent305.54298.67
4Water Reimbursement - Tax0.440.44
5Water Reimbursement20.4420.00
6Check Scan - Pete(1,911.43)(1,911.43)
7Electric Reimbursement10.0010.00
8Online Payment Fee 5/5/2023(225.00)(225.00)
9Non-Refundable Move In Fee (FP)0.000.00
10Online Administrative Fee0.000.00
11Online Application Fee0.000.00
12(1,793.14)
13
14
15DateDescriptionCost
1607/01/23Rent - Tax25.76
1707/01/23Rent1,120.00
1807/01/23Water Reimbursement - Tax1.65
1907/01/23Water Reimbursement75.00
2006/26/23Check Scan - Pete(678.72)
2106/23/23Check Scan - pete 6/26/2023(232.71)
2206/23/23Check Scan - Pete 6/26/2023(1,000.00)
2306/23/23Rent - Tax6.87
2406/23/23Rent298.67
2506/23/23Water Reimbursement - Tax0.44
2606/23/23Water Reimbursement20.00
2706/23/23Electric Reimbursement10.00
2806/23/23Online Payment Fee 5/5/2023(225.00)
2905/04/23Non-Refundable Move In Fee (FP)350.00
3005/04/23Online Administrative Fee150.00
3105/04/23Online Application Fee75.00
test
Cell Formulas
RangeFormula
B2:B11B2=SUMPRODUCT(--(ISNUMBER(SEARCH($A2,$F$16:$F$31))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31)
B12B12=SUM(B2:B11)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
As "rent" is a subset of "rent - tax", the values for "rent - tax" will be included in the SEARCH() for "rent". Try using MATCH() instead?

Book87
ABCDEFG
101-Jun-23Required value
2Rent - Tax6.876.87
3Rent298.67298.67
4Water Reimbursement - Tax0.440.44
5Water Reimbursement2020
6Check Scan - Pete-678.72-1911.43
7Electric Reimbursement1010
8Online Payment Fee 5/5/2023-225-225
9Non-Refundable Move In Fee (FP)00
10Online Administrative Fee00
11Online Application Fee00
12-567.74
13
14
15DateDescriptionCost
1601-Jul-23Rent - Tax25.76
1701-Jul-23Rent1120
1801-Jul-23Water Reimbursement - Tax1.65
1901-Jul-23Water Reimbursement75
2026-Jun-23Check Scan - Pete-678.72
2123-Jun-23Check Scan - pete 6/26/2023-232.71
2223-Jun-23Check Scan - Pete 6/26/2023-1000
2323-Jun-23Rent - Tax6.87
2423-Jun-23Rent298.67
2523-Jun-23Water Reimbursement - Tax0.44
2623-Jun-23Water Reimbursement20
2723-Jun-23Electric Reimbursement10
2823-Jun-23Online Payment Fee 5/5/2023-225
2904-May-23Non-Refundable Move In Fee (FP)350
3004-May-23Online Administrative Fee150
3104-May-23Online Application Fee75
Sheet1
Cell Formulas
RangeFormula
B2:B11B2=SUMPRODUCT(--(ISNUMBER(MATCH($F$16:$F$31,$A2,0))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31)
B12B12=SUM(B2:B11)


EDIT: Just noticed, I don't think this will work all that well given you have lookup values which are subsets of other lookup values, which you don't want to be included in your sum, but you also have lookup values which are subset of the column you are looking up, which you want to be included in your sum.
 
Last edited:
Upvote 0
Try this wall of text instead, I guess:

Book87
ABCDEFG
101-Jun-23Required value
2Rent - Tax6.876.87
3Rent298.67298.67
4Water Reimbursement - Tax0.440.44
5Water Reimbursement2020
6Check Scan - Pete-1911.43-1911.43
7Electric Reimbursement1010
8Online Payment Fee 5/5/2023-225-225
9Non-Refundable Move In Fee (FP)00
10Online Administrative Fee00
11Online Application Fee00
12-1800.45
13
14
15DateDescriptionCost
1601-Jul-23Rent - Tax25.76
1701-Jul-23Rent1120
1801-Jul-23Water Reimbursement - Tax1.65
1901-Jul-23Water Reimbursement75
2026-Jun-23Check Scan - Pete-678.72
2123-Jun-23Check Scan - pete 6/26/2023-232.71
2223-Jun-23Check Scan - Pete 6/26/2023-1000
2323-Jun-23Rent - Tax6.87
2423-Jun-23Rent298.67
2523-Jun-23Water Reimbursement - Tax0.44
2623-Jun-23Water Reimbursement20
2723-Jun-23Electric Reimbursement10
2823-Jun-23Online Payment Fee 5/5/2023-225
2904-May-23Non-Refundable Move In Fee (FP)350
3004-May-23Online Administrative Fee150
3104-May-23Online Application Fee75
Sheet1
Cell Formulas
RangeFormula
B2:B11B2=IF(OR(ISNUMBER(MATCH("*"&A2&"*",$A3:$A$12,0)),ISNUMBER(MATCH("*"&A2&"*",$A$1:$A1,0))),SUMPRODUCT(--(ISNUMBER(MATCH($F$16:$F$31,$A2,0))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31),SUMPRODUCT(--(ISNUMBER(SEARCH($A2,$F$16:$F$31))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31))
B12B12=SUM(B2:B11)
 
Upvote 0
Try this in B2:

=SUMIFS($G$16:$G$31,$F$16:$F$31,$A2,$E$16:$E$31,">="&B$1,$E$16:$E$31,"<="&EOMONTH(B$1,0))
 
Upvote 0
Try this in B2:

=SUMIFS($G$16:$G$31,$F$16:$F$31,$A2,$E$16:$E$31,">="&B$1,$E$16:$E$31,"<="&EOMONTH(B$1,0))

In B6: formula returns $678.72. Required value is $1,911.43.

B2=IF(OR(ISNUMBER(MATCH("*"&A2&"*",$A3:$A$12,0)),ISNUMBER(MATCH("*"&A2&"*",$A$1:$A1,0))),SUMPRODUCT(--(ISNUMBER(MATCH($F$16:$F$31,$A2,0))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31),SUMPRODUCT(--(ISNUMBER(SEARCH($A2,$F$16:$F$31))),--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31))
Returns all required values. Thank you.
But it's a lot to understand. Does a simpler formula exist?
 
Upvote 0
In B6: formula returns $678.72. Required value is $1,911.43.


Returns all required values. Thank you.
But it's a lot to understand. Does a simpler formula exist?
The formula checks if a lookup value is a subset of another lookup value, then will do a MATCH() if it is part of a lookup value, or a SEARCH() if it isn't. The formula can be further shortened due to the repetition of
Excel Formula:
--($E$16:$E$31>=B$1),--($E$16:$E$31<=EOMONTH(B$1,0)),$G$16:$G$31
But the underlying front potion will need to be there as long as some lookup values are subsets of others, and you don't want those to MATCH() and not SEARCH().
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

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