|
|
We had this very issue the other day on my team. And several other issues on my previous project related to data binding. Yes, the DGV seems to have been written by an idiot.
|
|
|
|
|
This is what I got from my director/president of IT department of our company, I'm not sure if he wrote it or not.
It's a formula in an excel cell:
=(1-(K11-L11)/K11)*100
i mean seriously, wtf?
I've also seen a code/formula than spans a whole line includes several variables which equals to 1 no matter the variables, i pointed it out to the "developer" he laughed his ass off and got embarrassed that was kind of funny.
|
|
|
|
|
What is it supposed to do?
My guess is it solves "L11 = x% of K11" for x.
I fail to see what's wrong with it to be honest.
Giraffes are not real.
|
|
|
|
|
well yea, basically. It works, it just should have been.
=L11/K11*100
|
|
|
|
|
Maybe not; if K11 is the price you get, and L11 is the cost, then it will give you the revenue in percent
|
|
|
|
|
A little maths :
(1 - (K11 - L11)/K11) * 100
= (1 - (K11 / K11) + (L11 / K11)) * 100
= (1 - 1 + (L11 / K11)) * 100
= (L11 / K11) * 100
|
|
|
|
|
Yeah... I think I'm going to bed early tonight.
Giraffes are not real.
|
|
|
|
|
No - it's (K11 - L11) !!!
And also you should check operator precedence !
You should take another base course in math
|
|
|
|
|
Just prove what you say and I'll look for a maths course...
|
|
|
|
|
>(1 - (K11 - L11)/K11) * 100
> = (1 - (K11 / K11) + (L11 / K11)) * 100
Where did the + came from ?
(K11 - L11)/K11 is the same as (K11 / K11 ) - (L11 / K11)
Besides, the parentheses signifies that it should be evaluated first.
the formula is evaluated to;
K11 - L11 then divided by K11, subtract the answer from 1 then multiplied by 100 to represent as a percentage.
This is a valid income formula.
if L11 = 100, K11 = 200, this will result into a 50% answer.
|
|
|
|
|
Two minuses make a plus. So yes, as you got, (k-l)/k is k/k-l/k. But the expression is 1-(k-l)/k = 1-(k/k-l/k) = 1-k/k+l/k. The post you were replying to brings the fraction inside and resolves the brackets in one step. (As described earlier, it then further simplifies 1-1+l/k = l/k.)
|
|
|
|
|
(1 - (K11 - L11)/K11) * 100
= (1 - ((K11/K11) - (L11/K11))) * 100
= (1 - (1 - (L11 / K11))) * 100
= (1 - 1 + (L11 / K11)) * 100
= (L11 / K11) * 100
Did you got it ?
|
|
|
|
|
Whoever set up the spreadsheet originally simply plugged in standard accounting formulas without performing any simplification.
Gross Profit Margin is defined as the difference between revenue and cost of goods sold, divided by the revenue:
GPM = (Revenue - CoGS)/Revenue
The equation in the spreadsheet you were looking at was looking at (effectively):
(1 - GPM)*100
True, it could have been simplified, but there are (at times) reasons for not performing every possible simplification. In this case, to someone who "thinks" in terms of CoGS, Revenue, Margins, etc. the equation given makes a lot of sense. To a programmer (or a mathmatician) it is not very efficient, but to the accountant it provides self-documenting code. This is especially important in Excel, where you can't add comments to the code (cell equation).
It appears that they were trying to calculate the proportion of each dollar of revenue that the company spent as expenses.
|
|
|
|
|
|
Great. Pushing that button has apparently affected my hearing. Well, they've always said the internet was a dangerous place.
|
|
|
|
|
FTFY.
Driven to the ARMs by x86.
|
|
|
|
|
AspDotNetDev wrote: FTFY.
Did you mean:
1.fixed that for you.
2.f*ck this f*ck you
3.For the F*ck, YES!
Whatever it was,
(no pun intended)
Greetings - Jacek
modified on Tuesday, July 5, 2011 5:26 PM
|
|
|
|
|
Number 1. Do you realize yet the typo I was correcting? It's the daily "WTF", not the daily "WPF".
Driven to the ARMs by x86.
|
|
|
|
|
Ah. I am not really into all these shorthands. Thanks. By the way, these two acronyms are equivalent for me (WPF and WTF).
Greetings - Jacek
|
|
|
|
|
Jacek Gajek wrote: these two acronyms are equivalent for me
To me they are Windows Presentation Foundation and What The F***. So I guess they are the same to me too.
Driven to the ARMs by x86.
|
|
|
|
|
AspDotNetDev wrote: Windows Presentation Foundation and What The F***
This is what I meant... C'mon, WTF = Worse Than Failure, don't be oh, rude, oh.
Greetings - Jacek
|
|
|
|
|
Ah yes, like "Read The Free Manual".
Driven to the ARMs by x86.
|
|
|
|
|
Hehe, not heard that one before. RTFM has gone out of fashion though with the elimination of actual manuals to refer to.
|
|
|
|
|
It's funny that you used the wrong term ("shorthands"), followed by the correct term ("acronym"). You are consistent in your inconsistencies.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|