title: Calculate age from personal number when birth year only has two numbers
body: <p>I know there is A LOT of questions resembling this. BUT I'm not asking the same!</p>
  
  <p>My problem is that all of the questions which I've looked at has birthdays with the whole year, fx 04/05/1971 (format: %d/%m/%Y). </p>
  
  <p>The birthdays in my data is Danish CPR-numbers (personal identification numbers), and they look like this: </p>
  
  <pre><code>   ID
  1901912222
  0110841111
  0404143333
  1602032444
  </code></pre>
  
  <p>NB: Those dates are examples. I have thousands of rows and it's people in all ages, also above 100 (but most often no more than 17). </p>
  
  <p>1st and 2nd number: day of birth
  3rd and 4th number: month of birth
  5th and 6th number: year of birth
  The last four = Sequential number. </p>
  
  <p>So this gives me the birthdays (and ages): </p>
  
  <pre><code>   ID         birthdate      age
  1901912222    19/09/91        26
  0110841111    01/10/84        33
  0404143333    04/04/14        103
  1602024444    16/02/02        15
  </code></pre>
  
  <p>So the format is: %d%m%y[the sequential number of 4 digits]</p>
  
  <p>So the last four digits (the sequential number) also has some information. They tell if the person is fx 3 or 103 years old (now that I don't have the year). 
  See the image for description: </p>
  
  <p><a href="https://i.stack.imgur.com/ZyKWM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZyKWM.png" alt="Birth year and sequential number"></a></p>
  
  <p>I don't know if it's any help, but I have the Excel code: </p>
  
  <p>=YEAR(NOW())-1-IF(DATE(YEAR(NOW());MID(D12;3;2);LEFT(D12;2))&lt;=NOW();MID(D12;5;2)+IF(LEFT(RIGHT(D12;4);1)*1&lt;=3;1900;IF(AND(LEFT(RIGHT(D12;4);1)*1=4;MID(D12;5;2)*1&lt;=36);2000;IF(AND(LEFT(RIGHT(D12;4);1)*1=4;MID(D12;5;2)*1>=37);1900;IF(AND(LEFT(RIGHT(D12;4);1)*1>=5;LEFT(RIGHT(D12;4);1)*1&lt;=8;MID(D12;5;2)*1&lt;=57);2000;IF(AND(LEFT(RIGHT(D12;4);1)*1>=5;LEFT(RIGHT(D12;4);1)*1&lt;=8;MID(D12;5;2)*1>=58);1800;IF(AND(LEFT(RIGHT(D12;4);1)*1=9;MID(D12;5;2)*1&lt;=36);2000+MID(D12;5;2);1900))))))-1;MID(D12;5;2)+IF(LEFT(RIGHT(D12;4);1)*1&lt;=3;1900;IF(AND(LEFT(RIGHT(D12;4);1)*1=4;MID(D12;5;2)*1&lt;=36);2000;IF(AND(LEFT(RIGHT(D12;4);1)*1=4;MID(D12;5;2)*1>=37);1900;IF(AND(LEFT(RIGHT(D12;4);1)*1>=5;LEFT(RIGHT(D12;4);1)*1&lt;=8;MID(D12;5;2)*1&lt;=57);2000;IF(AND(LEFT(RIGHT(D12;4);1)*1>=5;LEFT(RIGHT(D12;4);1)*1&lt;=8;MID(D12;5;2)*1>=58);1800;IF(AND(LEFT(RIGHT(D12;4);1)*1=9;MID(D12;5;2)*1&lt;=36);2000+MID(D12;5;2);1900)))))))</p>
  
  <p>I really do hope you can help me with this problem!</p>