Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

Negative value expression in IF statement

Avatar

Level 1
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
Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 8
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

Avatar

Level 1
Bingo! Thank you, Barry! Appreciate you pointing this out. Kristen Iyall Marketing Technology Transamerica DENVER, CO