#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default converting ssn's

because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default converting ssn's

tisaman wrote:
because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia



=2999999999-(MID(A1,5,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,6,1))
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default converting ssn's

try this

cell A1 has number then in cell B1 put this formula
=2&TEXT(999999999-VALUE(LEFT(MID(A1,FIND("-",A1)+1,2),1)&SUBSTITUTE
(A1,"-"&MID(A1,FIND("-",A1)+1,2)&"-","")&RIGHT(MID(A1,FIND
("-",A1)+1,2),1)),"000000000")

On Dec 3, 1:05*am, tisaman wrote:
because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of2044981841(always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default converting ssn's

Hi,

With your original number in A1 try this

=2&TEXT(999999999-(MID(A1,FIND("-",A1)+1,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,FIND( "-",A1)+2,1)),"000000000")

Mike


"tisaman" wrote:

because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default converting ssn's

Glenn wrote:
tisaman wrote:
because of HIPAA, i need an excel formula to convert the 9 digit ssn
to a 10 digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel
formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS
have 9 digits)
put a '2' in front of this number, 044981841, and you get the member
id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia



=2999999999-(MID(A1,5,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,6,1))


That will work if your SSN is entered as text. If entered as a 9-digit number
and formatted to add the dashes (000-00-0000):

=2999999999-(MID(A1,4,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,5,1))


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default converting ssn's

Glenn wrote:
Glenn wrote:
tisaman wrote:
because of HIPAA, i need an excel formula to convert the 9 digit ssn
to a 10 digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel
formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so
ALWAYS have 9 digits)
put a '2' in front of this number, 044981841, and you get the member
id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia



=2999999999-(MID(A1,5,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,6,1))


That will work if your SSN is entered as text. If entered as a 9-digit
number and formatted to add the dashes (000-00-0000):

=2999999999-(MID(A1,4,1)&LEFT(A1,3)&RIGHT(A1,4)&MID(A1,5,1))



Actually, SSN's can start with zeros (but only 2). If you enter

1234567

and format it as

001-23-4567

use this:

=2999999999-(MID(RIGHT("00"&A1,9),4,1)&LEFT(RIGHT("00"&A1,9),3 )&RIGHT(RIGHT("00"&A1,9),4)&MID(RIGHT("00"&A1,9),5 ,1))
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default converting ssn's

Here is my contribution to the solution pool...

=2999999999-(MID(A1,5,1)&TEXT(SUBSTITUTE(A1,MID(A1,4,4),""),"0 000000")&MID(A1,6,1))

--
Rick (MVP - Excel)


"tisaman" wrote in message ...
because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default converting ssn's

On Tue, 2 Dec 2008 12:05:07 -0800, tisaman
wrote:

because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia



This should work if the SSN is entered as either text with the hyphens, or as a
number:

=2999999999-(MID(TEXT(SUBSTITUTE(A1,"-",""),"000000000"),4,1)&
REPLACE(TEXT(SUBSTITUTE(A1,"-",""),"000000000"),4,2,"")&MID(
TEXT(SUBSTITUTE(A1,"-",""),"000000000"),5,1))

--ron
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default converting ssn's

A little bit shorter...

=2999999999-(MID(A1,5-(LEN(A1)=9),1)&TEXT(SUBSTITUTE(A1,MID(A1,4,4-2*(LEN(A1)=9)),""),"0000000")&MID(A1,6-(LEN(A1)=9),1))

--
Rick (MVP - Excel)


"Ron Rosenfeld" wrote in message ...
On Tue, 2 Dec 2008 12:05:07 -0800, tisaman
wrote:

because of HIPAA, i need an excel formula to convert the 9 digit ssn to a 10
digit number beginning with a 2

here is the formula, i for the life of me can't figure out the excel formula

