Yesterday at work I was generating price breakdowns for a bunch of POD printing situations, doing it the old-fashioned way by dedicating a separate chunk of a spreadsheet to each variation, when it occurred to me that maybe it would be easier to set up a dynamic calculator for these scenarios in Python, which I’ve been studying on and off (mostly off) for a while now.
Then it occurred to me that I might not even have to leave the comfort of my spreadsheet, since most such applications include functions for calculating and doing other useful things. I rarely use anything more complex than =sum()
, but I know the other stuff exists. Mostly I needed to be able to set up conditional behavior, so as long as there was an if/then function . . .
It turns out that Google Spreadsheets, which is what I was working in, has an IF() and a host of other handy functions. So I stayed up way too late building that calculator, for which there was no real purpose, since I’d already sent my boss a static spreadsheet with the numbers he needed.
But then today I still had spreadsheet-based forms on my mind, and I decided to tackle a project that had been on my Python to-do list for months—namely, a castoff calculator. I had built a shitty one in PHP a few years ago for a class, and then I forgot about it so utterly that when I needed to do a castoff more recently, I searched online for a Web-based calculator and was shocked and appalled to see my own domain name in the first hit. That form is embarrassingly useless, but since I’m working in print book production again (more on that later, I guess), I might occasionally have to do a castoff. Now seemed like a good time to replace it.
Behold, therefore! Castoff Calculator. To use it, you must first make a copy of the document; instructions are at the top of the first sheet. Aside from that little inconvenience, I think this version is actually pretty sweet, and I had fun making it. It would have been easier to manage the calculations in Python, because reusable variables and functions (shoutout to the sensible coding habits I picked up from Learn to Program: The Fundamentals), but it’s hard to beat Google Spreadsheets for quick-and-dirty building and sharing.
Lemme know if you find this useful, if you find holes in it, or if there’s something else you think it should do.
Photo: Wang 700 Advanced Programmable Calculator by dvanzuijlekom; some rights reserved.