Error with difference between dates - DATEDIF

%3CLINGO-SUB%20id%3D%22lingo-sub-1585344%22%20slang%3D%22en-US%22%3EError%20with%20difference%20between%20dates%20-%20DATEDIF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585344%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20keep%20getting%20an%20error%20when%20trying%20to%20find%20the%20days%20between%20two%20dates.%20I%20have%20used%20the%20%3DD2-C2%20function%20as%20well%20as%20%3DDATEDIF(C2%2CD2%2C%22D%22)%20and%20get%20and%20irrelevant%20date%20instead%20of%20number%20of%20days.%20E.g.%20I%20get%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22290px%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2296px%22%3EC%3C%2FTD%3E%3CTD%20width%3D%2292px%22%3ED%3C%2FTD%3E%3CTD%20width%3D%22101px%22%3EE%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%2296px%22%3E5%2F18%2F20%3C%2FTD%3E%3CTD%20width%3D%2292px%22%3E7%2F2%2F20%3C%2FTD%3E%3CTD%20width%3D%22101px%22%3E2%2F14%2F00%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3Eformula%20used%20%3DD2-C2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20do%20I%20fix%20this%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20for%20help%2C%26nbsp%3B%3C%2FP%3E%3CP%3ELindsay%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1585344%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1585401%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20with%20difference%20between%20dates%20-%20DATEDIF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585401%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F757729%22%20target%3D%22_blank%22%3E%40LMPayeur%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESelect%20the%20cell%20with%20the%20formula%20and%20select%20General%20as%20number%20format.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1585450%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20with%20difference%20between%20dates%20-%20DATEDIF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585450%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%20Thank%20you!%20I%20knew%20it%20must%20be%20an%20easy%20fix%20like%20that%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3B%20-%20Lindsay%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

I keep getting an error when trying to find the days between two dates. I have used the =D2-C2 function as well as =DATEDIF(C2,D2,"D") and get and irrelevant date instead of number of days. E.g. I get 

CDE
5/18/207/2/202/14/00

formula used =D2-C2

 

How do I fix this? 

 

Thank for help, 

Lindsay 

2 Replies

@LMPayeur 

Select the cell with the formula and select General as number format.

@Hans Vogelaar  Thank you! I knew it must be an easy fix like that   - Lindsay