Data Validation for a Social Security Number

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
3,073
Office Version
  1. 365
Platform
  1. Windows
I'm sharing the way I solved the issue because I learned a few things along the way.

I wanted to have the end user enter in a social security number without the dashes and format the number using number format (###-##-####). This doesn't work because the first 3 numbers of a SS# can be 001. So, if you enter a whole number with leading zeros, it doesn't work. The forms I create will not always be used by people that can allow macros, so I have to restrict it to not using VBA and changing the numbers into the correct format.

I went back to formatting the cell as text and having the user enter the number with dashes. This is the data validation formula I used to check the SS# validity.
=AND(LEN(MainSS)=11,ISNUMBER(VALUE(SUBSTITUTE(MainSS,"-",""))))

If anybody can offer another way for the user to enter only numbers, please let me know.

Jeff
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,221,418
Messages
6,159,795
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top