You might want
=17-COUNTA(B2:R2)
where COUNTA()
counts the non-empty (non-blank) cells in a range. But part of your question makes it sound like you are putting a value of 17
into cell W2
and then modifying (decrementing) that cell. That's not possible with formulas; to actually change a cell you need to use VBA.