Format Text Data Type

R

Robert

In a cell I am having users enter social security numbers
but the cells will be formatted as text. I need to input
mask the SSN like you can in MS Access. i.e. 000-00-0000

But I need the SSN to remain as text not a number. Any
help.
 
J

Jason Morin

What you could do is use this in some random cell, say Z1:

=(ISNUMBER(SUM(1*MID(SUBSTITUTE(A1,"-",""),ROW(INDIRECT
("1:"&LEN(SUBSTITUTE(A1,"-","")))),1))))*(MID(A1,4,1)="-")*
(MID(A1,7,1)="-")*(LEN(A1)=11)

Array-entered, meaning press ctrl/shift/enter.

Then select the entry cell, go to Data > Validation,
select "Custom", and insert:

=$Z1=1

If you have more than 1 validation cell (say A1:A20),
insert the array formula above in cells Z1:Z20, then apply
validation to A1:A20.

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top