Negative value expression in IF statement | Community
Skip to main content
February 15, 2020
Question

Negative value expression in IF statement

  • February 15, 2020
  • 2 replies
  • 827 views
Hi, I'm not having luck using a negative value as my true expression in my IF statement. Using a positive value in the exact same statement works. Is there special syntax for negative values in an IF statement? Am I missing something? I'm comparing project vs. template durations and looking to group the % differences outside the 0-20% range, either more or less. When I subtract durations I end up with some negative values. I'd like to group those that are less than or equal to -20% in a range....i.e. -20% to -10000%. You take out the negative signs for this one, and it works fine. group.0.valueexpression=IF(ROUND(DIV(SUB(DIV(DIV({durationMinutes},60),8),DIV(DIV({template}.{durationMinutes}/60),8)),DIV(DIV({template}.{durationMinutes}/60),8))*100,2) <=-20 &&ROUND(DIV(SUB(DIV(DIV({durationMinutes},60),8),DIV(DIV({template}.{durationMinutes}/60),8)),DIV(DIV({template}.{durationMinutes}/60),8))*100,2) <=-10000 ,'-20-10000%',"") Anyone know how to get it to compare with negative values? Thanks in advance! Kristen Iyall Marketing Technology Transamerica DENVER, CO
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Level 8
February 17, 2020
Dear Kristen, I think the problem isn't directly the negative numbers. I think you've got the comparison around the wrong way. Shouldn't it be > = -10000? That is, you want values between -10,000 and -20: greater than or equal to the lowest range (-10,000) and less than or equal to the higher range (-20). Anything that is <=-10,000 must automatically be <=-20, so mathematically there's not a lot of point doing both comparisons. Barry Buchanan - WMA Work Management Australia
KristenIyAuthor
February 17, 2020
Bingo! Thank you, Barry! Appreciate you pointing this out. Kristen Iyall Marketing Technology Transamerica DENVER, CO