+ Reply to Thread
Results 1 to 4 of 4

how to calculate DOB if date format is differ

  1. #1
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    168

    Question how to calculate DOB if date format is differ

    HI
    in my excel file im calculating DOB with datedif formula if the date format is Day, Month, Year in 2016 microsoft office
    if the date format is month day year the the formula is not working, can you help with this.

    and same formula is working month day year in 2010 microsoft office
    not working in Day, Month, Year format.

    attached file is for your convenience

    TIA
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    8,075

    Re: how to calculate DOB if date format is differ

    How do you know with: 12/11/1990, which month is?

  3. #3
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    168

    Re: how to calculate DOB if date format is differ

    bebo021999 is not possible, but we use only one format
    1. day month year or
    2. month day year,

    if we use number 2 month day year, then is if possible to calculate DOB ?

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    8,075

    Re: how to calculate DOB if date format is differ

    Would suggest two options:

    1) use helper in C2 to convert D2 to properly date:
    =IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0))

    2) Replace D2 with (1) (use Ctrl-H) which I did in column F
    =IF(DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"y")=0,"",DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"y")&" Years, ")& IF(DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"ym")=0,"",DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"ym")&" Months, ")& IF(DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"md")=0,"",DATEDIF(IFERROR(D2+0,DATE(RIGHT(D2,4)+0,LEFT(D2,2)+0,MID(D2,4,2)+0)), E2,"md")&" Days")
    Attached Files Attached Files

+ 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 code to format borders of two sheets which differ in ranges
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2018, 06:43 AM
  2. [SOLVED] Calculate date format and age after certain years
    By Rocky2013 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-24-2018, 08:02 PM
  3. Replies: 2
    Last Post: 02-07-2018, 01:29 PM
  4. Send an email with a dynamic range of cells that differ depending on the date
    By clementvenot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2017, 05:58 AM
  5. [SOLVED] Recognizing a date format to calculate date in the future
    By Nole68 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2015, 12:51 PM
  6. [SOLVED] Date format problem using a formula in VBA to calculate difference between times and dates
    By alicebrewer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2012, 03:13 AM
  7. How to calculate just the year for a date format
    By BNCOXUK in forum Excel General
    Replies: 4
    Last Post: 07-04-2012, 11:52 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