Format SSN - Updated formula
February 20, 2008 – 6:56 pm by JP
Here is an update to the code I have posted on the site at
I realized that the last part of the formula doesn’t check for dashes. Here is the updated formula:
=IF(AND(LEN(A4)>6, LEN(A4)9, NOT(ISERROR(FIND(”-”,A4)))),A4,LEFT(A4,3)&”-”&MID(A4,4,2)&”-”&RIGHT(A4,4)))
Notice the addition of NOT(ISERROR(FIND(”-”,A4))) in the second IF formula.
If the formula already has dashes in it, it will simply return the value in A4.
Enjoy,
JP
Print This Post
|
Email This Post
|
Permalink
|
Filed Under: Excel, Formulas
Tags: Excel, formula, LEFT, MID, RIGHT
This post has 139 views since February 20, 2008 – 6:56 pm.






