Home » excel » excel – If cell is "SU" COUNTA previous 6 cells

excel – If cell is "SU" COUNTA previous 6 cells

Posted by: admin May 14, 2020 Leave a comment

Questions:

How I can input to formula condition when Excel can recognize that it is cell with value “SU” and if it is perform =COUNTA(previous 6 cells on row 11) operation?

Then I can drag that cell with formula below so it will work for the whole range.

In this case it will be false as TH is empty, otherwise if TH will be not empty it should perform calculation.

=IF(O11="SU";IF(COUNTA(previous 6 cells on row 11)<6;50;70))

So when this formula will reach U11 COUNTA range should be O11:T11, when formula will reach AB11 COUNTA range should be V11:AA11 etc.

enter image description here

How to&Answers:

Your question is really unclear.

As I understand, you want to count the number of non-empty cells in the last 6 cells when the day is Sunday. And fill blank if it not Sunday.

The formula for above would be:

=IF(O9="SU",COUNTA(I11:N11),"")

You can drag this formula horizontally.

**Although COUNTA counts formulas i.e. if a cell contains formula that returns blank then COUNTA would count that as well.

If you have only numbers in the previous 6 cells, then you change COUNTA to COUNT and the above problem will be taken care of.