Convert SSN in one column to text in the adjacent column

realtoast

New Member
Joined
Nov 24, 2015
Messages
47
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I have a table with around 10,000 records. The records are medical claims, where an individual claimant may have many rows of different types of claims. The individuals are identified by their Social Security Number (ClaimantID). I've created a column, Claimant Alias, where I use the =RIGHT() function to only show the last four digits of the adjacent ClaimantID. This works fine and the last four digits of the SSN can be used to pivot (unless there are duplicates of the last four digits with more than one person; which is a distinct possibility).

But, I would like to take it a step further and replace, say, the digits of the SSN with text in an adjacent column. For instance, 123-45-6785 would convert to, say Claimant1. Then, in the next change in SSN records would be Claimant2, etc. So, in the end, the column, Claimant Alias would have only Claimant[X] from which I could pivot.

Any tips greatly appreciated.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Keep it simple, use row as claimant id:

if SSN is A:A, claimantID is B:B,
B2 is =ROW()
B3 is =if(A3=A2,B2,ROW())
fill B3 to all other rows
 
Upvote 0
See if this does what you want.
C2 is manually entered. C3 copied down.

<b>Claimant Alias</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Arial,Arial; font-size:8pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:137px;" /><col style="width:116px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >B</td><td >C</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="font-size:10pt; text-align:right; ">SSN</td><td style="font-size:10pt; ">Claimant Alias</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="font-size:10pt; text-align:right; ">123456789</td><td style="font-size:10pt; ">Claimant1</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="font-size:10pt; text-align:right; ">123456789</td><td style="font-size:10pt; ">Claimant1</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="font-size:10pt; text-align:right; ">123456789</td><td style="font-size:10pt; ">Claimant1</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="font-size:10pt; text-align:right; ">123456789</td><td style="font-size:10pt; ">Claimant1</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="font-size:10pt; text-align:right; ">987654321</td><td style="font-size:10pt; ">Claimant2</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="font-size:10pt; text-align:right; ">555555555</td><td style="font-size:10pt; ">Claimant3</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="font-size:10pt; text-align:right; ">555555555</td><td style="font-size:10pt; ">Claimant3</td></tr><tr style="height:21px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td style="font-size:10pt; text-align:right; ">555555555</td><td style="font-size:10pt; ">Claimant3</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >C3</td><td >=IF(B3=B2,C2,"Claimant"&REPLACE<span style=' color:008000; '>(C2,1,8,"")</span>+1)</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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