Since I had to leave the cell format as text to preserve any leading or trailing zeros entered by the user, I had a formula that worked for 8-digits only:
=AND(LEN(A1)=8,COUNT(-MID(A1,ROW(INDIRECT("1:8")),1))=8)
But now I found out the number length is sometimes also 7 digits. I tried creating an OR function, but flat out cannot get it to work. It may be something as simple as too few or too many parentheses?
=OR((LEN(K4)=8,COUNT(-MID(K4,ROW(INDIRECT("1:8")),1))=8)),(LEN(K4)=7,COUNT(-MID(K4,ROW(INDIRECT("1:7")),1))=7)
Or maybe I'm missing something else basic, but I've looked until my eyes are crossed. Can anyone help?
Attached file is an example.
Bookmarks