A B C D
east 1 56
west 5 98
east 1 78
west 5 99
south 3 23
east 2 45
south 3 67
I want to get the maximum value of same combination of A+B concatenated. Ex- for east1, I should get 78 in column D. For this I am using VBA, but the code doesn't seem to work. I am using array formula for it.
My code is:
.Range("D2:D" & OutputLastRow).FormulaArray = "=MAX(("$A$2:$A$" & OutputLastRow=A2)*("$B$2:$B$" & OutputLastRow=B2)*("$C$2:$C$" & OutputLastRow))"
The code is running without any bug but the result comes out to be wrong because the cell A2 as well as B2 is not getting updated as the formula moves down from D2. A2 remains as A2 and B2 as B2. I have tried it using loop but that also doesn't work.
