Forum Discussion
Sheltdr8
Jan 25, 2022Copper Contributor
Compare dates not working correctly
I am trying to compare two date sets and if the Age column is greater than the $X$2 (Age Max) column than place an X in an X Value cell. It almost works but if the month is 10, 11, or 12 it only look...
NowshadAhmed
Jan 26, 2022Iron Contributor
In the formula '=IF([@Age]>$X$2,"X","")', I see that both [@Age] and [@Age Max] has text in the value. It is only natural that excel would fail to compare logically.
I would advice not to do what you did in [@Age] and [@Age Max] cells.
Instead, try the following:
1. IF([@Age]>$X$2,"X","") # Keep this formula in [@X Value] as it is or change as required
2. TODAY()-[@Birthdate] # Use this for [@Age]. To show in years and months, set the custom cell/column format to: yy "Years and" mm "Months"
3. For [@Age Max], try to define in terms of Excel date: dd/mm/year. for example Max 0 years and 6 months would be 1/6/0 # To show in years and months, set the custom cell/column format to: yy "Years and" mm "Months"
- NowshadAhmedJan 26, 2022Iron ContributorOr use: yy "Years," mm "Months"
to show: 2 Year, 2 Months format.