Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Removing NaN where + and - values can exist

Topic Labels: Formulas
Solved
Jump to Solution
247 2
cancel
Showing results for 
Search instead for 
Did you mean: 
ashleyalward
4 - Data Explorer
4 - Data Explorer

Hi there! I am trying to remove NaN values from a formula field where both positive and negative values exist. This is in an effort to clean up two extensions: One chart indicating the number of each value's occurrence and one number where I am trying to get the average of the values, but with NaNs included I receive an infinity. 

Here is my current formula:

DATETIME_DIFF(
{Due Date},
{Date Completed},
'days'
)
+
IF({Date Completed},{Due Date} = "NaN", BLANK())

Thank you in advance!
1 Solution

Accepted Solutions
Marvel
4 - Data Explorer
4 - Data Explorer

It looks like your formula has an issue causing NaN values. To fix this, you can update your formula to make sure it only calculates when both dates exist. Try this:

 

IF(AND({Due Date}, {Date Completed}), DATETIME_DIFF({Due Date}, {Date Completed}, 'days') )
This will prevent NaN values and keep your charts and averages clean. If you need more help, feel free to ask! 😊

See Solution in Thread

2 Replies 2
Marvel
4 - Data Explorer
4 - Data Explorer

It looks like your formula has an issue causing NaN values. To fix this, you can update your formula to make sure it only calculates when both dates exist. Try this:

 

IF(AND({Due Date}, {Date Completed}), DATETIME_DIFF({Due Date}, {Date Completed}, 'days') )
This will prevent NaN values and keep your charts and averages clean. If you need more help, feel free to ask! 😊

This worked beautifully! Thank you very much 🙂