Home > Blockchain >  Index or HLookup working "alone" but not working inside ArrayFormula
Index or HLookup working "alone" but not working inside ArrayFormula

Time:06-20

I'm trying to put the following formulas inside an ArrayFormula but the result is wrong (keep providing the first row result):

Working in each single cell

=INDEX($D$2:$AKA;match($A2:A;$A$2:A;false);MATCH(DATE(YEAR(TODAY());MONTH(TODAY());1);$D$1:$AKA$1;false))

Showing the same result in all cells

=arrayformula(IF(LEN($A$2:A);INDEX($D$2:$AKA;match($A2:A;$A$2:A;false);MATCH(DATE(YEAR(TODAY());MONTH(TODAY());1);$D$1:$AKA$1;false));))

Expected/Results

enter image description here

CodePudding user response:

You may also try QUERY() approach.

=QUERY(INDEX(D2:5000;;MATCH(EOMONTH(TODAY();-1) 1;D1:1));"limit " & COUNTA(A2:A))

enter image description here

  • Related