Why You Shouldn't Use Spreadsheets For Important Work 422
An anonymous reader writes "Computer science professor Daniel Lemire explains why spreadsheets shouldn't be used for important work, especially where dedicated software could do a better job. His post comes in response to evaluations of a new economics tome by Thomas Piketty, a book that is likely to be influential for years to come. Lemire writes, 'Unfortunately, like too many people, Piketty used spreadsheets instead of writing sane software. On the plus side, he published his code ... on the negative side, it appears that Piketty's code contains mistakes, fudging and other problems. ... Simply put, spreadsheets are good for quick and dirty work, but they are not designed for serious and reliable work. ... Spreadsheets make code review difficult. The code is hidden away in dozens if not hundreds of little cells If you are not reviewing your code carefully and if you make it difficult for others to review it, how do expect it to be reliable?'"
What he's really saying is (Score:4, Insightful)
"I don't know how to use spread sheets properly."
Re:What he's really saying is (Score:5, Insightful)
To be fair, neither to the vast majority of people who use spreadsheets for important work.
Re: (Score:3)
Not for anything that is repeated over time. I've seen countless spreadsheet "managed" items and the errors that creep in over the months and years is pretty hilarious | scary | useful (for cons) etc
Sounds like the classic definition of "legacy software".
You know, custom software written so bright and new and error-free a dozen years ago but now is so bug-ridden and completely incomprehensible that no one can maintain it? You've heard of it, right?
I've lived it. Trust me, there's nothing inherently worse
Re:What he's really saying is (Score:5, Insightful)
Disagree. I think what he's really saying is "I've had to maintain and develop tools made by people that don't know how to use spreadsheets properly, and I'm fucking sick of it."
Re:What he's really saying is (Score:5, Insightful)
This work forms a major part of my work load don't fuck with it!
Also, it is appropriate. It would be inefficient to develop a proper relational database application on the whim that some set of data points might be useful. Spreadsheets are a proving ground, and important stage in the life cycle of an application.
Re:What he's really saying is (Score:5, Funny)
I know exactly how to use spreadsheets properly. Just don't.
Re:What he's really saying is (Score:4, Interesting)
Sadly, one of the big selling points for spreadsheets is their application. Pretty much any computer being used for work will have something that can read and display excel spreadsheets, you can send one to anyone and not have to worry about what they have installed. Then again you can get the same level of compatibility by outputting PDFs from matlab or something slightly saner like that....
Re: (Score:3)
Spreadsheets are really easy to use properly, all you have to do is adjust your mind to the idea of creating two styles of spread sheet, the working spread sheet, well laid and and documented, to ensure the workings are understandable and checked and a linked presentation spreadsheets where the data is taken from the working spreadsheets and presented prettily of nepotistic management, so even the dumbest spawn of management can, well, at least pretend to understand.
Other things you can do is check formu
Re:What he's really saying is (Score:4, Insightful)
you can send one to anyone and not have to worry about what they have installed
Except that they need to be running Windows or Mac, with Microsoft Office installed.
Actually, LibreOffice/OpenOffice are pretty good at importing and exporting .xls and .xlsx. And considering how incredibly obfuscated^H^H^H^H^H^H^H^H^H^H complicated the MS OOXML standard is, I'd say that's quite an accomplishment.
You can even import .ods in MS Excel, if you have the relevant plugins installed.
That said, I agree with TFA: don't go overboard with fancy spreadsheets. Keep them simple, for the sake of your own mental health and that of your co-workers.
Re: (Score:3)
Unless the spreadsheet has Excel macros running.
Re: (Score:3)
Re:What he's really saying is (Score:4, Insightful)
It needs restating because people forget it all the time.
Some things stick (Score:5, Informative)
Re:Some things stick (Score:5, Funny)
Were the survey results collated on a spreadsheet?
Re:Some things stick (Score:5, Funny)
nope Access Database.
now which is scarier?
Re:Some things stick (Score:5, Insightful)
I really think Piketty deserves a lot of credit for releasing his "source" spreadsheets on such a substantive and controversial work. Most authors do not. If the critiques turn out to be substantial and extensive, I plan on waiting for a second edition with corrections before investing time in reading it.
Re:Some things stick (Score:4, Informative)
Re:Some things stick (Score:5, Informative)
I've done audits on spreadsheets. They're not terribly difficult, and I dare say they're easier than many of the code reviews I've been through.
The most important thing is to understand how to use the spreadsheets. Either use separate worksheets for each major step in the calculation, or at least separate the computations using extra blank space. That serves the same function as code blocks, breaking up the computation into smaller, more manageable, pieces. Each small piece can be audited separately, and it provides a clear trail of how one number becomes another.
Next, use your formatting, even if it's not in a worksheet ever intended for public viewing. I'm particularly a fan of using conditional formatting to highlight the cells in a sheet (especially minimums and maximums) that will be passed on to the next worksheet. Then it's easy to check that the correct values are being passed, and the intermediate values all make sense.
Finally, use your fill tools correctly to ensure that the same computation is being applied to all cells. You should be able to audit the top of your worksheet and fill down to the bottom, without any formatting or visual elements getting in the way, and know that the whole worksheet is correct. When reviewing an old worksheet, note that Excel will highlight (with a green corner mark, as I recall) cells that don't fit the pattern.
Finally, remember that writing an algorithm for a spreadsheet has some of the same pitfalls as any other implementation. Double-check any function of which you're not certain the parameters. Put comments in non-obvious areas. Don't be too clever, and of course, if someone else can't understand your brilliance, you're not being brilliant.
Re: (Score:3)
The most important thing is to understand how to use the spreadsheets.
The most important thing is to understand how to use the spreadsheets.
The most important thing is to understand how to use the spreadsheets.
Knowledge is power.
Re: (Score:3)
The message "just say no to Excel" still stands.
Re: What he's really saying is (Score:4, Insightful)
Most people have no idea how to use a relational database.
Re: What he's really saying is (Score:5, Interesting)
Well, I sort of am, but not for that reason.
There is nothing worse than trying to get a spreadsheet person up and running on relational databases. They argue with you about every point, then they freak.
Re: What he's really saying is (Score:4, Informative)
There is nothing worse than trying to get a spreadsheet person up and running on relational databases. They argue with you about every point, then they freak.
Sure there is... there's trying to get a db user to understand spreadsheets. How many times have i told you, the right tool for the right job (watch out for that low hanging pipe! ..... nevermind....).
Re:What he's really saying is (Score:5, Insightful)
"I don't know how to use spread sheets properly."
Or, I realize that just because I have a hammer not all problems are nails.
Re:What he's really saying is (Score:4, Insightful)
Even teaching students matlab would probably be an improvement, but excel is what they default to teaching anyone outside math and CS, building all the coursework around it.
Re:What he's really saying is (Score:5, Funny)
No kidding. Also, it MAY not be that easy to review the code in a spreadsheet, but it is VERY VERY EASY to test it. If you want reliable spreadsheets its PERFECTLY possible to test them to the Nth degree, far more so than with most other code. You have a place to put the tests, and a place to put the expected results, its all rather devilishly simple actually. For that matter you can document the bejeezus out of them too.
I think spreadsheets are like any sort of simple interpreted language. Idiots can easily blow their left foot off. Real software engineers can also do some very cool stuff. Most of the perl code I've seen is ugly as all hell and pretty worthless, but MY perl code is a thing of beauty that people maintain for years. Its all in how you use the tool.
Re: (Score:3)
In MS Excel 2003 and 2013 ctrl-T is your friend when debugging a couple of thousands of cells with formulas. It also indicates what cells have formulas and what cells have values.
Having said that, I am busy trying to convince my boss to have a massive pain in the ass excel working document with dozens of macros and a thousands of rows converted to a relational database.
Excel is useful, but people often exceed it's limits.
What you're really saying is (Score:5, Insightful)
"I never worked in a company with normal people."
I'm guessing you haven't had the pleasure of working in the typical firm where the company's years-old ENTIRE lifetime of work and data is passed around e-mail as a 80MB Excel attachment.
Re:What you're really saying is (Score:5, Funny)
... where the company's years-old ENTIRE lifetime of work and data is passed around e-mail as a 80MB Excel attachment.
This... is retarded enough to loop all the way around the spectrum and land squarely on awesome.
Re: (Score:3)
Re: (Score:3)
Well okay but, how did they manage to email 80mb files successfully in the first place? That's a corporate I.T. feat right there.
Re:What he's really saying is (Score:4, Insightful)
No, what he is saying is that it is easy to "write" sloppy code for excel and hard to write good code.
And even harder to review it.
It's similar to the reason a) people moved away from basic, and b) basic evolved to be (duck, please no flame) almost usable (I still do not like it, but recognize that it is possible to write usable code in visual basic).
If you want to criticizes him, picking on Piketty is VERY political, "excel" errors are galore in neocon publications, but of course the FT did not find anything not to love there, but saying that just maybe having a small group of people siphoning off all the cash from society is not sustainable for ever does make them nervous and very desirous to find some scab to pick at...
Nevertheless he is right, it would be very good if decision makers would be able to "read the numbers" and not just "massage the numbers". :)) have a tendency to get you to fiddle the numbers until the taxman aherm the reader sees what you would like them to see...
Something like R or ADaMSoft would drive you to test ideas on datasets and learn from them whereas excel (or calc
Re: (Score:3)
Spread sheet is evil.
Re: (Score:3, Informative)
Yeeaaahhhh you lose.
http://www.huffingtonpost.com/2014/05/27/piketty-not-wrong_n_5397358.html
Krugman was joined by economists Justin Wolfers, James Hamilton, Gabriel Zucman, frequent Piketty critic Scott Winship and others, along with The Economist's Ryan Avent, The Washington Post's Matthew O'Brien, and The New York Times' Neil Irwin, to name a few.
Re:Piketty's real problem isn't spreadsheet-relate (Score:4, Informative)
"Oh, that's just a right-wing smear from EVUL RETHUGLICANS!!!"?
Well the part about figures being constructed "out of thin air" is a smear (whoever it may be who claims it), as becomes clear when one reads the rest of the article you cite. The most balanced assessment of the Giles vs Picketty dispute is perhaps the piece Inequality: A Piketty problem? [economist.com] from The Economist.
Re: (Score:3)
One of the nastiest things about spreadheets in relation to software is that software is essentially linear, making it easier to follow what's affecting what.
Spreadsheets are 2-dimensional, can incorporate data from invisible cells and even other sheets. Then on top of that, what's normally displayed is the results, not the code. There's no side-by-side view of code/value on any spreadsheet I'm aware of.
Also, since code is linear, one screwup and it tends to make itself obvious by propagating downstream. Sp
Spreadsheets - best and worst thing there is (Score:4, Funny)
Spreadsheets are like a blank piece of paper with grid squares. Which means you can put anything down, tied together with some formulae, and it's brilliant.
Which is also why it's complete pants - the "anything goes" really does mean that.
(That, and it will tend to break when you most rely on it)
Re:Spreadsheets - best and worst thing there is (Score:5, Informative)
What people fail to realize is that spreadsheets are like any other form of programming, and therefore should be treated as such. Write tests. Break complex formulas down into named cells. Use references to carry concepts. Beware of globals. Keep small concepts small, simple, and modular. Write more tests.
Does anybody do that with every spreadsheet they write? Doubtful. I know I only go to all that trouble myself when I have a boatload of inputs that have to get put together. I usually discover about part way in that the sheet is going to be complex enough to need tests. When I do, it's time to start refactoring it, and these are my general steps:
Of all of these, giving cells and ranges names is the most important, because it makes the sheets readable. I can then usually understand the results well enough to know if my formulas are working, but a complex formula often needs an independent set of tests to prove the discontinuities in the functions are actually where I think they should be.
Re: (Score:3)
Re:Spreadsheets - best and worst thing there is (Score:5, Insightful)
Spread sheets are such awesome tools that they allow non-programmers to create the same problems that noob programmers do while writing code.
Sounds like job security. (Score:3)
Dunno if that's a good or bad thing, though.
I've had to take over maintenance of a few "excel" based applications. Never. Again.
Re: (Score:3)
Dunno if that's a good or bad thing, though.
I've had to take over maintenance of a few "excel" based applications. Never. Again.
That's Excel for you.
.xlsx). However the biggest sin Excel does (to me) is removing leading zeros, that number has to fix a N digit mask or it will fail.
I use a lot of scripts that are based on CSV files for input, output and storage of values. You want to know what I edit them in... Notepad. Because Excel fucks around with it too much and I'm sick of the "but this is not in our proprietary format" dialogue when closing it (it also refuses to save on exit unless I change it to
Excel has grown into a t
Re: (Score:3)
You should absolutely put in a Trigger Warning when you talk about Excel like that. ;)
So what's the alternative? (Score:5, Interesting)
Re: (Score:2)
Re: (Score:3)
In this house, we do not use the F-word!
Re: (Score:3)
Python plus Numpy. Plus Pandas if working with large amounts of data.
Re: (Score:3)
For those things that a spreadsheet does quickly and well, you could waste hours screwing around with Numpy
Re: (Score:2)
Re: (Score:2)
This problem, reproducible data analysis, has been solved before.
Decent alternatives to spreadsheets (which are entirely opaque) are (a) Matlab, (b) Mathematica notebook, (c) iPython notebook+numpy+pandas, (d) SAS/SPSS/R
Re: (Score:3)
SPSS is nice, but it is expensive as hell.
Re: (Score:2)
That's what the GNUplot module is for.
Re: (Score:3)
Fortran. If you laugh, then you don't know much about advanced computing.
Re: (Score:2)
There was one case where my friend needed to analyze a modest amount of data -- 70k rows, 30 columns or so -- and Excel would absolutely choke on her new laptop running Excel. Dropped it into Postgres on my anemic netbook and queries were lightning fast. No need to specify column types, either -- just load
Re: (Score:2)
Access.
People will laugh. But in an office environment it's an excellent solution. But one can still write formulas directly in reports and forms, so code review isn't necessarily easier.
Re: (Score:3)
Access.
People will laugh. But in an office environment it's an excellent solution. But one can still write formulas directly in reports and forms, so code review isn't necessarily easier.
For those who don't understand relational database concepts, Access can be a machine gun for shooting yourself in the foot. The types of errors that typically find their way into Excel spreadsheets can get magnified several times over by moving to Access.
Those who do understand relational database concepts are probably putting their data in a real DBMS (MSSQL, Oracle, Postgres, MySQL, etc).
Re: (Score:3)
Access has its place. Its front-end and integration with other office solutions ensure it is the best quick, light database solution for majority of small businesses.
But the emphasis is on "light". I am sure everyone has dealt with Access files that are used as whole business-tracking applications. Files that approach close to their limit of 4GB. Files that are simultaneously being used by all the users to record their timesheets in. And anytime it is suggested to move to a more proper database engine, ever
Re: (Score:2)
Re: (Score:2)
gack. Perl is one of the few things that make Excel look good.
This is like saying first class is the only way to (Score:2)
"spreadsheets" = computation program (Score:2, Insightful)
ugh...so anger! always with the nomenclature distinctions...this is a stupid approach to a real problem
a spreadsheet is a computer program
that's it...
to criticize the act of entering data and performing computations on that data using computer software is the height of ignorance
I don't know if he's right or not, but this guy's real criticizm, once you fight through his ignorance of the issue is that in his view Pickety didn't show enough of how he got his figures...or more accurately, the TFA author had to
Re:"spreadsheets" = computation program (Score:5, Insightful)
Maybe you should read it again?
His real criticizm is that spreadsheet software is horrible for any high end work, or with anything you want to share, and he is correct.
"so he probably doesn't know how to use the interface of a spreadsheet very well, which makes the act of checking a formula tedious..."
it is tedious, even if you are an expert and even if the user uses goof practices.
"P-hacking is the problem in social science/economics research, not using 'spreadsheets'"
I don't think you know what P-Hacking is.
can or cannot compute (Score:2)
you're wrong on both counts...that is not his 'real' criticism and even if it was he and you would still be wrong
spreadsheets are ***computation software***
if it can execute the operation needed for the research then it is acceptable...if not, then no
end.
it's a tool to analyze data...that's ****all any of these programs are, ever****
the method of analysis is either proper
Re: (Score:2)
if it can execute the operation needed for the research then it is acceptable...if not, then no
I think geekoid is trying to say that even though spreadsheets can in theory "execute the operation needed for the research", practical limits inherent in the spreadsheet user interface make it difficult to verify that what the spreadsheet is calculating matches what you wanted to calculate. Consider this: An 8-bit microcomputer "can execute the operation needed for the research" but that doesn't make it the best tool.
criticizing cars b/c you can't use a brake pedal (Score:3)
thanks for the input but this is still the wrong analogy...
it is not what TFA is saying, and it is incorrect in fact
Picketty is being criticized in TFA because he used a spreadsheet, which has 'cells' which contain 'formulas' which are descriptions of mathematical operations on data
TFA author is saying that, I quote again:
Re: (Score:3)
So when did Slashot turn into a "the beige box is a hard drive because I say it is and fuck you elitist technical folk" site?
Re:can or cannot compute (Score:4, Insightful)
if it can execute the operation needed for the research then it is acceptable...if not, then no
You could probably write this computational code in a shell script, too. But it would still be a terrible idea. Why? Because it's the wrong tool for the job. Simple as that. It doesn't matter what you can and cannot do, it matters what you should do, and you shouldn't use spreadsheets for anything complicated. It's simply too easy to make stupid mistakes that are difficult to trace and correct (or even notice).
you can't blame a spreadsheet for a poorly devised experiment...you *can* blame a researcher for using an inappropriate statistical model...you *cannot* criticize the method of analysis as long as it is physically capable of the computation
TFA isn't blaming the spreadsheets, he's blaming the people who use them for using them. It's not acceptable to use a tool that works poorly and is highly susceptible to mistakes, and no one should listen to anyone who does so unless that person is damned good at that tool: yes, it is possible that someone is so fantastically good with spreadsheets they can use them for massive data analysis with no problems. They are, however, the exception, and I would generally be inclined to disbelieve the results from anyone who does large work with spreadsheets (simply because of the possibility for errors and the lack of concern for accuracy that using spreadsheets demonstrates). So, the conclusion is that you shouldn't use spreadsheets for important work. You absolutely can criticize an analysis if it uses a tool that is highly likely to introduce errors, and that's fundamentally the point (and it's underscored by the fact that that is precisely what happened in Piketty’s case).
I agree... (Score:2)
If you have a custom formula in a spreadsheet, create it in the program's scripting language instead of copy/pasting to tons of cells. Create the spreadsheet in a repeatable layout that is ease to understand the sections and the flow of the data.
I do not see how that is any different than using a proprietary program. At least with a spreadsheet you can look directly at the code for errors. In
Not "important work" (Score:4, Insightful)
It's not "spreadsheets shouldn't be used for important work", it's "spreadsheets should not be used for work that's not suitable for spreadsheets". Tools for the job, and all that.
Re: (Score:2)
Code reviewing a spreadsheet (Score:5, Insightful)
Re: (Score:2)
>> For non-programmers, a spreadsheet lowers the barrier to entry.
Possibly, but this guy is a Computer Science prof. He should have already known much better.
Re:Code reviewing a spreadsheet (Score:5, Insightful)
For non programmers modern spread sheet give the user rope, with a noose already premade and a map on where to put your head.
Another major issues with spreadsheets (Score:3, Insightful)
Spreadsheets as a software development platform? (Score:5, Insightful)
You're doing it wrong.
Re:Spreadsheets as a software development platform (Score:5, Insightful)
Tell that to the entire finance and insurance industry.
Re:Spreadsheets as a software development platform (Score:4, Funny)
is that why we're fucked?
Re: (Score:3)
Is that the industry that cratered a couple years ago, taking much of our economy with them?
I don't think they need telling. They need mercy killing.
Comment removed (Score:5, Insightful)
Re: (Score:2)
Re: (Score:3)
Well, what makes you think that Gates, Buffet, or Slim work harder than anyone else? Clearly there is plenty of luck involved, so R can be greater than G but there is a LOT of noise. As for expecting the richest man to be a Rockefeller, who says the Rockefellers aren't vastly more wealthy than Gates or any other one of these people that Forbes lists? Do you think they keep their money around in places where it can be counted? Nobody has EVEN THE SLIGHTEST IDEA how much money the Rockefellers, the Rothschild
Re: (Score:3)
That is a key assertion, especially if broadened to, say, the top 20%. What is your source? All the studies I have seen say It is much harder for a poor child born in America to climb into the rare air of the countryâ(TM)s highest earners than it is for a similar child in, for example, Canada or Denmark. [washingtonpost.com]
Re: (Score:3)
That is a key assertion, especially if broadened to, say, the top 20%. What is your source?
Here is some info:
61% of U.S. households will break into the top 20% of incomes (roughly $111,000) for at least 2 consecutive years.
39% of U.S. households will break into the top 10% of incomes (roughly $153,000) for at least 2 consecutive years.
5% of U.S. households will break into the top 1% of incomes (roughly $360,000) for at least 2 consecutive years.
That said, 20% of U.S. households will fall into poverty (roug
Re:Piketty's work will be done for him (Score:4)
You can't audit spreadsheets (Score:4, Insightful)
I figured this out twenty-mumble years ago.
I was doing data analysis in spreadsheets, and realized that I had no way to audit them.
The data and the analysis were all just...there...in the spreadsheet.
As soon as I got a grip on my data, I changed over to C programs that I could test, and document, and validate, and run at any time to demonstrate that input X generated output Y.
Blame the tool... (Score:3)
The problem isn't the spreadsheet. The problem is people building ugly models in it. Do they seriously think that if those models were written in C, Java or Perl they would have been magnitudes better? I doubt it; you're just transplanting bad habits onto a different platform.
Of course, if he'd used trained professionals to build his models in whatever language of choice the models would be better. If he'd used trained professionals to build his spreadsheet models they would have been better as well.
Re: (Score:3)
The "it's not the tool, it's the people" argument has one major flaw.
Tools are built so that people can perform tasks they can't otherwise do. As a result, if tool fails because it's not good enough for the task, at least part of the blame lies with tool and its creator.
Re: (Score:3)
There are, however, languages that make it far easier to write code that is less readable and harder to maintain. As a specific example, compare Fortran 77 with Fortran 90. I can write the latter without any need for numerical statement labels. I can write a straightforward "DO WHILE" loop in Fortran 90, while in Fortran 77, I'd have to use the dreaded GOTO to get the same effect. Aside from basic stuff like that, I can write formulas in Fortran 90 with whole
Misleading title (Score:2)
I think the title should be "Why You Shouldn't Use Spreadsheets for *Complicated* Work". Just because a job is important doesn't mean the calculation is complex and something that needs to be coded in, for example, matlab.
If my job is to make a pie chart, I can't see why using Excel is a bad idea. On the other hand, if I am examining the variance of several thousand data points and then plotting the residuals from a gaussian fit, then yes, I can see why using something else would be a lot better. It has not
A Formula only an Actuary could Love (Score:5, Interesting)
There are no corporate secrets below, but I stumbled upon this formula in an actuarial spreadsheet (I'm a developer with an actuarial education).
The only way this logic could be verified is by breaking the single formula into 20+ different cells with more simple calculations.
And of course it is in several thousand cells, bringing any computer at all to its knees during calculation.
A good example of how not to use Excel (but the actuaries don't have access to IT prototyping or core development).
=IF(F6="050",tiers!$D$21+IF(AND(F6="050",OR(E6="W",E6="X")),tiers!$D$29-tiers!$D$26+VLOOKUP("N"&100&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&"N/A"&M6/12&"/"&N6&"0-"&R6/1000&C6*1,tiers!$L$2:$W$20969,12,0),IF(OR(E6="W",E6="X"),VLOOKUP("N"&F6*1&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&"N/A"&M6/12&"/"&N6&"0-"&R6/1000&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="P",M6=36,N6=60),tiers!$D$29-tiers!$D$26+VLOOKUP("E"&100&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(E6="P",M6=36,N6=60),VLOOKUP("E"&F6*1&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="P"),tiers!$D$29-tiers!$D$26+VLOOKUP("E"&100&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6/12&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(E6="P",VLOOKUP("E"&F6*1&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6/12&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="*",M6=6),tiers!$D$29-tiers!$D$26+VLOOKUP(B6&100&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&IF(Q6=48,"0-4","6-10")&M6&"/"&N6&"0-100"&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(E6="*",M6=6),VLOOKUP(B6&F6*1&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&IF(OR(L6="PPH08",L6="PTH08"),"0-9",IF(Q6=48,"0-4","6-10"))&M6&"/"&N6&IF(R6=125000,"100-125","0-100")&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="*"),tiers!$D$29-tiers!$D$26+VLOOKUP(B6&100&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&IF(OR(L6="PPH08",L6="PTH08"),"0-9",IF(Q6=48,"0-4","6-10"))&M6&"/"&N6&IF(AND(OR(L6="PPH08",L6="PTH08"),R6=100000),"0-100",VLOOKUP(R6,tiers!$B$64:$C$70,2,0))&C6*1,tiers!$L$2:$W$20969,12,0),IF(E6="*",VLOOKUP(B6&F6*1&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&IF(OR(L6="PPH08",L6="PTH08"),"0-9",IF(Q6=48,"0-4","6-10"))&M6&"/"&N6&IF(AND(OR(L6="PPH08",L6="PTH08"),R6=100000),"0-100",VLOOKUP(R6,tiers!$B$64:$C$70,2,0))&C6*1,tiers!$L$2:$W$20969,12,0),"ERROR")))))))))),IF(AND(F6="050",OR(E6="W",E6="X")),tiers!$D$29-tiers!$D$26+VLOOKUP("N"&100&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&"N/A"&M6/12&"/"&N6&"0-"&R6/1000&C6*1,tiers!$L$2:$W$20969,12,0),IF(OR(E6="W",E6="X"),VLOOKUP("N"&F6*1&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&"N/A"&M6/12&"/"&N6&"0-"&R6/1000&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="P",M6=36,N6=60),tiers!$D$29-tiers!$D$26+VLOOKUP("E"&100&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(E6="P",M6=36,N6=60),VLOOKUP("E"&F6*1&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="P"),tiers!$D$29-tiers!$D$26+VLOOKUP("E"&100&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6/12&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(E6="P",VLOOKUP("E"&F6*1&VLOOKUP(L6,tiers!$B$52:$C$55,2,0)&"N/A"&M6/12&"/"&N6&VLOOKUP(R6,tiers!$B$57:$C$59,2,0)&C6*1,tiers!$L$2:$W$20969,12,0),IF(AND(F6="050",E6="*",M6=6),tiers!$D$29-tiers!$D$26+VLOOKUP(B6&100&VLOOKUP(L6,tiers!$B$38:$C$49,2,0)&IF(Q6=
Re:A Formula only an Actuary could Love (Score:4, Insightful)
Wow!
If I was in my early 20's, I'd probabbly think I was 'leet'
Now in my mid 40's, I'd probabbly fire whomever wrote it.
Re:A Formula only an Actuary could Love (Score:5, Funny)
What is the end result for this one cell?
42
Understand their uses and limitations ... (Score:3)
Lemire is right, spreadsheets are terrible for complex models that need to be modified. He is right for precisely the reasons he outlined.
That doesn't mean that spreadsheets are useless. If you have a standard form where you're only modifying values, rather than functions, spreadsheets are great. There is a low barrier to entry and they are good for communicating results. But as soon as you need to audit or modify functions, you are jumping all over the place and it is easy to make mistakes. Yes, there are ways to consolidate your code (at least in spreadsheets that support scripting), but you are going to take so much time learning how to use the advanced features of you spreadsheet that may as well learn a dedicated programming language in those cases.
And the reality is that it's pretty easy to learn how to use programming languages these days. Not as easy as using a spreadsheet, to be sure, but even the standard Python distribution can handle most of the vulgarities of loading data into memory and storing it properly (i.e. you don't have to worry about parsing or data structures too much). By adding the appropriate modules you can do some decent visualization of data. In some cases the visualization will be better than spreadsheets, and in others spreadsheets will have the lead. And that's just Python, which I chose as an example because I'm familiar with it. The reality is that there are much more appropriate domain specific languages out there.
Re: (Score:2)
Maybe a lack of all these bloated runtimes will help filter out the terrible programmers.
OOXML or Excelception (Score:2)
I think Excel stores formulas in a zipped XML document. Someone could write a tool that extracts each cell's formula from a workbook, sorts them topologically, and spits out JavaScript, Python, or whatever your favorite scripting language is.
Or you could make an Excel spreadsheet that lists formulas in other spreadsheets [j-walk.com].
Re: (Score:2)
Re: (Score:2)
If you're in Excel, you can drag the function bar down so it spans multiple lines. You're not limited to left-right scrolling or a single line at a time.
Probably also the same in other office suits.
Re: (Score:3)
I've actually written a very limited version of this. My boss likes to prototype algorithms in Excel, but I need to cram them into a machine with instructions written in a scripting language. I first use a VBA tool to tokenize and collect the Excel formulas, then over to Python to do some conversions of a few built in fuctions, then run it through a symbolic algebra toolkit (Sympy). Sympy has a nice feature where it can format its output as c-code. At that point, if I were using C I would be all done, but I
Re: (Score:2)
That's not the problem. The real issue is that spreadsheets are effectively a big ball of goto with multiple entry points.
Re: (Score:3)
No they aren't, they're constraint based systems. flow of control isn't the focus. You could easily reduce a spreadsheet to a bunch of Prolog or to almost any functional language.