I'm trying to use the below formula to execute results when [days old] column has the the respective values. I'm receiving incorrect values in the new column.
IF [Days_old] <='0' THEN 'Current'
ELSEIF [Days_old] <='30' THEN '1-30 days'
ELSEIF [Days_old] <='90' THEN '31-90 days'
ELSEIF [Days_old] >'91' THEN 'exceeds 90 days'
ELSEIF [Days_old] >'181' THEN 'exceeds 180 days'
ELSE "ERROR" ENDIF
Any help in rectifying the error will be appreciated. Thanks
Solved! Go to Solution.
Check the field type. If its double, dont use the quotations.
IS your [Days_old] column being stored as a number? If that's the case, I would remove the quotes around the numbers
IF [Days_old] <=0 THEN 'Current'
ELSEIF [Days_old] <=30 THEN '1-30 days'
ELSEIF [Days_old] <=90 THEN '31-90 days'
ELSEIF [Days_old] >91 THEN 'exceeds 90 days'
ELSEIF [Days_old] >181 THEN 'exceeds 180 days'
ELSE "ERROR" ENDIF
Otherwise what errors are you seeing?
Hi @geeklarokcmie,
I think for the greater than and less than symbols to work how you want them, then the Days_old field needs to be a number format. You also want to remove the single quotes around the numbers since it isn't a text field. I switched up the formula a little in my test (attached) that might work better.
IF [Days_old] <=0 THEN 'Current'
ELSEIF [Days_old] <=30 THEN '1-30 days'
ELSEIF [Days_old] <=90 THEN '31-90 days'
ELSEIF [Days_old] <=180 THEN 'exceeds 90 days'
ELSEIF [Days_old] >180 THEN 'exceeds 180 days'
ELSE "ERROR" ENDIF
Hi, @geeklarokcmie
Consider the below. I hope you find it helpful - Cheers!
IF ToNumber([Days_old]) >180 THEN "exceeds 180 days"
ELSEIF ToNumber([Days_old]) >90 THEN "91-180 days"
ELSEIF ToNumber([Days_old]) >30 THEN "31-90 days"
ELSEIF ToNumber([Days_old]) >0 THEN "1-30 days"
ELSEIF ToNumber([Days_old]) <=0 THEN "Current"
ELSE "ERROR"
ENDIF
Thank you. Will certainly try that.