ArrayFormula syntax to reference the previous row for calculating the current row

In part 3 of `Arrayformula` Alternatives series of question, I still can't figure out a straightforward way of using arrayformula to do a "if condition(s) is true, previousrow++" or just a syntax to reference the previous row for calculating the current row.

As usual, design a `Arrayformula` based solution that gives the same results as column B of sample sheet.

• Allen, did my formula produce the results you wanted? It's all well and good to post questions and ask for help; but if you don't respond when people supply answers, it may be hard to find help in the future. – Erik Tyler Jan 30 at 6:12
• Thanks Erik. You answer was good and I've accepted your answer in the 2nd question. However I still don't understand it enough to formulate my own formulars, thus the 3rd one, with 2 conditions to check. – Allen Sierra Jan 30 at 10:20
• Allen, I don't understand what you mean by "thus the 3rd one, with 2 conditions to check." I don't see anything else here. – Erik Tyler Jan 30 at 17:31
• I was just saying I asked the 3rd question, which as 2 conditions to check for in the array formula. The 2nd question only had 1, so the additional IF should change the formula structure a bit and there's what I'm trying to observe. – Allen Sierra Feb 1 at 11:31
• Allen, I still do not understand you. There are no questions here or on the sheet. I see A, B and C. There are no IF statements, either. I'm going to suggest that you start a NEW post, since the answer to your original post and data (with A and B only) has been answered. I don't think I will answer future questions, because I'm afraid I'm not able to clearly understand you. Perhaps someone else will be able to. – Erik Tyler Feb 2 at 0:37

`=ArrayFormula({"Result [Erik]";IF(A2:A="","",COUNTIFS(ROW(A2:A),"<="&ROW(A2:A),A2:A,2))})`