+ Reply to Thread
Results 1 to 7 of 7

convert the birth date to the current /next year with specific conditions

  1. #1
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    convert the birth date to the current /next year with specific conditions

    Greetings for the day.

    I'm looking for a formula that can convert the birthday date on the "E column" to the current/next year carrying the same day and month, and that will be dependent on the month given at the birthday date on the "E column".

    The first logic is if the birthday month on the "E column" has already passed, then the return birthday date will be converted to the next year on the "D column.

    The second logic is if the birthday month on the "E column" is matching the current month or coming next then the return birthday date will be converted to this year on the "D column.

    And if the cell is empty in the "E column" then it should return an empty value in the "D column.

    I hope to find the correct formula that can cover the full condition mentioned above.

    I have attached a screenshot as well as the worksheet for reference.

    2323322322.jpg
    Book22656.xlsx

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,420

    Re: convert the birth date to the current /next year with specific conditions

    Maybe this?

    =IF(E5="","",IF(DATE(YEAR(TODAY()),MONTH(E5),DAY(E5))<TODAY(),DATE(YEAR(TODAY())+1,MONTH(E5),DAY(E5)),DATE(YEAR(TODAY()),MONTH(E5),DAY(E5))))

    You should know by now that you should add at least some manually calculated expected results to your sample workbook.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    Re: convert the birth date to the current /next year with specific conditions

    @AliGW this is amazing and it worked perfectly.

    But one more condition is missing! and that is when there is no date mentioned in the "E column" the formula should return an empty result.

  4. #4
    Registered User
    Join Date
    11-18-2014
    Location
    Uganda
    MS-Off Ver
    2013
    Posts
    25

    Re: convert the birth date to the current /next year with specific conditions

    @AliGW has already included that at the very beginning of the function. It work as per your request.

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: convert the birth date to the current /next year with specific conditions

    Another way:

    =IF(E5="","",EDATE(E5,FLOOR(DATEDIF(E5,TODAY()-1,"m"),12)+12))

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,420

    Re: convert the birth date to the current /next year with specific conditions

    Quote Originally Posted by MAJID1479 View Post
    @AliGW this is amazing and it worked perfectly.

    But one more condition is missing! and that is when there is no date mentioned in the "E column" the formula should return an empty result.
    No, not missing: it was included in the formula I offered.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) 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.

  7. #7
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    Re: convert the birth date to the current /next year with specific conditions

    @AliGW apologize for missing that area as well, yeh it's fully recovered and working perfectly.

    thank you again and have a wonderful day ahead.

    this is a fantastic platform and outstanding members.

    thank you always.

+ 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. vba if any date in not belongs to current year then convert the date in current year
    By nkashyap3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2019, 07:13 AM
  2. generating year of birth based on date and age
    By isawalha in forum Excel General
    Replies: 6
    Last Post: 06-29-2016, 07:07 AM
  3. [SOLVED] Need help in sorting date of birth irrespective of year
    By SMILE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-07-2013, 06:05 AM
  4. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  5. Need help in adjusting date of birth year
    By ChetForce in forum Excel General
    Replies: 5
    Last Post: 05-08-2012, 11:15 AM
  6. formula to calculate age using birth date and current date
    By lalah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-20-2005, 06:55 PM
  7. convert date of birth to current age
    By paralegal in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-21-2005, 09:34 PM

Tags for this Thread

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