How do I correctly write this math formula so that QB follows the order of operations to obtain the correct value?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

This is really just my lack of understanding on where the () go to ensure QB calculates the value I'm looking for.

The equation is [Amount Offered] - [Total Adjusted chargeback] * .25 + 25

So I need it to first subtract the built in fields, then multiply that answer by .25 then add 25 to the result of the multiplication.

Example: 1000 - 500 * .25 + 25

So

1000 - 500 = 500

500 * .25 = 125

125 + 25 = 150

Thank you!

Photo of Rhonda

Rhonda

  • 82 Points 75 badge 2x thumb

Posted 4 years ago

  • 0
  • 1
([Amount Offered] - [Total Adjusted chargeback]) * .25 + 25

In excel and QuickBase the rules of math the order of operations goes by BOMDAS - I remember that from Grade school.

Brackets

Of ( cheat way to get a vowel so its pronounceable, as if 5% "of" 100 - which is really multiplication.)


Multiplication and Division

Addition And Subtraction

ie Multiplication and Divisions are done first in the order they appear, and after that, then Addition and Subtractions.


Of course you can clutter up everything with extra layers of brackets, but yuk, it gets messy to read.
Photo of Rhonda

Rhonda

  • 82 Points 75 badge 2x thumb
I copied and pasted your text and it's not giving me the correct answer. The specific values it's calculating are as follows:

Amount Offered $1,186.00
Total Adjusted chargeback $570.50

So it should be subtracting those two values to get $615.50
Then multiplying 615.50 by .25 to get $153.88
Then adding 153.88 and 25 to get $178.88

The answer it is giving me, however, is -$117.63

Thoughts?
Photo of Rhonda

Rhonda

  • 82 Points 75 badge 2x thumb
Ok. Nevermind. I opened again and hit save and it gave me the right answer.