If you wanted a formula to tell you how many dashes were in a code then:
=LEN(A1)-LEN(SUBSTITUTE(A1,"-",""))
would do it.
Likewise, to see how many spaces were in a code, then:
=LEN(A1)-LEN(SUBSTITUTE(A1," ",""))
would do it.
To count how many spaces or dashes were in a code:
=(LEN(A1)-LEN(SUBSTITUTE(A1,"-","")))+(LEN(A1)-LEN(SUBSTITUTE(A1," ","")))
Cheers, Glenn.
Beauty is in the eye of the beerholder.