Test_Database_2021
New Member
- Joined
- Apr 6, 2021
- Messages
- 9
- Office Version
- 365
- 2016
- 2010
- Platform
- Windows
Hi everyone,
So in Excel 2010, I have a DATEDIF formula that works perfectly, which is:
=IF((AND(Y:Y<>"",B:B<>"")),DATEDIF([@[Date of inclusion]],[@[Date of discharge]],"d")/7,""),IF((AND(B:B<>"",Y:Y=""))
B shows the first date (date of inclusion)
Y shows the second date (date of discharge)
What I now want to do is to add a condition where when there is no second date (column Y is empty), the date difference is calculated according to a fixed date (31/12/2020).
So something like this:
=IF((AND(Y:Y<>"",B:B<>"")),DATEDIF([@[Date of inclusion]],[@[Date of discharge]],"d")/7,""),IF((AND(B:B<>"",Y:Y="")),DATEDIF(Y:Y,12/31/2020,"d"/7,""))
...but clearly, this doesn't work as you can't have two DATEDIF formulas with a "false = """ condition in the same cell.
Any ideas? Thanks!
So in Excel 2010, I have a DATEDIF formula that works perfectly, which is:
=IF((AND(Y:Y<>"",B:B<>"")),DATEDIF([@[Date of inclusion]],[@[Date of discharge]],"d")/7,""),IF((AND(B:B<>"",Y:Y=""))
B shows the first date (date of inclusion)
Y shows the second date (date of discharge)
What I now want to do is to add a condition where when there is no second date (column Y is empty), the date difference is calculated according to a fixed date (31/12/2020).
So something like this:
=IF((AND(Y:Y<>"",B:B<>"")),DATEDIF([@[Date of inclusion]],[@[Date of discharge]],"d")/7,""),IF((AND(B:B<>"",Y:Y="")),DATEDIF(Y:Y,12/31/2020,"d"/7,""))
...but clearly, this doesn't work as you can't have two DATEDIF formulas with a "false = """ condition in the same cell.
Any ideas? Thanks!