icecream sugar black
icecream sugar black

Reputation: 63

Formula to count if a text is written in a cell

a 0
a 1

 
 
a 2
a 3
 
 
a 4

enter image description here

Count starts at 0. ArrayFormula is used and data is checked in a specified range. If a value is written in the cell, it counts. However, if the cell is empty, it does not count. I want to express it in a formula!

Upvotes: 0

Views: 70

Answers (2)

Martín
Martín

Reputation: 10217

Try with this formula in P1. If you start in O2, change O:O with O2:O

=BYROW(O:O,LAMBDA(each,IF(each="","",COUNTA(FILTER(O1:each,ISTEXT(O1:each))))))

Upvotes: 1

z..
z..

Reputation: 13013

Use SCAN, like this:


=ArrayFormula(IF(A1:A10="",,SCAN(-1,A1:A10,LAMBDA(a,c,a+(c<>"")))))

Upvotes: 1

Related Questions