Hello Together,
I would like to create an IF formula to categorize the "days" information what I got in the "Days until due date" column.
Do you have any idea what can be the issue? The error message show me "Invalid type in operator <."
Thansk in advance,
IF [Days until due date]>60
THEN "Overdue > 60 days"
ELSEIF [Days until due date]>31 and [Days until due date]<=60
THEN "Overdue 31-60 days"
ELSEIF [Days until due date]>21 and [Days until due date]<=30
THEN "Overdue 21-30 days"
ELSEIF [Days until due date]>11 and [Days until due date]<=20
THEN "Overdue 11-20 days"
ELSEIF [Days until due date]>=0 and [Days until due date]<=10
THEN "Overdue < 10 days"
ELSEIF [Days until due date]<0 and [Days until due date]>=-5
THEN "Due in 5 days"
ELSEIF [Days until due date]<-5 and [Days until due date]>=-10
THEN "Due in 10 days"
ELSEIF [Days until due date]<-10 and [Days until due date]>=-20
THEN "Due in 20 days"
ELSEIF [Days until due date]<-20
THEN "Due in 30 days"
ELSE ""
ENDIF
Solved! Go to Solution.
Hi @bakaidora
As @Jean-Balteryx said it could be possible [Days until due date] isn't numeric.
You can convert it to numeric by
1. Using select tool before to convert to numeric (int/double)
or
2. Use tonumber([Days until due date]) instead of [Days until due date].
Hope this helps : )
Also you should replace "<" by "<=" for values 31,21 and 11 as they are not in any range being excluded.
I'd suggest the first solution offered by @atcodedog05 as it will get you better performances because you won't change type each time you check a condition.
@Jean-Balteryx wrote:
Also you should replace "<" by "<=" for values 31,21 and 11 as they are not in any range being excluded.
Good catch on this @Jean-Balteryx 🙂👍
Thanks for the help, it was the issue what you mentioned. 🙂 I used the Select tool for type change.
I changed the "<" to "<=" in case of 31,21,11, as well. 🙂
Thanks again and have a nice day.
You are welcome ! Have a great day ! 🙂
User | Count |
---|---|
109 | |
92 | |
78 | |
54 | |
40 |