Hi there. I’m trying to calculate a percentage but only if it’s positive. As an example, one record might say 7000 for the total and 1000 for the cost and I want to know what percentage that is. But I have some records that are 0/0 which just gives me “NaN” and some that the total is 0 but the cost is negative by a large number and then it’s returning “-infinity”

Ideally I’d like anything with NaN or a negative value to show up as 0 so that I can see the average for all the positive records. I was trying to use the IF function in the formula but I see nothing in the support section about using IFs with formulas besides just text labels. Here’s what I had as my formula but it won’t let me save it because it says it’s wrong so I’m coming here.

IF({Cost} > 0), “({Total}/{cost})”, “0”

I also tried:

IF({Cost} > 0), “Value({Total}/{cost})”, “0”

And:

IF({Cost} > 0), “=({Total}/{cost})”, “0”

But none of these work and I don’t understand what the problem is