Sumifs with index match match inquiry (could be Sumproduct related)

ExcelUser18

New Member
Joined
May 3, 2017
Messages
36
Hi,

I have two-pronged question though the most important one will be the 1st bullet and the less important will be the 2nd bullet. The uploaded excel will show the same format for the aggregate data on the top and the different sets of data outlined in black below it. Unsure if sumifs and index match match would be appropriate or if it would be a sumproduct with various arrays.

  • Highlighted in the orange row, I am looking for sumifs formula where I'd reference an entire section of data (outlined in the box from cell C16:Q39) that would match the Identifying Category in Column C and the respective Date in Row 8 to the outlined box. In the uploaded excel, highlighted in orange, I have the result which is much bulkier and less efficient than what I believe can be done.
  • Highlighted in Yellow, I'd like to create a minif with only 1 criterion. Right now I have 3 different sets of data in the outlined box but if I added a 4th, I'd like cell D8 to search the larger outlined box to find me the earliest start data. Right now it shows 3/16/20 but should I add another set of data that started 11/1/2019, I'd like Row 8 to update. Excel only allows MinIFS with multiple criteria, however, I'd only have one criterion which would be the Identifying Category of "Date".
Any help is appreciated. I've searched different threads but it did not show the match/match component I think I'm looking for that's reference in my bulleted example above.

Year0111111111111222222222
Month0123456789101112131415161718192021
Date3/16/20204/30/20205/31/20206/30/20207/31/20208/31/20209/30/202010/31/202011/30/202012/31/20201/31/20212/28/20213/31/20214/30/20215/31/20216/30/20217/31/20218/31/20219/30/202110/31/202111/30/202112/31/2021
CF-30,000.000.000.000.000.000.000.000.000.000.000.000.00232.50213.550.000.00106.050.000.00143.980.000.00
Refi/Sale0.000.000.000.000.000.000.000.0010,010.000.000.000.000.000.0010,226.000.000.000.000.000.000.000.00
Total-30,000.000.000.000.000.000.000.000.0010,010.000.000.000.00232.50213.5510,226.000.00106.050.000.00143.980.000.00
Year01111111111112
Month012345678910111213
Date3/16/20204/30/20205/31/20206/30/20207/31/20208/31/20209/30/202010/31/202011/30/202012/31/20201/31/20212/28/20213/31/20214/30/2021
CF-30,000.000.000.000.000.000.000.000.000.000.000.000.00232.500.00
Refi/Sale0.000.000.000.000.000.000.000.0010,010.000.000.000.000.000.00
Total-30,000.000.000.000.000.000.000.000.0010,010.000.000.000.00232.500.00
Year01111111111112
Month012345678910111213
Date12/24/20201/31/20212/28/20213/31/20214/30/20215/31/20216/30/20217/31/20218/31/20219/30/202110/31/202111/30/202112/31/20211/31/2022
CF-30,000.000.000.000.000.000.000.000.000.000.000.000.000.000.00
Refi/Sale0.000.000.000.000.0010,226.000.000.000.000.000.000.000.000.00
Total-30,000.000.000.000.000.0010,226.000.000.000.000.000.000.000.000.00
Year01111111111112
Month012345678910111213
Date11/1/202012/31/20201/31/20212/28/20213/31/20214/30/20215/31/20216/30/20217/31/20218/31/20219/30/202110/31/202111/30/202112/31/2021
CF-10,000.000.000.000.000.00213.550.000.00106.050.000.00143.980.000.00
Refi/Sale0.000.000.000.000.000.000.000.000.000.000.000.000.000.00
Total-10,000.000.000.000.000.00213.550.000.00106.050.000.00143.980.000.00
 
Sure thing, see below. The last box at the bottom, which has a start date of 11/15/2021, is where I'm having the issues. When I scroll up to the top and try to alter your formulas to drag down and include the last box, I get the error. The current formula does not have the error.

