Hi,
Here is my problem with time calculation:
Field 1 = Date 1
Field 2 = Date 2
Field 3 = Checkbox
Field 4 = duration if checkbox is ticked (=age at date 2)
Field 5 = duration until today if checkbox is not ticked (=age today)
Here are my formulas:
Field 4
IFNOTEMPTY(CHECKBOX;YYMM(DATE1;DATE2);NULL)
Returns=Text
Expected result if checkbox is ticked: 4 years, 2 months ==> OK
Expected result if checkbox is not ticked: blank ==> Not OK: the field displays -44 years, -2 months
Field 5
IFEMPTY(CHECKBOX;YYMM(DATE1;TODAY());NULL)
Returns=Text
Expected result if checkbox is ticked: blank ==> OK
Expected result if checkbox is not ticked: 12 years, 10 months ==> Not OK, the field remains blank
Could you explain what I am doing wrong?
Thank you very much
patrice
I think checkbox contains either value 0 or 1. So it is always not empty. Try to do a value comparison instead.
Hi Patrice,
As Daniel suggested correctly, a checkbox contains 0 or 1.
So instead of IFEMPTY
, use IF
.
For example:
IF(CHECKBOX = 1; YYMM(DATE1; DATE2); "")
Works fine
thank you Daniel and Brendan