If you have Excel for Microsoft 365, you could try this
- get last cell
XLOOKUP(TRUE, B:B <> "", B:B, , , -1)
- get visible,
MAP(b_idx, LAMBDA(i, SUBTOTAL(103, INDEX(b_, i, 1))))
For example, with B11, B12 = Defined and rows 11, and 12 hidden, enter the following whether you want the count:
=LET(
last_b, XLOOKUP(TRUE, B:B <> "", B:B, , , -1),
b_, B2:last_b,
b_idx, SEQUENCE(ROWS(b_)),
b_visible, MAP(b_idx, LAMBDA(i, SUBTOTAL(103, INDEX(b_, i, 1)))),
b_defined, EXACT(b_, "Defined"),
SUM(b_visible * b_defined)
)
- if you have already defined a table
=LET(
b_, Table1[Col b],
b_idx, SEQUENCE(ROWS(b_)),
b_visible, MAP(b_idx, LAMBDA(i, SUBTOTAL(103, INDEX(b_, i, 1)))),
b_defined, EXACT(b_, "Defined"),
SUM(b_visible * b_defined)
)
