Click here to Skip to main content
15,891,136 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
AnswerRe: excel formula anyone Pin
phil.o6-Jul-11 4:45
professionalphil.o6-Jul-11 4:45 
GeneralRe: excel formula anyone Pin
0bx6-Jul-11 8:51
0bx6-Jul-11 8:51 
GeneralRe: excel formula anyone Pin
Klaus-Werner Konrad6-Jul-11 10:46
Klaus-Werner Konrad6-Jul-11 10:46 
GeneralRe: excel formula anyone Pin
phil.o6-Jul-11 22:58
professionalphil.o6-Jul-11 22:58 
GeneralRe: excel formula anyone Pin
myramla14-Jul-11 21:24
myramla14-Jul-11 21:24 
GeneralRe: excel formula anyone Pin
BobJanova14-Jul-11 22:25
BobJanova14-Jul-11 22:25 
GeneralRe: excel formula anyone Pin
phil.o15-Jul-11 2:13
professionalphil.o15-Jul-11 2:13 
AnswerRe: excel formula anyone Pin
StevenFoust19-Jul-11 5:28
StevenFoust19-Jul-11 5:28 
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.
GeneralSpotted on The Daily WPF... Pin
Lutosław4-Jul-11 12:37
Lutosław4-Jul-11 12:37 
GeneralRe: Spotted on The Daily WPF... Pin
GenJerDan5-Jul-11 8:01
GenJerDan5-Jul-11 8:01 
GeneralSpotted on The Daily WTF... Pin
AspDotNetDev5-Jul-11 8:13
protectorAspDotNetDev5-Jul-11 8:13 
GeneralRe: Spotted on The Daily WTF... [modified] Pin
Lutosław5-Jul-11 10:32
Lutosław5-Jul-11 10:32 
GeneralRe: Spotted on The Daily WTF... Pin
AspDotNetDev5-Jul-11 10:53
protectorAspDotNetDev5-Jul-11 10:53 
GeneralRe: Spotted on The Daily WTF... Pin
Lutosław5-Jul-11 11:26
Lutosław5-Jul-11 11:26 
GeneralRe: Spotted on The Daily WTF... Pin
AspDotNetDev5-Jul-11 11:39
protectorAspDotNetDev5-Jul-11 11:39 
GeneralRe: Spotted on The Daily WTF... Pin
Lutosław5-Jul-11 11:47
Lutosław5-Jul-11 11:47 
GeneralRe: Spotted on The Daily WTF... Pin
AspDotNetDev5-Jul-11 11:49
protectorAspDotNetDev5-Jul-11 11:49 
GeneralRe: Spotted on The Daily WTF... Pin
BobJanova5-Jul-11 23:43
BobJanova5-Jul-11 23:43 
GeneralRe: Spotted on The Daily WTF... Pin
#realJSOP7-Jul-11 2:16
mve#realJSOP7-Jul-11 2:16 
GeneralRe: Spotted on The Daily WTF... Pin
Lutosław7-Jul-11 7:51
Lutosław7-Jul-11 7:51 
GeneralRe: Spotted on The Daily WTF... Pin
BobJanova7-Jul-11 22:45
BobJanova7-Jul-11 22:45 
GeneralTry again... Pin
0bx1-Jul-11 3:54
0bx1-Jul-11 3:54 
GeneralRe: Try again... [modified] Pin
Lutosław4-Jul-11 2:50
Lutosław4-Jul-11 2:50 
GeneralRe: Try again... Pin
0bx4-Jul-11 11:42
0bx4-Jul-11 11:42 
GeneralCheck for True to return True... PinPopular
Sander Rossel30-Jun-11 10:40
professionalSander Rossel30-Jun-11 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.