# Calculation of Percent-Values

#1

Hello, a very simple question …

How can i do an ordinary percent-calculation as follows (column “Percentage”):

Region +++ Sales +++ Percentage (favored result)
North +++ 40000 +++ 20 %
East +++ 70000 +++ 35 %
South +++ 30000 +++ 15 %
West +++ 60000 ++ + 30 %

++ Sum 200000 ++ Sum 100 %

How is the formula for the column “Percentage”? I tried it with “Sales/SUM(Sales)” in different ways, but the result is always 1.

Shame on me, but I have no idea anymore. Thanks for advice.

Multiplying by percent column yields result that is 100 times too big
#2

You need the Total to do the math, and given that it is dynamic, you can’t do this. They only thing that comes to my mind is this:

What other tables or data do you have?

#3

This can be done by creating a sum roll-up field first, and referencing that instead of sum(sales)

#5

Yes, but you need first need to have all the numbers in the same records, that is what I’ve done. I don’t understand you reply.

#6

The reason you are getting 1 as the result of sales/sum(sales) is because the numerator and denominator on that fraction are literally the same value. Sum() does not reference an entire column like =sum(A:A) would sum the A column in Excel. Using sum() in Airtable with a column name used as a variable, that column name will represent only the value of the field corresponding to the column name for the specific record in which the field calculated from that formula is held. Therefore, since sales is referenced within sum() as the only value, sum(sales) is the exact same 1-value array as the sales value that it is dividing. X/X=1 every time.

I believe that is a more complete explanation of why this is failing for you, OP.

#7

Thanks for all response! I thought, a “SUM” without relation to another table simply totalize a column - like the “SUM”-Value at the bottom. Seemed obvious. Okay, I was off. It would be too easy …

Special thank to Elias for the (tricky) example, but unfortunately it can’t be applied to my tables.

For the moment I give up. Maybe I will try again later.

#8

I THINK this is the right thread for this question - but if not, apologies and feel free to direct me elsehwere.

i’m WANTING to do a calculation of {Payment Due} x {Discount amt} but continuously get #Error in that column…
have tried changing discount amt to percentage field, number field, text field… and Payment Due is a single select… is that the problem? i need it to limit the options in that field…

would be grateful for any advice, even if the advice is “you can’t do that”… then i’ll stop banging my head against it!

#9

You want something like this? https://airtable.com/shr5ITe9SY7lorCEt

The formula is: `{Payment Due} - Discount`

#11

hi

nope. i thought it was right at first glance, but no, it’s not subtracting a % of the payment due…
it’s subtracting just the integer amount…

#12

I think you ran into two problems. First, a single select value is returned as a string, which was the source of your `#ERROR` messages. To use it in a calculation, first wrap it in a `VALUE()` function.

But even if you had gotten past that hurdle, you likely would have slammed into Airtable’s buggy handling of percentage fields. When used in a formula, one would expect a percentage to have the value of its decimal equivalent – for instance, 10% = 0.1. Instead, an Airtable percentage takes on the integer value of the percent: 10% = 10. So, instead of

`VALUE({Payment Due})*Discount`

you need

`VALUE({Payment Due})*(Discount/100)`

Except in this case `{Discount}` represents a percentage off `{Payment Due}`, and not a percentage of `{Payment Due}`. That means the formula you actually want is

`VALUE({Payment Due})*(1-(Discount/100))`

If I’ve completely misunderstood your intentions, feel free to run it over me again, and I’ll give it another try…

#13

holy smokes… i was nowhere close to finding that answer. Thank you!!
I had, actually tried variation like your first samples as those are logical and mathy…

I don’t think I’d have had the patience to learn that … I tried all my excel formulaic wizardry and finally gave up and just entered the actual discount amount manually (as generally speaking it’s a 10% discount it’s fairly easy to do in my wee head).
But your formula worked brilliantly, so, much appreciation for that!

Change group count to percent?
#14

I want to put in the Trailing Stop for an amount as in stocks and I thought you might be able to help. \$15.00 with a trailing stop of 25%. In Excel I out in =The column*0.07. But I can’t figure out how to do this in Airtable. Can you help?

#15

For a trailing stop, from my understanding that is a binary check on whether a stock has moved a given percentage from an original point. For this you would need a comparison between two points such that IF they differ by a given percent or more, it will return a value of true. So the elements are calculating the difference and a check to see if the difference meets a threshold.

IF(ABS((Original-Current)/Original) >= .15, TRUE(), FALSE())

IF the Absolute Value of the Difference divided by the Original is Greater Than Or Equal To the Threshold, return True, otherwise return False. Here I have used 15% as the threshold.

I would include a link to an example but the forum won’t let me for some reason

#16

Thank you so much Thomas. I think I understand but since I am not as fluid in the terminology of a formula. I sill try and send you an attachment of one and then you can maybe give me the correct formula. That would be great

I want to put a 30% stop on say each stock, and do it automatically for me every time a stock changes price. The formula would be what I Paid (\$13.47) and say it goes up to \$60 and starts going down when it reaches 30% more than what I paid, so I don’t lose money, I will put a 30% stop on that stock, so I know when to sell. So using \$13.47 if it went up to \$60, then I would see if I didn’t already at \$17.51 theoretically. I think I explained it correctly. Thank you for your time, I appreciate that

Patsy Pankey

Email: digitalbarn@gmail.com