+ Reply to Thread
Results 1 to 45 of 45

How to find age of a birthday

  1. #1
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    How to find age of a birthday

    Hi

    I have googlet and found stuff that could help me.

    But not the hole way.

    I have some birthdays in this format which is 12. oct. 1966

    121066

    Further more there are 4 numbers behind this so that it says

    1210663455


    I'm looking for a solution where I can get the age of this birthday.
    the age shall be shown from a specific date that is located in another field.

    So... find age for 1210663455

    Do this on the date specified ib CELL A1 (could be ex. 111121 which is 11.nov. 2021)

    Is that possible for excell newbe as me :-)

  2. #2
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    =DATEDIF(TEXT(LEFT(LEFT(C6,6),2)&"-"&MID(LEFT(C6,6),3,2)&"-"&RIGHT(LEFT(C6,6),2),"dd-mm-yy"),TODAY(),"Y")&" Years"

    this should work, assuming 1210663455 is the standard format of the data from which you need to find the age, ie 6 characters of date, followed by 4 other numbers.
    Give a sec to give rep to all who tried to help

  3. #3
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Thanks...

    seems to fail ...

    But maybe just because I don't understand the code.

    Some extra info:

    Not english excell version
    my cell are text fields

    If you have the time could you explain what the code does...?

  4. #4
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,419

    Re: How to find age of a birthday

    https://en.excel-translator.de/translator/
    Please Login or Register  to view this content.
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  5. #5
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    to walk you through, i did this by combining 4 steps into one.

    1. extracting date from 1210663455
    2. inserting - to make the text look "dd-mm-yy"
    3. Finding difference of date from today's date
    4. adding "years" into the result (completely optional)

    1. to extract the date, i simply used LEFT function, since the date is the left 6 charactes from 1210663455
    2. to add in the "-" between the numbers, i used left, mid & right functions along with "&" function
    3. to find the difference between dates, i used datedif function
    4. to add the "years", i simply put &" years" at the end of the formula

    =DATEDIF(LEFT(LEFT(C6,6),2)&"-"&MID(LEFT(C6,6),3,2)&"-"&RIGHT(LEFT(C6,6),2),TODAY(),"Y")&" Years"

    you can use this function instead because the text function in the earlier version is unnecessary.

    how to work on the same with a different language is unknown to me.

  6. #6
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    ah.. nice thanks :-)
    But I do understand english

    But I dont understand "code" :-)

    Should I place 1210663455 in C6 and run this code in ex. C7 or any other cell and get result there?

    Is there a way to calculate from a selected date and not today?
    Last edited by kodenkoden; 11-18-2021 at 08:35 AM.

  7. #7
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    you can place 1210663455 in c6 and run the formula (code) in any other cell, you will get the result there.

    you can replace c6 in the formula (code) with your desired cell number (where your actual data is) and it will still work.

    To calculate age from a selected date, you can simply replace the "TODAY()" with cell reference of the selected date.
    example: if you want to calculate age of 1210663455 with 01/01/2021 entered in cell b7, you can replace "today()" with "b7" and get the desired result.

    hope this helps

  8. #8
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    how to work on the same with a different language is unknown to me.
    I was not mentioning your english skills here. the formula/code varies with MS Office Language. like Bsalv has mentioned in his formula, "," wont work with other language setup excels. instead you may have to use ";"

    my knowledge on this matter is limited.

  9. #9
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    C8 holds the code

    =DATEDIF(LEFT(LEFT(C6,6),2)&"-"&MID(LEFT(C6,6),3,2)&"-"&RIGHT(LEFT(C6,6),2),a1(),"Y")&" Years"

    Only changed today with a1

    But as you see it gives me a high number :-)
    Using my english work pc now.


    agePNG.PNG

  10. #10
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    as you can clearly see in your screen snap, C8 holds only "=A1" and not the code.

    also, you have to replace the "today()" entirely with cell reference.

    in the formula you have mentioned a1(). that is unnecessary and will result in an error.. instead use this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Abith; 11-18-2021 at 09:23 AM.

  11. #11
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    i have attached a sheet with the formula. ill be going offline soon and hope the sheet attached will help you with your doubts.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    hmm.. sorry what did I create in C8 :-)

    thanks a lot ..
    it works fine... just what I needed.

  13. #13
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Hi again

    Thanks a lot ...again for a nice code to use. :-)

    Is there some way to put in code in this string, that could mark all 65 years and older with green color or Bolt numbers or anything that makes them easy to find?

  14. #14
    Registered User
    Join Date
    08-07-2021
    Location
    Manama, Bahrain
    MS-Off Ver
    2016
    Posts
    61

    Re: How to find age of a birthday

    You're welcome.

    Yes you can use conditional formatting to do that. that would not be a part of the formula/code though.

    select the area where the age will appear (in this case, the entire column), go to conditional formatting, highlight cell rules, more rules, (refer the screensnip), enter the value, select the desired format, click ok.

    If that takes care of your original query, please mark this as solved. you might not be aware of this but you can actually thank those who took effort to help with your query by clicking on the star (add reputation) in the bottom left corner of the post and comment on the level of help you got from the user.
    Attached Images Attached Images
    Last edited by Abith; 11-21-2021 at 07:04 AM.

  15. #15
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    thanks a lot

    add reputation done :-)
    solved

  16. #16
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Hi again...

    I just found out that I dont need age from a specific date.
    I just need to find who is having 65 birthday in 2021

    Can I put this into the formel to find evrybody being 65 this year?

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    Try this:

    =YEAR(TODAY())-YEAR(DATE(MID(A1,5,2),MID(A1,3,2),LEFT(A1,2)))=65

    AliGW on MS365 Insider (Windows) 64 bit
    A
    B
    1
    1210663455
    FALSE
    2
    1210563477
    TRUE
    Sheet: Sheet2

  19. #19
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    thanks.. yes I did look at the start
    But cant get it work

    What I use now is this

    =+DATO.FORSKEL(VENSTRE(VENSTRE(A1;6);2)&"-"&MIDT(VENSTRE(A1;6);3;2)&"-"&HØJRE(VENSTRE(A1;6);2);C1;"Y")

    Which give me age of the person on the date located in C1
    I could then fill out c1 with 01-01-2021 and my problem was solved.

    But if possible I would like to have that in the code so that c1 is 01-01-2021 in some way.

    Sorry I'm so bad at understanding this code

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    Attach a sample workbook as requested in post #17.

    Did you try my suggestion?

  21. #21
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,405

    Re: How to find age of a birthday

    Power Query
    Please Login or Register  to view this content.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    yes..
    create new sheet

    a1= 1210663455
    a2= 1210563477

    b1 and b2 your code... but gives error

    Capture.PNG
    Last edited by kodenkoden; 11-27-2021 at 10:16 AM.

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    You need to change commas to semi-colons for your Danish locale:

    =ÅR(IDAG())-ÅR(DATO(MIDT(A1;5;2);MIDT(A1;3;2);VENSTRE(A1;2)))=65

  24. #24
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    ahh off course :-)
    thanks
    yes now i get false or 65 on all dates from 01012021 and forward.

    perfect and THANKS !!!

  25. #25
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    If you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  26. #26
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Hi

    yes I know the reputation and did it the day :-)

    I ran into a problem....

    I have a column A1 to A100 with a lot of birthdays
    I have put the code in B1 and pulled the corner all way down so that all B cells have the code that match

    in line 3 i have this birtdday:

    2008561204

    =ÅR(IDAG())-ÅR(DATO(MIDT(A3;5;2);MIDT(A3;3;2);VENSTRE(A3;2)))=65

    in line 35 i have this:

    2102552433

    =ÅR(IDAG())-ÅR(DATO(MIDT(A35;5;2);MIDT(A35;3;2);VENSTRE(A35;2)))=65


    Only line 3 get TRUE

    The other is false but should have been true

    Am I doing something wrong...

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

  28. #28
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Thanks... I will try upload later today.

  29. #29
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    here it is uploaded..
    As you can se 3 should be true but only 1 is
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    does it make sence?

  31. #31
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    Is this what you really wanted?

    =YEAR(TODAY())-YEAR(DATE(MID(A1,5,2),MID(A1,3,2),LEFT(A1,2)))>=65

  32. #32
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    yes perfect... this shows all that is 65 or older on 0101-2021 and later

  33. #33
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    Had you said that in post #1, we'd have reached a conclusion very much faster!

    Glad to help.

  34. #34
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    thanks again again :-)

    in #16 I tried to explain it... but maybe it's to misunderstand :-)
    Last edited by kodenkoden; 11-30-2021 at 01:34 PM.

  35. #35
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    In post #16 you said this:

    I just need to find who is having 65 birthday in 2021
    That's not actually what you wanted, but it is what you asked for and what I gave you. That's why there was only ONE result: there is only one person on the list who turns 65 in 2021.

  36. #36
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,405

    Re: How to find age of a birthday

    PQ fixed
    Please Login or Register  to view this content.
    Attached Files Attached Files

  37. #37
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Hi AliGW

    just one little problem :-)

    When born in 2000 and forwards they get TRUE...
    Last edited by kodenkoden; 12-01-2021 at 04:11 AM.

  38. #38
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    thanks Czeslaw.
    I did look at it but not sure hw you get there.

    Do you convert the numbers in column 1 to dates in column 2 and in column 3 your find the age from column 2?

  39. #39
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    when born in 2000 and forwards they get true...
    OK - try this:

    =YEAR(TODAY())-(IF(MID(A1,5,2)<=RIGHT(YEAR(TODAY()),2),20,19)&MID(A1,5,2))>=65

    =ÅR(IDAG())-(HVIS(MIDT(A1;5;2)<=HØJRE(ÅR(IDAG());2);20;19)&MIDT(A1;5;2))>=65

    Next time you ask a question, provide a set of sample data that includes ALL eventualities. This will save you a lot of time and prevent your helpers going round in circles.
    Last edited by AliGW; 12-01-2021 at 04:35 AM.

  40. #40
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Thanks again

    If I myself was aware of this issue I would have told you.. :-)

    I appriciate the time you use on this. It helps me a lot.


    Is there a way to change this on all my sheets, so that I dont have to do it manually?

    To change the code on all sheets column B and further more the conditional formatting also on column B

    I did it on the first sheet and maybe there is a way to copy this to the 20 other sheets, without deleting A and B column content.
    Last edited by kodenkoden; 12-01-2021 at 11:27 AM.

  41. #41
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    If I myself was aware of this issue I would have told you.. :-)
    Oh, so you didn't know you'd have dates after 1999 in the list? Fair enough.

    I'm not clear on the problem you are having copying the formula from one sheet to another. If the layout is the same, just copy the formula from the address bar, go to the next sheet and paste it into C1, then drag copy down. It would take no more than a couple of minutes to do this for 20 sheets. Maybe I haven't understood the issue.

    As for the conditional formatting, you will probably have to set this up for each sheet, however it's one rule and can be applied to a range.

    If you want to share a more comprehensive sample workbook that demonstrates the issues you think you have, I can take a look. Without one, I am simply guessing.

  42. #42
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Re: How to find age of a birthday

    Hi

    No at the time I started this thread I did not know that there would be school children and young.

    You are right... manual is faster than trying something special..will do that.

  43. #43
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: How to find age of a birthday

    Glad I was able to help, anyway. We got there in the end!

  44. #44
    Registered User
    Join Date
    11-18-2021
    Location
    denmark
    MS-Off Ver
    2019
    Posts
    25

    Wink Re: How to find age of a birthday

    yepper..thanks

  45. #45
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,405

    Re: How to find age of a birthday

    Lithuanija 32307310817 man 1900-1999
    42307310817 women 1900-1999
    51407310817 man 2000-2099
    61407310817 women 2000-2099

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Birthday Tracker
    By moonbeams in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-23-2018, 03:02 AM
  2. Find all the names with same birthday
    By tpsdas in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-01-2018, 06:47 AM
  3. [SOLVED] Find out who's birthday it maybe today()
    By Excelski in forum Excel General
    Replies: 3
    Last Post: 06-14-2017, 07:16 PM
  4. birthday notification
    By isaacko in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2014, 10:09 PM
  5. Birthday
    By rph123 in forum Excel General
    Replies: 6
    Last Post: 02-04-2012, 11:55 AM
  6. My boy's 1st Birthday!
    By NBVC in forum The Water Cooler
    Replies: 10
    Last Post: 02-06-2009, 12:57 PM
  7. Find Birthday of persons which falls between the given two dates
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2008, 09:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1