SUMIFS with merged cells and array formula

hymced

New Member
Joined
Sep 25, 2017
Messages
42
Hello all,
I am trying to build an array function that would work as a SUMIFS function, but with merged cells in the criteria_range. No VBA allowed, no temp helper column allowed,
no LOOKPUP function allowed (as done here: https://chandoo.org/forum/threads/formula-challenge-021-sumif-in-merged-cells.11927/),
no INDIRECT function allowed (as done here: https://www.mrexcel.com/forum/excel-questions/101119-sumif-merged-cells.html)



In the example above, the initial data is in columns A:A and B:B from row 3:3 to 11:11, and just below, the expected results is in $A$14:$C$16
The intermediary goal would be to build any of the vector in J:J or K:K or L:L with an array formula. After that, its a piece of cake.
As you can see, I have found a way in H:H, but the array formula is self-referencing the range in H:H to retrieve the value above, and that is incompatible with the final goal to wrap the intermediary formula in another formula directly without a temp helper column (I am thinking of something like =SUMIFS(INTERMEDIARY_ARRAY_FORMULA_FUNCTION_OF($A$3:$A$11;$B$3:$B$11)) )
And now, I'm stuck.
Any genius idea ? :)
 
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
If you want to post data to the site please use one of the tools available here https://www.mrexcel.com/forum/about-board/508133-attachments.html
rather than the old HTMLMaker

In fact I tried the last version because the other 2 won't work :

- MrExcel HTML Maker 20170807: won't work because on a VBA error, not compatible with my Fr-Fr system, in mCreateHML, CLng("16.0") fails, in my case it requires CLng("16,0") is expected
- Forum Tools Add-In by RoryA: won't work either, error in mCreateHTML at this line:
Code:
If Intersect(rngHasArray, Cell.CurrentArray) Is Nothing Then
, Intersect fails with rngHasArray being Nothing in my specific example

I fixed the first one, here is, finally, the example:

ABCDEFGHIJKLMNO
112312
2Initial dataIntermediary Goals: any of these 3
3A9A93A03AAA
4808A13AAA
5707A23AAA
6B6B66B06BBB
7505B16BBB
8404B26BBB
9C3C39C09CCC
10202C19CCC
11101C29CCC
12
13Final Goal
14A24
15B15
16C6

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
K3=G3
K4=K3
K5=K4
K6=G6
K7=K6
K8=K7
K9=G9
K10=K9
K11=K10
B14=SUMIFS($B$3:$B$11,$O$3:$O$11,A14)
B15=SUMIFS($B$3:$B$11,$O$3:$O$11,A15)
B16=SUMIFS($B$3:$B$11,$O$3:$O$11,A16)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
G3:G11{=IF(NOT(ISBLANK($A$3:$A$11)),ROW($A$3:$A$11),"")}
H3:H11{=IF($D$3:$D$11<>0,$D$3:$D$11,OFFSET($H$3:$H$11,-1,0,,))}
N3:N11{=IF($D$3:$D$11<>0,$D$3:$D$11,OFFSET($D$3:$D$11,-($J$3:$J$11),0,,))}
O3:O11{=INDEX($A$3:$A$11,$K$3:$K$11-ROW(A3)+1)}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0
in fact it it possible, my problem was not from the MATCH function but from the INDEX function, and there is an obscure way around it. Problem solved ! :)


Book1
ABCDEFG
1MergedValueTemp Filter
2A18AA114114
317AB5757
416AC00
515A
614A
713A
8B12B
911B
1010B
119B
128B
137B
14A6A
155A
164A
173A
182A
191A
Sheet1
Cell Formulas
RangeFormula
F2{=SUM((INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E2)*$B$2:$B$19)}
F3{=SUM((INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E3)*$B$2:$B$19)}
F4{=SUM((INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E4)*$B$2:$B$19)}
G2{=SUMPRODUCT(--(INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E2),$B$2:$B$19)}
G3{=SUMPRODUCT(--(INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E3),$B$2:$B$19)}
G4{=SUMPRODUCT(--(INDEX($A$2:$A$19,N(IF({1},MATCH(ROW($A$2:$A$19),IF(NOT(ISBLANK($A$2:$A$19)),ROW($A$2:$A$19),""),1))))=$E4),$B$2:$B$19)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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