Formulas using conditional "if" , "and", "or" according to dates

%3CLINGO-SUB%20id%3D%22lingo-sub-2568225%22%20slang%3D%22en-US%22%3EFormulas%20using%20conditional%20%22if%22%20%2C%20%22and%22%2C%20%22or%22%20according%20to%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2568225%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20for%20some%20help%20with%20one%20formula%20on%20the%20Excel%20database%20I'm%20working%20on%20(column%20Q).%3C%2FP%3E%3CP%3EIt%20is%20about%20calculating%20the%20delay%20(in%20%23%20days)%20between%20two%20dates.%20The%20problem%20with%20making%20this%20difference%20is%20that%20only%20one%20of%20them%20is%20fixed%20and%20the%20other%20varies%20(depending%20on%20the%20date).%20I%3C%2FP%3E%3CP%3En%20the%20attached%20Excel%20I%20had%20to%20do%20it%20case%20by%20case%20(row%20by%20row)%20for%20column%20Q%2C%20but%20I'm%20looking%20for%20a%20formula%20to%20automate%20it.%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help%20and%20advice!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJohn%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%3A%26nbsp%3BI%20also%20had%20doubts%20about%20my%20column%20C%20and%20D%20formulas%20but%20they%20seem%20to%20work.%20Feel%20free%20to%20give%20me%20your%20opinion%20on%20them.%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2568225%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2623999%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20using%20conditional%20%22if%22%20%2C%20%22and%22%2C%20%22or%22%20according%20to%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2623999%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1108459%22%20target%3D%22_blank%22%3E%40Johnpen21%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eclick%20the%20link%20in%20your%20sample%20workbook%20or%20go%20to%3CA%20href%3D%22https%3A%2F%2Fexceljet.net%2Fformula%2Fget-days-months-and-years-between-dates%23%3A~%3Atext%3DTo%2520calculate%2520and%2520display%2520the%2520time%2520between%2520dates%2Cdifference%2520between%2520dates%2520in%2520years%252C%2520months%252C%2520and%2520days.%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexceljet.net%2Fformula%2Fget-days-months-and-years-between-dates%23%3A~%3Atext%3DTo%2520calculate%2520and%2520display%2520the%2520time%2520between%2520dates%2Cdifference%2520between%2520dates%2520in%2520years%252C%2520months%252C%2520and%2520days.%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Echeers%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2624575%22%20slang%3D%22en-US%22%3ERe%3A%20Formulas%20using%20conditional%20%22if%22%20%2C%20%22and%22%2C%20%22or%22%20according%20to%20dates%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2624575%22%20slang%3D%22en-US%22%3EHere%20is%20an%20example%20without%20an%20error%20display%20if%20there%20is%20no%20date%20in%20a%20cell.%3CBR%20%2F%3E%3DIF(ISERROR(DATEDIF(B2%2CA2%2C%22d%22))%2CDATEDIF(A2%2CB2%2C%22d%22)%2CDATEDIF(B2%2CA2%2C%22d%22))%3CBR%20%2F%3E%3CBR%20%2F%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3CBR%20%2F%3E%3CBR%20%2F%3ENikolino%3CBR%20%2F%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

 

I'm looking for some help with one formula on the Excel database I'm working on (column Q).

It is about calculating the delay (in # days) between two dates. The problem with making this difference is that only one of them is fixed and the other varies (depending on the date). I

n the attached Excel I had to do it case by case (row by row) for column Q, but I'm looking for a formula to automate it.

Thank you in advance for your help and advice!

 

John

 

PS: I also had doubts about my column C and D formulas but they seem to work. Feel free to give me your opinion on them. Thank you!

2 Replies
Here is an example without an error display if there is no date in a cell.
=IF(ISERROR(DATEDIF(B2,A2,"d")),DATEDIF(A2,B2,"d"),DATEDIF(B2,A2,"d"))

I would be happy to know if I could help.

Nikolino
I know I don't know anything (Socrates)