# Negative number calculation question

Topic Labels: Sync
499 2
cancel
Showing results for
Did you mean:  7 - App Architect

I have three fields, two are field type Number, one is Formula. The objective is the sum of the numbers in the result field.

(1() enter W, (2) enter D, (3) result (W*D)
In fields (1) and (2) I have selected ‘allow negative numbers’

Each row has for fields (1) and (2( whatever numbers I enter, for example:

W D Result
5 5 25
-3 -2 I expect -6 but what i get is 6 which means that the sum is 31, not 19

How can i ensure that when a negative number is entered, the result is substracted from the sum? I have found an inefficient way around tthis by having a fourth field Type: number and allow negatiive number, into which i enter the result manually, eg:

Result
25
-6
(sum: 19)

tia

2 Replies 2  10 - Mercury

If you want to ensure that the outcome in this case is negative nonetheless, you could use a formula to do so:

``````IF(AND(n1 < 0, n2 < 0), n1*n2*(-1), n1*n2)
``````

This says if n1 and n2 are below 0, multiply the result by -1. Otherwise just give the result.

Hope that thelps!  7 - App Architect

Very helpful, thank you very much. 