I'm using this formula in Google Sheets to RANK rows based on TOT column. It works well if I put the formula in E2 and drag over the column, but I want to put this formula inside an arrayformula and it's not working. How could I arrayformulize this?
=RANK.EQ(I3;$I$3:$I;0) COUNTIF($I$3:I3;I3)-1
=ARRAYFORMULA(RANK.EQ(I3;$I$3:$I;0) COUNTIF($I$3:I3;I3)-1) This doesn't work
CodePudding user response:
The sheet you've shared doesn't match the formula you have.
Here's a formula that works with the sheet you've shared:
=ARRAYFORMULA(RANK.EQ(D2:D;D2:D;0) COUNTIFS(D2:D;D2:D;ROW(D2:D);"<="&ROW(D2:D))-1)
When using ArrayFormula you have to provide ranges to the functions parameters (and you don't need absolute references since you aren't going to drag the formula).
In this case it was slightly more complex as that COUNTIF
you have must be done with a COUNTIFS
.
CodePudding user response:
use:
=INDEX(SORT({SORT(ROW(D2:D); D2:D; )\ROW(D2:D)-1});;2)