You may already be aware that Google’s search interface can be used as a calculator. Google Calculator, as this feature is known, offers access to the kinds of functions (addition, multiplication, and more) offered by conventional electronic calculators. Unlike conventional electronic calculators, however, Google Calculator is able to utilise information about the external world, such as exchange rate data or measurement unit ratios. This allows you ask Google what 1lb is in kg, or what $250 (US) is in pounds sterling. You can combine the traditional calculator functions with these information look-up functions, too, which means you can do things like calculate what a $250 (US) item would cost in pounds sterling if you paid import duty of 17.5% on it. There’s a bit of a learning curve but it’s fairly gentle despite Google’s documentation of the syntax of these functions being a bit patchy.
So far, so handy. Handier still is the fact that these Google Calculator features can also be accessed in a Google Docs spreadsheet. Want a cell in your spreadsheet to show the value of $250 (US) in pounds sterling? Enter this in the cell:
=GoogleFinance("CURRENCY:USDGBP")*19.9
Great! Now you can, for instance, compare the cost of international products or services no matter which currency they’re given in.*
Want a second cell to show what 1lb is in kg? Enter this in the second cell:
=GoogleLookup("1lb","in kg")
There’s a gotcha here, though. The above will give you 0.45kg
. That’s not just 0.45
with a cosmetic kg
: it’s as though you’d typed 0.45kg
into the cell. Having some non-numerical information in the cell (the kg
part) makes Google Docs treat the entire contents of the cell as text rather than numerical data. That means you can’t use it for mathematical calculations unless you process it first to strip away the non-numerical part. Here’s an example of how to do that:
=substitute(GoogleLookup("1lb","in kg"),"kg","")
Now, go forth and multiply!
* If I’m not mistaken, Google updates its currency information 20 minutes after the live currency exchange markets. This means you probably shouldn’t use Google Docs for, say, currency trading… but since ethically speaking you probably shouldn’t trade currencies anyhow, I won’t be sorry if you make a fat loss on the currency markets by trying to use Google Docs as your analysis platform.