Book1
IJKLMNOPQ
1Year0111111
2Month0123456
3Date3/16/20203/31/20204/30/20205/31/20206/30/20207/31/20208/31/20209/30/2020
4Initial$ (30,000.00)$ -$ -$ -$ -$ -$ -
5CF$ -$ -$ -$ -$ -$ -$ -
6Refinance$ -$ -$ -$ -$ -$ -$ -
7Sale$ -$ -$ -$ -$ -$ -$ -
8Total$ (30,000.00)$ -$ -$ -$ -$ -$ -
9
10Basis30,000.0030,000.0030,000.0030,000.0030,000.0030,000.00
11CoC - Initial0.00%0.00%0.00%0.00%0.00%0.00%
12CoC - Basis0.00%0.00%0.00%0.00%0.00%0.00%
13IRR5.3%
14EM1.19
15
16
17
18
19
20Year0111111
21Month0123456
22Date3/16/20203/31/20204/30/20205/31/20206/30/20207/31/20208/31/20209/30/2020
23Initial$ (30,000.00)$ -$ -$ -$ -$ -$ -
24CF$ -$ -$ -$ -$ -$ -$ -
25Refinance$ -$ -$ -$ -$ -$ -$ -
26Sale$ -$ -$ -$ -$ -$ -$ -
27Total$ (30,000.00)$ -$ -$ -$ -$ -$ -
280.0%0.0%0.0%0.0%0.0%0.0%
29Basis30,000.0030,000.0030,000.0030,000.0030,000.0030,000.00
30CoC - Initial0.00%0.00%0.00%0.00%0.00%0.00%
31CoC - Basis0.00%0.00%0.00%0.00%0.00%0.00%
32IRR19.6%
33EM1.76
34
35
36
37
38
39
40Year0111111
41Month0123456
42Date12/24/202012/31/20201/31/20212/28/20213/31/20214/30/20215/31/20216/30/2021
43Initial$ (30,000.00)$ -$ -$ -$ -$ -$ -
44CF$ -$ -$ -$ -$ -$ -$ 180.72
45Refinance$ -$ -$ -$ -$ -$ 10,226.00$ -
46Sale$ -$ -$ -$ -$ -$ -$ -
47Total$ (30,000.00)$ -$ -$ -$ -$ 10,226.00$ 180.72
480.0%0.0%0.0%0.0%34.1%0.6%
49Basis30,000.0030,000.0030,000.0030,000.0019,774.0019,593.28
50CoC - Initial0.00%0.00%0.00%0.00%0.00%0.60%
51CoC - Basis0.00%0.00%0.00%0.00%0.00%0.92%
52IRR27.3%
53EM2.11
54
55
56
57
58
59
60Year0111111
61Month0123456
62Date11/1/202011/30/202012/31/20201/31/20212/28/20213/31/20214/30/20215/31/2021
63Initial$ (10,000.00)$ -$ -$ -$ -$ -$ -
64CF$ -$ -$ -$ -$ -$ 213.55$ -
65Refinance$ -$ -$ -$ -$ -$ -$ -
66Sale$ -$ -$ -$ -$ -$ -$ -
67Total$ (10,000.00)$ -$ -$ -$ -$ 213.55$ -
680.0%0.0%0.0%0.0%2.1%0.0%
69Basis10,000.0010,000.0010,000.0010,000.009,786.459,786.45
70CoC - Initial0.00%0.00%0.00%0.00%2.14%0.00%
71CoC - Basis0.00%0.00%0.00%0.00%2.18%0.00%
72IRR-8.6%
73EM0.71
74
75
76
77
78
79
80Year0111111
81Month0123456
82Date3/29/20213/31/20214/30/20215/31/20216/30/20217/31/20218/31/20219/30/2021
83Initial$ (10,000.00)$ -$ -$ -$ -$ -$ -
84CF$ -$ -$ -$ -$ 359.37$ -$ -
85Refinance$ -$ -$ -$ -$ -$ -$ -
86Sale$ -$ -$ -$ -$ -$ -$ -
87Total$ (10,000.00)$ -$ -$ -$ 359.37$ -$ -
880.0%0.0%0.0%3.6%0.0%0.0%
89Basis10,000.0010,000.0010,000.009,640.639,640.639,640.63
90CoC - Initial0.00%0.00%0.00%3.59%0.00%0.00%
91CoC - Basis0.00%0.00%0.00%3.73%0.00%0.00%
92IRR16.3%
93EM1.76
94
95
96
97
98
99
100Year0111111
101Month0123456
102Date7/7/20217/31/20218/31/20219/30/202110/31/202111/30/202112/31/20211/31/2022
103Initial$ (40,000.00)$ -$ -$ -$ -$ -$ -
104CF$ -$ -$ -$ -$ -$ -$ -
105Refinance$ -$ -$ -$ -$ -$ -$ -
106Sale$ -$ -$ -$ -$ -$ -$ -
107Total$ (40,000.00)$ -$ -$ -$ -$ -$ -
1080.0%0.0%0.0%0.0%0.0%0.0%
109Basis40,000.0040,000.0040,000.0040,000.0040,000.0040,000.00
110CoC - Initial0.00%0.00%0.00%0.00%0.00%0.00%
111CoC - Basis0.00%0.00%0.00%0.00%0.00%0.00%
112IRR#NUM!
113EM0.00
114
115
116
117
118
119
120Year0111111
121Month0123456
122Date11/15/202111/30/202112/31/20211/31/20222/28/20223/31/20224/30/20225/31/2022
123Initial$ (40,000.00)$ -$ -$ -$ -$ -$ -
124CF$ -$ -$ -$ -$ -$ -$ -
125Refinance$ -$ -$ -$ -$ -$ -$ -
126Sale$ -$ -$ -$ -$ -$ -$ -
127Total$ (40,000.00)$ -$ -$ -$ -$ -$ -
1280.0%0.0%0.0%0.0%0.0%0.0%
129Basis40,000.0040,000.0040,000.0040,000.0040,000.0040,000.00
130CoC - Initial0.00%0.00%0.00%0.00%0.00%0.00%
131CoC - Basis0.00%0.00%0.00%0.00%0.00%0.00%
132IRR#NUM!
133EM0.00
134
CRE
Cell Formulas
RangeFormula
K120:Q120,K100:Q100,K80:Q80,K60:Q60,K40:Q40,K20:Q20,K1:Q1K1=ROUNDUP(K2/12,0)
L2:Q2,L121:Q121,L101:Q101,L81:Q81,L61:Q61,L41:Q41,L21:Q21L2=K2+1
J3J3=MINIFS(J$22:J$1005,I$22:I$1005,"date")
K3,K122,K102,K82,K62,K42,K22K3=EOMONTH(J3,0)
L3:Q3,L122:Q122,L102:Q102,L82:Q82,L62:Q62,L42:Q42,L22:Q22L3=EOMONTH(K3,1)
K4:Q7K4=SUMPRODUCT(($I23:$I103=$I4)*($K$22:$BG$102=K$3),$K23:$BG103)
K8:Q8,K127:Q127,K107:Q107,K87:Q87,K67:Q67,K47:Q47,K27:Q27K8=SUM(K4:K7)
L10:Q10,L129:Q129,L109:Q109,L89:Q89,L69:Q69,L49:Q49,L29:Q29L10=IF(-SUM($K8:L8)<0,0,-SUM($K8:L8))
L11:Q11,L130:Q130,L110:Q110,L90:Q90,L70:Q70,L50:Q50,L30:Q30L11=L5/-SUMIF($K4:$BG4,"<0")
L12:Q12,L131:Q131,L111:Q111,L91:Q91,L71:Q71,L51:Q51,L31:Q31L12=IF(L10=0,"Infinity",L5/L10)
K13K13=XIRR(K8:CQ8,K3:CQ3)
K14K14=SUMIF(K8:CQ8,">0")/-SUMIF(K8:CQ8,"<0")
K23,K123,K103,K83,K63,K43K23=-D29
L28:Q28,L128:Q128,L108:Q108,L88:Q88,L68:Q68,L48:Q48L28=L27/-$K27
K32,K132,K112,K92,K72,K52K32=XIRR(K27:BV27,K22:BV22)
K33,K133,K113,K93,K73,K53K33=SUMIF(K27:BV27,">0")/-SUMIF(K27:BV27,"<0")
P45P45=D51
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Here it is with the error....

