Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts

Sorry @ThinhDinh, in fact I answered too quickly to your original question: the objective is not a sum per line, but to count the non-empty cells per line.

When I use the formula below, while it’s a ‘counta’, it makes a sum of the non-empty cells of all lines included in the arrayformula…
=arrayformula(if(isblank(D2:D);"";COUNTA(H2:H;I2:I;J2:J;K2:K)))