# Run a formula that is dependent on whether the number field is positive or negative

Topic Labels: Formulas
Solved
758 2
cancel
Showing results for
Did you mean:  6 - Interface Innovator

I feel like this is possible, but I’m not 100% sure. I know I can run a formula that says do “X” if the value is “Y” and otherwise do “Z”, but can that be done on whether the number is negative or positive?

This is what I’m trying to do - I have a number field that captures the number of days before (negative) or after as listed in a contract. I need to calculate a date based on those numbers, but the date I calculate from depends on whether it is listed as before or after in a contract. So for example, if in the contract it says the survey is due 30 days before the end of feasibility, I need to use the feasibility date field based on that -30. If it says it is due 60 days after the effective date, I need to use the effective date field based on that 60.

Hopefully this makes sense.

Thank you!

1 Solution

Accepted Solutions  10 - Mercury

What happens if the number is zero? If that number gets lumped in with either the positive or negative group, you could do something like this:

`IF( {Number} >= 0, do this positive or zero stuff, do this negative stuff)`

Otherwise, you can nest IF blocks inside of each other:

``````IF(
{Number} > 0, do this positive stuff,
IF( {Number} < 0, do this negative stuff,
do this zero stuff
)
)``````
2 Replies 2  10 - Mercury

What happens if the number is zero? If that number gets lumped in with either the positive or negative group, you could do something like this:

`IF( {Number} >= 0, do this positive or zero stuff, do this negative stuff)`

Otherwise, you can nest IF blocks inside of each other:

``````IF(
{Number} > 0, do this positive stuff,
IF( {Number} < 0, do this negative stuff,
do this zero stuff
)
)``````  6 - Interface Innovator

This worked beautifully. Thank you! 