ANSWERED - Making a formula count the number of digits in a cell before executing

New Contributor

Edit - I got the answer I needed. Thank you!


Hello all,


I am trying to get a formula to count how many digits are in a cell, and if they contain a certain amount of digits, then (do the rest of the formula I already have).


For example, if the cell has 1 digit, I dont want it to do anything, but if it has 2, 3, or 4 digits, I want it to do something. Is there a way to do that?

4 Replies
Hello, try this formula

best response confirmed by Hans Vogelaar (MVP)
=IF(LEN(A1)>1,"do something","do nothing")
Based on Number of digits you can do multiple formulas using conditional if
9 2 0
12 3 36
15 4 60
150 5 750
2000 1 2000
From the above formula If value is single digit will not do any calculation,
if it has more than 2 digit calculation can be done with using multiplication, division or substract etc.
This was the one I needed. This did exactly what I was looking for. Thank you so much!