Calculated column in SharePoint list - Conditional formula for finding difference
-
13-02-2021 - |
Pregunta
I am working on creating a leave tracker list. For that, I have added a column for Leave Type with 4 choices with 1 choice being company off.
I want to add another column that says => Comp offs left which should calculate the difference between the total number of comp off lefts, i.e. 12-Number of days(s) leave requested for if the leave type is comp off.
I tried to use simple if statement but getting the value as No. I tried using int function and that too does not work.
=IF([Leave Type]="Company off (In lieu of)",12-int([Number of day(s)]))
Solución
Try using this:
=IF([Leave Type]="Company off (In lieu of)", 12 - VALUE([Number of day(s)]), 0)
- Sometimes comma(
,
) does not work in formula (I am not sure but it is based on something language or regional settings on your site). So in that case use semicolon(;
) instead of comma(,
). - Return your calculated field as Number.
official documentation:
Licenciado bajo: CC-BY-SA con atribución
No afiliado a sharepoint.stackexchange