Thanks a lot for the comment!

But when I changed to var it generates error and code doesnt works.

How to debug the formula and see the result of it? is there some kind of debugging instrument.

Many thanks.