Please help me fix my Excel formula

%3CLINGO-SUB%20id%3D%22lingo-sub-1332694%22%20slang%3D%22en-US%22%3EPlease%20help%20me%20fix%20my%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1332694%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20create%20a%20formula%20to%20calculate%20the%20difference%20between%20two%20dates%20(year%2C%20month%2C%20and%20day)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20start%20date%20is%203%2F13%2F02%20(E2)%20and%20the%20end%20date%20is%205%2F1%2F20%20(G2).%20Here%20is%20my%20formula%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DDATEDIF(E2%2CG2%2C%22y%22)%26amp%3B%22years%2C%22%3CBR%20%2F%3E%26amp%3BDATEDIF(E2%2CG2%2C%22ym%22)%26amp%3B%22months%2C%22%3CBR%20%2F%3E%26amp%3BG2-DATE(YEAR(G2)%2CMONTH(G2)%2C1)%26amp%3B%22days%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20can%20see%20on%20the%20attached%20screenshot%2C%20it%20is%20returning%26nbsp%3B%3CSPAN%20class%3D%22big%22%3E18%20years%2C%201%20month%2C%200%20days.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22big%22%3EAccording%20to%20my%20calculation%2C%20it%20should%20be%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22big%22%3E18%20years%2C%201%20month%2C%2019%20days%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bincluding%20the%20end%20date.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPlease%20help%20me%20figure%20out%20what%20I%20did%20incorrectly.%20I%20am%20not%20a%20techie%2C%20so%20if%20you%20could%20explain%20in%20easy-to-understand%20terms%2C%20I%20would%20greatly%20appreciate%20it.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1332694%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1332716%22%20slang%3D%22en-US%22%3ERe%3A%20Please%20help%20me%20fix%20my%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1332716%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F634416%22%20target%3D%22_blank%22%3E%40Cat09142020%3C%2FA%3E%26nbsp%3B%20your%20day%20calculation%20is%20subtracting%20G2%20-%20%E2%80%A6(G2)%20%E2%80%A6%20(G2).%20..%20or%20in%20another%20words%20you%20are%20getting%200%20because%20you%20are%20subtracting%20it%20from%20itself.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

I am trying to create a formula to calculate the difference between two dates (year, month, and day)

 

The start date is 3/13/02 (E2) and the end date is 5/1/20 (G2). Here is my formula:

 

=DATEDIF(E2,G2,"y")&"years,"
&DATEDIF(E2,G2,"ym")&"months,"
&G2-DATE(YEAR(G2),MONTH(G2),1)&"days"

 

As you can see on the attached screenshot, it is returning 18 years, 1 month, 0 days.

 

According to my calculation, it should be 18 years, 1 month, 19 days including the end date.

 

Please help me figure out what I did incorrectly. I am not a techie, so if you could explain in easy-to-understand terms, I would greatly appreciate it.

 

Thanks!

1 Reply
Highlighted

@Cat09142020  your day calculation is subtracting G2 - …(G2) … (G2). .. or in another words you are getting 0 because you are subtracting it from itself.