Hi Guillaume;
If you're interested, I like JB's solution better. It's easier to see how it works. I spent 20 minutes studying mine to make sure that it worked, but it took me less than 30 seconds to see that JB's worked. I think there's just one bug in it
If Sheet2!B2 : =MAX(Sheet1!X:X)
then the formula should be
=IF(ROW(A1)>$B$2, "", INDEX(Sheet1!A:A, MATCH(ROW(A1), Sheet1!$X:$X, 0)))
BTW; neither solution really stands up if you insert or delete rows in the raw data. You would need to use Offset() for every formula in column X on sheet 1.
JB's formula in X9 : =Offset(X9,-1,0)+IF(B9="Approved",1,0) (minor improvement).
Mine would have to be modified the same way. Every place in the formula of X9 that referred to X8 would have to be replaced with Offset(X9,-1,0).
So my formula in X9
X9 : =X8+MATCH("Approved",INDIRECT(CELL("Address",OFFSET($B$9,X8,0))&":$B$65535"),0)
would be changed to
X9 : =Offset(X9,-1,0)+MATCH("Approved",INDIRECT(CELL("Address",OFFSET($B$9,Offset(X9,-1,0),0))&":$B$65535"),0)
Then you can add & delete rows with no concern for the formulas crashing.
My formulas on Sheet2 would have to be changed also to accommodate added or deleted rows, and they would be a lot harder to modify. But JB's don't need to be modified at all.
Bookmarks