Family Code, conditional automatic numbering

abshaw

Board Regular
Joined
Feb 12, 2004
Messages
53
I have the following excel sheet From column A through F. Based on the data provided i need to create a Person code with the following Logic conditions.

Person Code = Member ID + Individual Code
Individual Code is determined as follows

01=Primary; 02=Spouse; 03=Oldest Dependent; 04=Next Oldest Dependent

Condition:

02 code only belongs to a spouse, therefore in case of the absence of a spouse the first kid still get the code 03.


Your help is appreciated, thanks

Note: I would prefer to not use macros, any inline codes would help immensely.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I have the following excel sheet From column A through F. Based on the data provided i need to create a Person code with the following Logic conditions.

Person Code = Member ID + Individual Code
Individual Code is determined as follows

01=Primary; 02=Spouse; 03=Oldest Dependent; 04=Next Oldest Dependent

Condition:

02 code only belongs to a spouse, therefore in case of the absence of a spouse the first kid still get the code 03.



Record Type--------Member ID----First Name----Last Name-----DOB----------Relationship------Person Code------------Logic Help
PRIMARY-----------949011439----Jam-----------Bro----------8/15/1983------Primary----------94901143901-----------New Family
PRIMARY-----------949011458----Del------------Pro----------5/19/1954-----Primary----------94901145801-----------New Family
PRIMARY-----------949011459----Wal----------Who----------5/27/1970-----Primary----------94901145901-----------New Family
DEPENDENT--------949011459----Eil------------Who----------9/27/1970-----Spouse----------94901145902-----------Loop
DEPENDENT--------949011459----Mel-----------Who----------10/14/1994----Daughter--------94901145903-----------Loop
DEPENDENT--------949011459----Hea-----------Who----------10/24/1995----Daughter-------94901145904-----------Loop
DEPENDENT--------949011459----And-----------Who----------8/25/2005-----Son------------94901145905-----------Loop
PRIMARY-----------949011468----Ann----------Gold----------12/26/1969-----Primary--------94901146801-----------New Family
DEPENDENT--------949011468----Tho----------Gold----------12/27/2006-----Son------------94901146803-----------Loop
PRIMARY-----------949011489----Cla----------Cua----------12/12/1976------Primary--------94901148901-----------New Family
PRIMARY-----------949011530----bre----------duby---------1/22/1990-------Primary--------94901153001-----------New Family
PRIMARY-----------949011552----Jur----------Bal----------10/27/1973-------Primary--------94901155201-----------New Family
DEPENDENT--------949011552----Jur----------Bal----------6/4/2004----------Son------------94901155203-----------Loop
DEPENDENT--------949011552----Jer----------Bal----------7/27/2007---------Son------------94901155204-----------Loop



another thing to keep in mind is that the data will not always be sorted by the date of births (DOB) and the primary can sometimes come after its dependent.






Your help is appreciated, thanks

Note: I would prefer to not use macros, any inline codes would help immensely.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,877
Members
452,949
Latest member
Dupuhini

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