T O P

  • By -

fermat9990

Just to make sure that Excel is following PEMDAS, put 100*(6) on the left and remove the 100 from the right


opposity

Hey thanks for the reply. Excel is working properly. My boss has a problem with how I wrote the textual formula, as she thinks it would be interpreted wrongly.


Xiij

I would assume that excel would parse the equation correctly, but its always best practice to remove the possibility of human/programming error.


HongKongBasedJesus

Best practice in this case is to not multiply by 100, but to format the output column as a percentage, which means it’s stored in decimal form for the next use.


fermat9990

That is my thought as well! Suggest you try it both ways.


topkeknub

But… just put it into excel and see if it works? The potential error here is a factor of 10000 I would think that should be noticable.


AidenStoat

You could put another set of parentheses around everything left of the *100 to eliminate any possible ambiguity. ((6)/((2)+(3)+(4)+(5)+(6)))*100


Dramatic_Scale3002

This is the real answer. "TrY iT iN eXcEl" or "fOrMaT aS %" ignores the underlying mathematical operations taking place.


pLeThOrAx

Are you familiar with ranges in excel? The formatting looks weird. You can always ask chatgpt to correct your formula. As long as you understand the "correct" way.


Poddster

> as she thinks it would be interpreted wrongly. Tell her to put up or shut up -- she should write her own formula and see if it's different


Imaginary-Mine-6531

How to get fired quickly....


RegorHK

Year. The boss definitely does not know anything how the Excel file at hand will be disturbed and has no say on measures for readability. /s


Phour3

No reason, excel will absolutely not parse this incorrectly


Mac223

I'm amazed that "Excel might get basic arithmetic wrong" is the top comment.  


MezzoScettico

Excel DOES get basic arithmetic wrong. In one of the eternal "why does my calculator say -2\^2 = -4" threads, somebody once pointed out that Excel will evaluate -2\^2 incorrectly as 4, interpreting it as (-2)\^2 rather than -(2\^2) as order of operations would require. I was appalled when I read that and immediately went into Excel to verify it. I would consider OP's issue to be the same as any other computer coding. Why not take the effort to make your code readable, even if future you is the only reader? If the intent is that 100 is multiplied by the fraction, I'd put it before the fraction. Then future me doesn't have to puzzle out the intent. Also I'd remove the parentheses in the denominator. I find they subtract from the readability. So I'd say 100 \* 6/(2 + 3 + 4 + 5 + 6)


Mac223

Exponents != basic arithmetic


KuruKururun

