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)]))
¿Fue útil?

Solución

Try using this:

=IF([Leave Type]="Company off (In lieu of)", 12 - VALUE([Number of day(s)]), 0)
  1. 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(,).
  2. Return your calculated field as Number.

official documentation:

  1. Calculated Field Formulas.
  2. VALUE function
Licenciado bajo: CC-BY-SA con atribución
scroll top