Skip to main content
Question

return 'no value' in conditional statement

  • July 6, 2026
  • 1 reply
  • 12 views

I am using a conditional statement to calculate the U-value of heat exchanger. If conditions are not met, I would like to return a nan rather than 0. How can I do this?

if(

    and((Q_warm < 13), (Q_warm > 11)),

    (Q/(3.64*LMTD)),

    0)

1 reply

Wouter Daniels
Employee
Forum|alt.badge.img

There is no direct nan available, but you can take the square root of a negative number to the same effect. The resulting formula tag will be interpolated over the period with nan values.

if(
and((Q_warm < 13), (Q_warm > 11)),
(Q/(3.64*LMTD)),
sqrt(-1)
)

 

If you want to see actual gaps, a workaround would be to return 'infinite' values, though any calculations/aggregations done on the tag will also show the value to be infinite for those periods.

if(
and((Q_warm < 13), (Q_warm > 11)),
(Q/(3.64*LMTD)),
1e99
)