Example:
ssn is 550-98-1815
remove the middle '98' and you get 5501815
take the '9' from '98' and place it at the front 95501815
take the '8' from '98' and place it at the end 955018158
subtract this number, 955018158 from 999,999,999
and you get 044981841 (note the significant leading zero(s), so ALWAYS have
9 digits)
put a '2' in front of this number, 044981841, and you get the member id of
2044981841 (always 10 characters)

if you can come up with the formula i would be forever grateful
thanks
tonia



This should work if the SSN is entered as either text with the hyphens, or as a
number:

=2999999999-(MID(TEXT(SUBSTITUTE(A1,"-",""),"000000000"),4,1)&
REPLACE(TEXT(SUBSTITUTE(A1,"-",""),"000000000"),4,2,"")&MID(
TEXT(SUBSTITUTE(A1,"-",""),"000000000"),5,1))

--ron

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default converting ssn's

On Tue, 2 Dec 2008 22:58:04 -0500, "Rick Rothstein"
wrote:

A little bit shorter...

=2999999999-(MID(A1,5-(LEN(A1)=9),1)&TEXT(SUBSTITUTE(A1,MID(A1,4,4-2*(LEN(A1)=9)),""),"0000000")&MID(A1,6-(LEN(A1)=9),1))

--
Rick (MVP - Excel)



Yours does not seem work properly with numeric SSN entries that begin with 0 or
00.


  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default converting ssn's

I think it works with them if the cell is formatted as text (or if the entry starts with an apostrophe)... I assumed if there would be leading numbers, then the cell would be formatted as text to preserve them.

--
Rick (MVP - Excel)


"Ron Rosenfeld" wrote in message ...
On Tue, 2 Dec 2008 22:58:04 -0500, "Rick Rothstein"
wrote:

A little bit shorter...

=2999999999-(MID(A1,5-(LEN(A1)=9),1)&TEXT(SUBSTITUTE(A1,MID(A1,4,4-2*(LEN(A1)=9)),""),"0000000")&MID(A1,6-(LEN(A1)=9),1))

--
Rick (MVP - Excel)



Yours does not seem work properly with numeric SSN entries that begin with 0 or
00.

--ron

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default converting ssn's

On Wed, 3 Dec 2008 00:08:23 -0500, "Rick Rothstein"
wrote:

I think it works with them if the cell is formatted as text (or if the entry starts with an apostrophe)... I assumed if there would be leading numbers, then the cell would be formatted as text to preserve them.

--
Rick (MVP - Excel)


I agree with that.

However, when I wrote "numeric entries", I meant entries that were entered as
numbers, not as text.

Especially since SSN is one of the built-in special formats, I felt it
important to account for this.
--ron
  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default converting ssn's

Okay, yes, I can see that. Good point. Even without using the SSN built-in format, the OP might have simply use a number Custom Formatted as 000-00-0000 for the same effect.

--
Rick (MVP - Excel)


"Ron Rosenfeld" wrote in message ...
On Wed, 3 Dec 2008 00:08:23 -0500, "Rick Rothstein"
wrote:

I think it works with them if the cell is formatted as text (or if the entry starts with an apostrophe)... I assumed if there would be leading numbers, then the cell would be formatted as text to preserve them.

--
Rick (MVP - Excel)


I agree with that.

However, when I wrote "numeric entries", I meant entries that were entered as
numbers, not as text.

Especially since SSN is one of the built-in special formats, I felt it
important to account for this.
--ron

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trim all but the last four digits off a list of SSN's. [email protected] Excel Discussion (Misc queries) 2 November 24th 08 05:42 PM
Converting a date to a text field w/o converting it to a julian da LynnMinn Excel Worksheet Functions 2 March 6th 08 03:43 PM
Some of my SSN's are being treated as formulas Gina K Excel Discussion (Misc queries) 12 October 12th 07 08:19 PM
Converting USD$ to AUD$ Mike Excel Worksheet Functions 0 May 22nd 07 08:51 PM
Converting QIF to XLS JVinocur Excel Discussion (Misc queries) 3 March 31st 06 04:09 PM


All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"