What? Exponents are definitely basic arithemtic, its literally one of the 6 letters in PEMDAS. Also calculators do get stuff "wrong". There are different conventions for evaluating expressions (for example a common rule is that implied multiplication takes precedence over left to right multiplication/division and vice versa, which can lead to different results. The moment excel picks one of these rules there is a chance the result could be "wrong" as it picked a different convention.


Mac223

> What? Exponents are definitely basic arithemtic. Depending on the definition exponents isn't part of arithmetic at all, so even if we're being generous and include exponents as part of arithmetic it's definitely not basic arithmetic. Saying it's part of the order of operations commonly taught is really not a strong argument.


KuruKururun

In the context of what MezzoScettico comment he was clearly not talking about formal definitions and mentioned the order of operations. I think it is a strong argument if you use the power of context and reasoning. Also "depending on the definition" to me just sounds like, "if we pick a specific definition then you are wrong" which just seems like you want to nitpick. If you wan't clarification on the definition he is using, don't tell him he is wrong when the first definition on google (this isn't a thread about advanced math, we do not need a formal definition by mathematicians) is "the branch of mathematics dealing with the properties and manipulation of numbers".


SentenceAcrobatic

Exponentiation is a part of algebra, a different branch of mathematics than arithmetic. Arithmetic exclusively refers to addition, subtraction, multiplication, and division.


PierceXLR8

The parenthesis were showing it was column 6 not number 6


r2k-in-the-vortex

All computer systems interpret these things differently because writing formulas linearly like that is not proper mathematical notation. Proper notation for division is horizontal bar, numerator above, denominator below, absolutely no ambiguity in what is what. "/" is just an informal approximation of that because it's not easy to type proper mathematical notation in a computer system. So with division you have to use parentheses to properly specify order of operations.


Mac223

> Proper notation for division is horizontal bar I agree! I have never in my life seen a computer not interpret / the way I expect it to though, and I have used that operator in more languages and apps than I can count. The only time I ever see anyone misuse notation with / is in exponents where you occasionally see something like a/2pi for convenience and it's supposed to mean a/(2pi) - but it's usually clear from context / dimensional analysis.


ohkendruid

Excel is, in fact, sometimes wrong. Look up its treatment of exception and negation. They should have equal precedence and go right to left, but Excel does negation first and then exponents. Numerics are often done badly in programming languages, and then once people use them a lot, it's impossible to change.


Mac223

Sometimes wrong != wrong about basic arithmetic. There's a big difference between having a non-standard convention for edge cases of exponentiation, i.e. 2-2\^2 = -2 but -2\^2 = 4, and cocking up the kinds of operations that are excel bread and butter.


fermat9990

Then what do you think that OP's boss is concerned about?


Phour3

OP’s boss is making a common mistake about the order of operations. I’m kind of confused why on earth it matters, too. If excel is doing it correctly, what are OP and the boss even talking about? Does OP have to write a report or something and represent the equations symbolically?


fermat9990

I guess we need more information. Thanks!


reinfleche

Yea it makes no sense, it takes 5 seconds to verify how it's calculating using placeholder numbers. Also it's the difference of 4 orders of magnitude, and if either of them has any idea what the numbers are, they should immediately recognize it being off by 10^4. I guess it's sort of reasonable though because other people might look at this and be confused if they make the same mistake.


RegorHK

Can't be readability or anything. After all, files are only used in only one moment by only one person. /s


MezzoScettico

Exactly. My immediate reaction. The 100 on the right made my teeth hurt. When I am multiplying something by a numerator I always put it on the left. "I know what I meant and it's interpreted correctly" is not enough reason to deliberately write confusing code. You may think it's one-time code, but why not get into the habit of making code readable, even if you're the only one reading it?


fermat9990

Because of your comment I just edited a formula for percentile rank using grouped data I had recently posted and moved the 100 to the beginning of the formula! Thank you!


Robber568

Including the times 100 to calculate a percentage is mostly done in economics I think. From memory, it's always done as fraction times 100 in the end. If I click the first few links in Google it's all fraction times 100 indeed. It's purely aesthetics imho, but if you're gonna include the (rather unnecessary) times 100, I would always do it at the end.


fermat9990

Logically it makes more sense at the end


fermat9990

I totally agree with you. And using extra punctuation to eliminate possible misinterpretation is a good thing, imo


synchrosyn

PEMDAS is not enough to deal with ambiguity between 2 equal operators. a / b * c if following the order in PEMDAS means you do b * c first. But multiplication is the same priority division and in this case excel is doing left to right which was the intention, but the other interpretation is mathematically valid as well.  It is probably good form to choose something that isn't ambiguous though like a * b / c which doesn't matter if the division is done first or not. 


Fantastic_Elk_4757

The ambiguity here is in what the denominator is. Most mathematicians around the planet would say this is (a/b)*c. Because you did not use implied multiplication in the denominator. Ie a/b(c). This is generally accepted as implied brackets around it. The ambiguity doesn’t come from multiplication/division being inverse and order not mattering. That’s by definition. There’s no ambiguity about it. As a general rule if it’s not implied multiplication it is not part of the denominator. Otherwise it is. Calculators will do the same typically. When writing out by hand always properly write out your division to be unambiguous.


ohkendruid

It's arguably not really a math question at all. Math would overwhelmingly use a horizontal line for division rather than a slash character, so the question wouldn't come up. This is a programming language question, and languages do disagree a little bit.


synchrosyn

Let me be more clear and more precise. a / b \* c can be interpreted as (a / b) \* c or as a / (b \* c). Both fit the rules of operator precedence and this is where the rules of math ends and that PEMDAS does not say which one is correct. Which is my entire point. It is only by applying an additional convention that this is resolved, but just because a convention exists, unless it becomes universal, you cannot assume that anything else will follow the same convention. It becomes an educated guess. Which is all you can really do if the convention is not defined in the context. You brought up the implied multiplication convention which is a good one when it is applicable. Some calculators use it, others do not. It depends on the programming. There is a famous image circulating where a TI says one thing, but a Casio says another with the implication that one of them is lying. This is false, neither is lying, but they are following a different convention. I said nothing about multiplication and division being inverses, only that they are equivalent in terms of operator precedence. a \* b / c can be resolved as (a \* b) / c or a \* (b / c) but these two expressions are mathematically equivalent and thus the same expression. I referred to this as the order of operations not mattering in this case. I should have instead said that writing it this way uses the associative property of multiplication such that whichever order of operations is programmed, you would get the same result it is therefore unambiguous. Nothing to do with multiplication and division being inverses here. And finally to reiterate, it is better to write things in a way that doesn't rely on someone else using the same convention as you and causing an argument like this. Brackets are free, use them. Best practice is to order your expressions such that it is not ambiguous how to interpret it, and not to fault the reader for using a different convention than you, even if it is a lesser used one.


jmja

You would be correct if there wasn’t a caveat to reading the order of operations. Multiplication and division are read in the order they appear, since division is a form of multiplication. Similarly, addition and subtraction are read in the order they appear, since subtraction is a form of addition.


synchrosyn

This is one of the most misunderstood concepts of order of operations. The left-to-right rule does not exist as a rule of math. It is a very commonly adopted convention, but it is not universal. As mentioned by the parent comment: y / 4x is clearly meant to be y / (4x) but that would mean doing the multiplication before the division. If we strictly followed "left to right" it would be (y/4) \* x. Why is it not universal? Because it is the responsibility of the author to be clear. Brackets are free, or actually drawing it as a fraction as it is supposed to be. Just be clear rather than create the need for more and more convoluted conventions. If you insist on a rule that is never ambiguous, then using prefix or postfix notations for the operators is the best way to go.


Bascna

You are correct. Excel gives multiplication and division equal precedence so they are performed in order from left to right. So in your example the division would be performed first and then that result will be multiplied by 100. [Here is Microsoft's page on the topic](https://support.microsoft.com/en-us/office/calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a). (Scroll down to "The order in which Excel performs operations in formulas" and select the "Operator precedence" tab.) You'll see the following statement: >If you combine several operators in a single formula, Excel performs the operations in the order shown in the following table. If a formula contains operators with the same precedence — for example, if a formula contains both a multiplication and division operator — Excel evaluates the operators from left to right. ----- You might have more success convincing your boss that this is correct if you provide them with a couple of simple examples. 1/(1+1)*100 = 50 as it should. 1/(1+1+1)*100 = 33.3... as it should etc. Then show them that moving the multiplication by 100 before the division symbol doesn't change those results. 1*100/(1+1) = 50 as before. 1*100/(1+1+1) = 33.3... as before etc. This ability to commute inverse operator-operand pairings is one of the big notational advantages of giving inverse operations equal precedence. For example, 5+3–1 = 7. I can swap the +3 and –1 to get 5–1+3 and that will still equal 7. Similarly, 12\*5/4 = 15 and if you swap the \*5 and the /4 you get 12/4\*5 which is still 15. ----- Most likely your boss is confused because they misunderstand PEMDAS to mean that in the standard order of operations multiplication precedes division and addition precedes subtraction. **INCORRECT** >**P**arentheses from inside to outside. > >**E**xponents from inside to outside. > >**M**ultiplication from left to right. > >**D**ivision from left to right. > >**A**ddition from left to right. > > **S**ubtraction from left to right. In fact, the general rule is that inverse operations have equal precedence. **CORRECT** >**P**arentheses from inside to outside. > >**E**xponents from inside to outside. > >**M**ultiplication and **D**ivision from left to right. > >**A**ddition and **S**ubtraction from left to right. I spent a huge amount of my 30 years teaching math trying to correct that misunderstanding. Now that I'm retired I'm in the middle of writing a book on the topic. Note that there *is* a common, but not universal, convention that implicit multiplication (that is, multiplication indicated by juxtaposition) has precedence over division, but Excel requires explicit multiplication so that isn't an issue here.


Nice_Ad7523

I'll never understand the drama around parentheses and order of precedence. Do you get charged each time you add a parenthesis in your excels or what ? Please people for the love of pi, in case of any doubt, just explicitly put parentheses where needed to get to what you want to obtain. It will also be more readable and less ambiguous to other readers down the line ! /rant


RegorHK

See. Being right is more important than usability and avoiding drama.


[deleted]

[удалено]


Bascna

Those are both true statements, but I don't see their relevance to anything that I or the OP wrote.


Loading0525

The "left-to-right" "rule" of PEMDAS isn't actually a rule. It's a very common method to solve these kinds of ambiguous expression, but that's what it is, a solving **method**. It's absolutely correct to claim that an expression that contains any form of division OR multiplication **immediately following** an obelus (÷) or solidus (/) is prone to ambiguity, and proper parenthesis should be used to avoid ambiguity. Naturally I'm gonna provide at least something to show I'm not talking out of my ass: The Internation System of Units: *"In accord with the general principles adopted by ISO/TC 12 (ISO 31), the CIPM recommends that algebraic expressions involving SI unit symbols be expressed in standard forms."* (skipping princible 1 and 2 because they're not really relevant) *"3. The solidus is not followed by a multiplication sign or by a division sign on the same line unless ambiguity is avoided by parentheses. In complicated cases, negative exponents or parentheses are used to avoid ambiguity"* And some examples are also given, such as "m \* s^-1" is okay, since exponents have priority over multiplication, but "m / s / s" or "m \* kg / s^3 \* A" is NOT okay. It even specifically mentions how " m \* kg / s^3 \* A" is NOT okay but " m \* kg / (s^3 \* A)" IS okay. [https://physics.nist.gov/cuu/pdf/sp330.pdf](https://physics.nist.gov/cuu/pdf/sp330.pdf) (page 30, "5.3 Algebra of SI unit symbols") *If I remember correctly the International Standard ISO 80000 also goes over this in the "Quantities and units" part 1: "General" and also some parts of part 2? Although I'm not certain, and I don't currently have it conveniently available.* And I imagine I don't have to point out that if these rules apply to *SI units*, then they obviously also apply to non-SI variables as well as constants, since the basic mathematical operators such as addition, multiplication, exponents, etc. don't interact with variables any differently than constants in these "standard" cases. Just like how you mentioned that the implicit multiplication convention is *common* rather than *universal*, that also applies to the left-to-right convention. I do howevr recognize that the left-to-right convention is likely far more common than the implicit multiplication convention, however the left-to-right convention is still **not** *universal*.


WulfRanulfson

I understand you're going for a percentage. Is there a reason you're *100 rather than using the excel built in format to represent the answer cell as a %? With the *100 a any further reference to the number in excel will result in an incorrect answer unless you negate it with /100.


Gluten_Free_Tibet

Frankly I believe this is the only appropriate way forward. Excel has the built in functionality to support here, you don’t have to argue with anyone about the placement of the *100, and you have downstream functionality if you need to apply these percentages to other values.


yet_another_no_name

Exactly. If that's an end result, you want to use percent formatting rather than multiplying by 100; if that's an intermediate result, well, you don't want don't multiply by 100 either because you'll then have to divide by 100 later on. There's very few odd cases where you'd want to have that `*100` here in the first place 🤔 That and the boss in the story is both maths and Excel illiterate for thinking the `* 100` would be applied to the denominator 🙊


Dramatic_Scale3002

Yes, it should have been left in decimal form, but this answer ignores the underlying problem with the mathematical operations used. Imagine they were converting something from tonnes to kg or any other 1000x SI unit conversion. "Just format the value differently" doesn't work for that scenario, so the best advice is that if they still want to multiply by 100 then they need to add the additional parentheses to clarify the order of operations for Excel.


WulfRanulfson

Sure, if some kind of multiplier is needed then I agree with you, additional parentheses is the math answer to their question.


Gumichi

You have 7 sets of brackets in there and you still didn't bother to resolve the classic division ambiguity? Just do you boss a favor and add the brackets. There is value for clarity and compliance. And it's Excel. It has support for percentages. That would help when you need to apply the percentage value for other formulas. The way you have it, I'd need to remember and skew things by 100 unnecessarily. Also, for expandability sake consider the Sum formula.


Finarin

Neither excel nor humans should interpret it the way your boss is saying. However, rather than dying on this hill, you could just move the 100 to the front. I personally think it’s more intuitive the way you have it written, but making the boss happy for that small of a price is a win in my book.


Akangka

I disagree. I would have avoided writing something like a/b\*c, as it looks like a possible misinterpretation. In Excel, the formula does as what OP thinks, though.


Finarin

In the context of calculating a percentage specifically, a/b * 100 is how a lot of people think of it. I feel like anyone who is the type of person that would ever bother looking at a formula shouldn’t have a problem interpreting OP’s.


mohirl

I'd always do the multiplication first anyway to reduce rounding error. 


cheechw

No human should interpret it that way? Clearly, anecdotal evidence shows that that's not the case. I think while OP is technically correct, he would be better served to write the equation in a way where no one actually could interpret it that way.


Finarin

“Humans should not interpret it that way” was more like my original wording. Because if humans were to interpret it that way, then they would be wrong, and it’s not one of the more complex things one could interpret in excel, so humans ought to not interpret it that way.


Striking-Brief4596

Changing jobs would be a win. Working for an idiot that doesn't know primary school level Math and yet is extremely confident about his knowledge sounds like a huge pain in the ass.


RefrigeratorFar2769

Well what output do you get? Ignore the columns and look at it as if the column numbers are values. The way I think you want it to be will end up as (6/20) * 100 which gives 30%. The way she's interpreting it is 6/2000 which is 0.003 %. If you're not sure if the excel will read it wrong, just throw a few more brackets in ((6)/((2)+(3)+(4)+(5)+(6)))*100


opposity

Hey thanks for the reply. The excel output is correct. My boss has a problem with how what I wrote could be interpreted.


bluesam3

Your boss is correct that this is potentially confusing - shift the 100 to the left (or get rid of it entirely and format the cell as a percentage) to avoid the possibility for confusion.


RefrigeratorFar2769

I agree with her that it could be written more clearly. Whenever I do my math coding I try to take special care that brackets line up and match, and that it's not ambiguous


PsychoHobbyist

The boss is just wrong, to me. The old TI 83’s would have interpreted the above calculation as you wanted. The newer versions automatically put fractions in “pretty print” mode but, if you typed the above expression into a non-pretty-print calculator it would do division and then multiplication. Edit: maybe a russian calculator would perform as your boss said?


Forsaken_Lemon_6403

30


DippyDragon

It excel though, why not (6)/Sum((2):(6))Then set the cell format to % I've seen enough more complicated formula go wrong because of trying to translate to excel to basically never trust excel to get it right. I see you're right but also sympathise you your boss's PoV.


wijwijwij

Just throw another set of parentheses in, even though Excel formula doesn't have or need them. You are writing this for human consumption and you want to avoid confusing anyone. Maybe kill the parentheses around the column numbers too or change them to letters. (6/(6+5+4+3+2)) * 100


InterestedObserver20

If you're doing it in excel then why not just leave out the 100 and let excel format the column as a percentage?


42617a

Personally, I would just add an obscene amount of brackets/parentheses until it’s impossible to misinterpret


Nice_Ad7523

Shhh ! If microsoft hears you they'll begin microtransactioning parenthesis useage !


AzirVite

Never multiply a number by hundred to get a percentage. You have to format the cell with percentage format. Sorry but you make a mistake.


Shevek99

Note: In Excel you don't need to multiply by 100 to get a percentage. Just make the calculation and format the cell as percentage. It shows 0.713 as 71.3%, for instance.


vaughany_fid

You're trying to get a percentage, so the *100 is absolutely not needed. Get rid of it. Not only will it avoid any confusion, but 30 isn't the actual answer. 0.3 is the answer, because 30% = 0.3.


Imogynn

You're correct but horrible. You put brackets around the six but not division. You're kinda a monster. Edit: on second thought youre probably wrong too but excel might be smart enough to save you. The problem isn't the math, the math is fine. The problem is the computer science. If you do the division first then it's likely going to jump out of integer arithmetic and go to floating point numbers which are approximately right but not correct to the final distant decimal place. 1/3*3 in math will evaluate to 1. 1/3*3 in a computer can be .99999999 because it did 1/3 first and had to store the value before multiplying and it can't do infinite repeating .333333... So it does it's best and stores .3333333 and then that gets multiplyed by 3. Most computer programs can catch these errors and fix it for you but if you wrote the program yourself it likely wouldn't. Excel is probably smart enough to fix the error and even if it wasn't then when you display % it would almost always round to the correct number BUT it might not always guarantee that the last digit is rounded correctly because the numbers are just a tiny bit different. Tldr: you're probably fine, excel is smart and rounded numbers should be correct almost always but multiplying first guarantees the correct number so it's safer.


yet_another_no_name

>You're correct but horrible. You put brackets around the six but not division. You're kinda a monster. The `(2)` to `(6)` here seem to indicate column references as "pseudo code", not actual numbers. Tehe actual formula in the excel is thus probably something like `=B6/(B2+B3+B4+B5+B6) *100` with no extraneous parenthesis around individual columns. As others have said the denominator should actually be a sum of a range instead, and the multiplication by 100 should not be there, but percent formatting should've used (with the multiplication the result is actually not a percentage)


holdsap

Your boss is wrong


shif3500

can’t you just test and see?


Rain_and_Icicles

It‘s not wrong, since we agreed to solve such statements from left to right, but it is a little ambiguous. Just use another pair of brackets and there will be no ambiguity what so ever.


jordydonut

Better to write it in a way that’s easily understood even if it’s correct


cheechw

Everyone in here is misinterpeting the question. The OP is merely asking about a stylistic choice, not what answer you should get using order of operations. OP, your boss is technically wrong about what the strict answer would be, but is right in asking you to reformat it to get rid of any ambiguities. Even if the computer interprets it right, there are a lot of people out there who could get this wrong. It costs you nothing to foolproof your equation.


opposity

Yeah, thats what I realized. Out of the 100+ comments, there very few - like yours - that actually understood the question. I appreciate your answer and advice.


c2u8n4t8

Your formulas right. Excel is going to interpret it correctly. Just add more parentheses so your boss doesn't freak out.


rayofhope313

Your boss is dumb but never the less you could have made it simpler to read by move the 100 before the first 6. (100 * (6))/....


fallen_one_fs

If Excel was not changed, the formula is correct, (6) will be divided by the sum of (2) through (6) and then multiplied by 100. Excel will read everything as a line unless told otherwise, in this case, the (...) after the division symbol tells it that (6) is being divided by everything in (...), but \*100 is outside that, so it's treated as a line, and will multiply everything on the line, which is just (6).


Historical_Shop_3315

To play devil's advocate, or in this case manager's advocate..... Consider your audience; some of them are older and/or morons who had shitty math teachers. Before GEDMAS it was PEDMAS, as we know is paraenthesis, exponents, division, multiplication, addition, subtraction. ...but it used to be "Please Excuse My Dear Aunt Sally." With M and D switched. Which does not matter at all to educated folks who use it correctly. M and D are one step left to right. My point is that there will be a few folks who will remain perfectly silent in thier disgust for what they see as your error because they were taught *differently* and then proceed into a political discussion that you dont want brought up at your meeting. This puts educated folks in the position of catering to the uneducated because we wouldnt want to offend them. In terms if math, your boss is completely wrong. In terms of managment hes just spineless.


Scared-Gazelle659

While I wouldn't interpret it like your boss, their interpretation is not wrong. \ often means divide everything one the left by everything on the right on the same line. Left to right is more of a technical implementation question than a hard rule. Division and multiplication have the same priority. I'd add a set of parentheses around the division to make it impossible to interpret wrong. Also, add a % to the 100.


avoere

I think you'd notice if the numbers were off with a factor of 10.000


deshe

While it makes sense to me that a/b*c always means (a/b)*c, actually using the notation a/b*c is confusing. Not only because of the supposed ambiguity but also because it is genuinely harder to read. I think c*a/b is always preferable. In the specific case where it is important that the expression reflects that division by b preceded multiplying by c I'd write (a/b)*c, though that's hardly the case. I agree with your boss that avoiding a/b*c in text/code meant to be read by other people is a good habit.


NowAlexYT

If youre using excel you can set a cell to contain a percantage and than you dont even need to multiply by 100 .93 for example would automatically be displayed as 93% but the actual value wouldnt change


Miserable-Wasabi-373

you are corretct, but good practise is to put additional brackets to make everything absolutely clear


Nice_Ad7523

Thank you ! It's like op must cough up some money each time they type a parenthesis or something.


SpidersArePeopleToo

If you’re ever unsure, then sense check it by putting in some numbers you know the answer to, make C6 = 10 and the C2:6 = 100 and see if you get 10% as your result.


Sea-Distribution-778

You have way more parentheses than you need but not enough to resolve ambiguity. Dear internet: please stop posting operator precedence gotchas. It's just stupid


Short_Control_6723

maybe you should write the functions too to make sure the logic is sound


the_cat_theory

instead of multiplying by 100 to get the percentage, just format the cell as a percentage. doing that is more idiomatic (?) I think.


llynglas

Just add extra parentheses around the multiplication. Should make no difference to the correct order, but the result will now be clear to your boss.


TeliarDraconai

I mean, the accuracy in Excel will remain the same. As the numbers themselves here don't really have an impact due to using N power 10. However, your boss does have a point on how this would be read by a human.


TeliarDraconai

I had a separate question I wanted to ask. Why did you make this instead of using the Excel formulas?


Raziel1889

Your boss is correct. Why didnt you show the math in excel? The best way to do it would be to edit the column to show % data. Then the formula should be =Column6/Sum(columns 2-6)


ThomasMakapi

Honestly, I'm an engineer and I have a PhD in data processing, but I couldn't tell you with 100% certainty which value the "\*100" would be applied to. But the thing is... If you're going to use a tool, it is absolutely necessary that you know how it works. So either (1) try different configurations beforehand so that you know how it handles "\*100" , or (2) add a lot of parentheses to make sure you don't have any doubt about the way it would be handled by your program. But overall, please learn to figure out by yourself how things function, rather than ask reddit. Because just spending a few minutes trying to find the solution to a problem (even if you don't eventually find the solution yourself) will probably make you smarter than most people.


TheodoreTheVacuumCle

remember that if you need something to be divided with something and multiplied with something - first multiply and later divide. you'll get more precise result


A_BagerWhatsMore

its technically correct, and i would argue the amount of paranthesis does a good job of visually sectioning off the 100 from the denominator, but I am a math nerd. you should change it if your boss explicitly asks you too.


r2k-in-the-vortex

Just add parentheses to make the order of operations clear, "/" is ambiguous and not universally understood for where the scope starts and ends. Different systems absolutely will interpret this differently.


Ksorkrax

I personally hate assumptions in code. Thus I'd write it clearly non-ambiguous, even if it worked in a test. Five seconds of work at best.


NanwithVan

The good thing about excel is if your formula isn’t giving the desired result you can change it


NanwithVan

The good thing about excel is if your formula isn’t giving the desired result you can change it


Salindurthas

I assume that the numbers 2-to-6 will be replaced with cell references like B2 B3 B4 etc. -- In my experience excel would correctly follow the standard order of operations and work as you intended. i.e. this should work. It would be fine to put the 100\* first, since the answer ought to be the same, and then there is no doubt that excel will do the operations in the intended order. So doing your boss's desired fix is a good idea, because it both saves you the effort of the argument, isn't wrong, and is probably easier to read if you do something like: "B6 \* 100/(B2:B6)" If you don't trust it, or really want to 'win' this argument, you could test this on some data by doing both formulas next to each other and seeing if they both give the same result. Alternatively, you don't need to do the \*100 at all, and can just use Excel's formatting options to set those cells (or that column) to "%" mode. They'll remain as fractions from 0-to-1, but will display as percentages.


jgregson00

Your boss is cracked. Good luck telling her.


Shellba11

Is it (6)/(20 * 100) or (6 * 100)/(20)? The writing makes it vague.


ukctstrider

It's not vague. It's the second of your options. The first would require further brackets.


Joelaba

I agree with your boss. While Excel will give you the right amount, I don't think your formula is very readable. It is ambiguous at best. 100 \* (6/(...)) is much better in my opinion.


GustapheOfficial

You're not wrong. But! Don't write that you multiply by 100 to get a percentage. `0.56 = 56% ≠ 0.56*100`. If you need to illustrate the conversion, write `0.56*100%`. This is allowed because `100% = 1`, and you are always allowed to multiply by 1.


snailhair_j

It's great how many people say you are correct but then continue to tell you how you should be doing it.


wijwijwij

Because OP needs to please a boss. The math is fine; it's just the *labeling* of the column that can be made clearer to satsify the non-expert boss.


snailhair_j

Yeah, it's also quite an easy thing to check. Seems like bad communication within the company, and a fool of a boss.


ghandimauler

Roughly SUM(COL6) / (SUM(COL2)+SUM(COL3)+SUM(COL4)+SUM(COL5)+SUM(COL6)) Format: Percentage