Book1
IJKLMN
1Year0111
2Month0123
3Date3/16/20203/31/20204/30/20205/31/20206/30/2020
4Initial#NUM!$ -$ -$ -
5CF#NUM!$ -$ -$ -
6Refinance#NUM!$ -$ -$ -
7Sale#NUM!$ -$ -$ -
8Total#NUM!$ -$ -$ -
9
10Basis#NUM!#NUM!#NUM!
11CoC - Initial0.00%0.00%0.00%
12CoC - Basis#NUM!#NUM!#NUM!
13IRR#NUM!
14EM1.64
15
16
17
18
19
20Year0111
21Month0123
22Date3/16/20203/31/20204/30/20205/31/20206/30/2020
23Initial$ (30,000.00)$ -$ -$ -
24CF$ -$ -$ -$ -
25Refinance$ -$ -$ -$ -
26Sale$ -$ -$ -$ -
27Total$ (30,000.00)$ -$ -$ -
280.0%0.0%0.0%
29Basis30,000.0030,000.0030,000.00
30CoC - Initial0.00%0.00%0.00%
31CoC - Basis0.00%0.00%0.00%
32IRR19.6%
33EM1.76
34
35
36
37
38
39
40Year0111
41Month0123
42Date12/24/202012/31/20201/31/20212/28/20213/31/2021
43Initial$ (30,000.00)$ -$ -$ -
44CF$ -$ -$ -$ -
45Refinance$ -$ -$ -$ -
46Sale$ -$ -$ -$ -
47Total$ (30,000.00)$ -$ -$ -
480.0%0.0%0.0%
49Basis30,000.0030,000.0030,000.00
50CoC - Initial0.00%0.00%0.00%
51CoC - Basis0.00%0.00%0.00%
52IRR27.3%
53EM2.11
54
55
56
57
58
59
60Year0111
61Month0123
62Date11/1/202011/30/202012/31/20201/31/20212/28/2021
63Initial$ (10,000.00)$ -$ -$ -
64CF$ -$ -$ -$ -
65Refinance$ -$ -$ -$ -
66Sale$ -$ -$ -$ -
67Total$ (10,000.00)$ -$ -$ -
680.0%0.0%0.0%
69Basis10,000.0010,000.0010,000.00
70CoC - Initial0.00%0.00%0.00%
71CoC - Basis0.00%0.00%0.00%
72IRR-8.6%
73EM0.71
74
75
76
77
78
79
80Year0111
81Month0123
82Date3/29/20213/31/20214/30/20215/31/20216/30/2021
83Initial$ (10,000.00)$ -$ -$ -
84CF$ -$ -$ -$ -
85Refinance$ -$ -$ -$ -
86Sale$ -$ -$ -$ -
87Total$ (10,000.00)$ -$ -$ -
880.0%0.0%0.0%
89Basis10,000.0010,000.0010,000.00
90CoC - Initial0.00%0.00%0.00%
91CoC - Basis0.00%0.00%0.00%
92IRR16.3%
93EM1.76
94
95
96
97
98
99
100Year0111
101Month0123
102Date7/7/20217/31/20218/31/20219/30/202110/31/2021
103Initial$ (40,000.00)$ -$ -$ -
104CF$ -$ -$ -$ -
105Refinance$ -$ -$ -$ -
106Sale$ -$ -$ -$ -
107Total$ (40,000.00)$ -$ -$ -
1080.0%0.0%0.0%
109Basis40,000.0040,000.0040,000.00
110CoC - Initial0.00%0.00%0.00%
111CoC - Basis0.00%0.00%0.00%
112IRR#NUM!
113EM0.00
114
115
116
117
118
119
120Year0111
121Month0123
122Date11/15/202111/30/202112/31/20211/31/20222/28/2022
123Initial$ (40,000.00)$ -$ -$ -
124CF$ -$ -$ -$ -
125Refinance$ -$ -$ -$ -
126Sale$ -$ -$ -$ -
127Total$ (40,000.00)$ -$ -$ -
1280.0%0.0%0.0%
129Basis40,000.0040,000.0040,000.00
130CoC - Initial0.00%0.00%0.00%
131CoC - Basis0.00%0.00%0.00%
132IRR#NUM!
133EM0.00
134
CRE
Cell Formulas
RangeFormula
K120:N120,K100:N100,K80:N80,K60:N60,K40:N40,K20:N20,K1:N1K1=ROUNDUP(K2/12,0)
L2:N2,L121:N121,L101:N101,L81:N81,L61:N61,L41:N41,L21:N21L2=K2+1
J3J3=MINIFS(J$22:J$1005,I$22:I$1005,"date")
K3,K122,K102,K82,K62,K42,K22K3=EOMONTH(J3,0)
L3:N3,L122:N122,L102:N102,L82:N82,L62:N62,L42:N42,L22:N22L3=EOMONTH(K3,1)
K4:K7K4=SUMPRODUCT(($I23:$I123=$I4)*($K$22:$BG$122=K$3),$K23:$BG123)
L4:N7L4=SUMPRODUCT(($I23:$I103=$I4)*($K$22:$BG$102=L$3),$K23:$BG103)
K8:N8,K127:N127,K107:N107,K87:N87,K67:N67,K47:N47,K27:N27K8=SUM(K4:K7)
L10:N10,L129:N129,L109:N109,L89:N89,L69:N69,L49:N49,L29:N29L10=IF(-SUM($K8:L8)<0,0,-SUM($K8:L8))
L11:N11,L130:N130,L110:N110,L90:N90,L70:N70,L50:N50,L30:N30L11=L5/-SUMIF($K4:$BG4,"<0")
L12:N12,L131:N131,L111:N111,L91:N91,L71:N71,L51:N51,L31:N31L12=IF(L10=0,"Infinity",L5/L10)
K13K13=XIRR(K8:CQ8,K3:CQ3)
K14K14=SUMIF(K8:CQ8,">0")/-SUMIF(K8:CQ8,"<0")
K23,K123,K103,K83,K63,K43K23=-D29
L28:N28,L128:N128,L108:N108,L88:N88,L68:N68,L48:N48L28=L27/-$K27
K32,K132,K112,K92,K72,K52K32=XIRR(K27:BV27,K22:BV22)
K33,K133,K113,K93,K73,K53K33=SUMIF(K27:BV27,">0")/-SUMIF(K27:BV27,"<0")
 
Upvote 0
The problem is the XIRR formula in K112. That is returning a #NUM! error for reasons that I can not see in the mini sheet.

You will need to fix that error then the sumproduct formula will work just fine.

There is another error in K132 that doesn't look as if it will affect the current sumproduct formula but it is likely to cause the same problem next time you copy the formula down the sheet.
 
Upvote 0
You're right. I saw that error but thought because it was not part of the search category in Column I, that it would not have mattered. That works now. Sorry about that.
 
Upvote 0
I saw that error but thought because it was not part of the search category in Column I, that it would not have mattered.
In the majority of cases an error that falls within a formula range will be carried forward regardless of whether or not that cell is matched with other criteria to form part of the result. There are some exceptions but it is considered best practice not to leave unresolved errors in your sheet.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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