columns: A B C D E
row1 Item Value Lookup Count Value
row2 C 23 C 3 23
row3 X 34 - - 56
row4 C 56 - - 67
row5 C 67
row6 X 78
Defined Name ranges:
A2:A6 = Item
B:B = Value
Formulas:
D2: =COUNTIF(item,C2)
Array Formulae
E2: {=IF(ROWS(E$2:E2)>D$2,"",INDEX(value,SMALL(IF(item=C$2,ROW(item)),ROWS(E$2:E2))))}
E3: {=IF(ROWS(E$2:E3)>D$2,"",INDEX(value,SMALL(IF(item=C$2,ROW(item)),ROWS(E$2:E3))))}
E4: {=IF(ROWS(E$2:E4)>D$2,"",INDEX(value,SMALL(IF(item=C$2,ROW(item)),ROWS(E$2:E4)))) }
Problem:
Sheet as above is calculating correctly.
Change C2 from “C” to “X” - the correct values will be displayed in E2 and E3 (34, 78).
Change C2 back to “C” - now only E2 and E3 are populated correctly. E4 is blank, instead of having “67”.
See new screenshot below:
If you push F9 - nothing happens.
The only way to recalculate correctly, is to recopy formula E2 down E2:E4. then the correct three values are displayed (23, 45, 56)
LibreOffice version: 4.1.3.2