get SSNs from text and other numbers

lgirl

New Member
Joined
Apr 1, 2009
Messages
24
I have a cell that contains text, phone numbers with hyphens, and SSN numbers with hyphens.

I only want to get the SSN.

I am using a the formula =MID(B10,SEARCH("-",B10,1)-3,11 but it pulls in the phone number or any other number that has a hyphen if they are before the SSN number.

Is there a formula I can use to pull in only the SSN?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Can you post a few sample sets of data
Changing real names and SSNs to fake ones 123-45-6789
 
Upvote 0
cell a1 would contain the text:
The phone number 456-123-4567 is part of the number 123-45-6789 (fictitious ssn number) test test test

cell a2 would contain the text:
12-11-1999 The phone number 123-123-4444 is part of the number 123-44-4444 (fictitious ssn number) test test test

The lines above are samples. I would like to get the fictitious ssn numbers above only.
 
Upvote 0
That works wonderful!!

I have been trying to do this for a couple of days and you have been able to help me in a matter of a few minutes.

Thank you so much!:biggrin::biggrin::biggrin:
 
Upvote 0
Have you considered using Excel's 'Text to Columns' approach? It's non-formulaic but it parses out text very clean if data format is consistent.

Ah, did not see prior helpful post. Very cool solution!
 
Upvote 0

Forum statistics

Threads
1,203,537
Messages
6,055,976
Members
444,839
Latest member
laurajames

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