Let’s do some math with Google Spreadsheets. The OG of programming is doing math, and the practice of learning how to do math well, is very similar ot the practice of being a good programmer. Spreadsheets are a handy way to see the connections, and incidentally, if that sort of thing is relevant to you, to learn a tool that lets you do some real fancy math.
Click in any space on the spreadsheet, usually referred to as a “cell.” Just so we are on the same sheet (haha), let’s agree to both click on the top-left cell. Note that when you do this, the A above the cell, and the 1 to its left, both have a slightly darker background color than the other letters and numbers.
In fact, let’s take a minute here to notice these letter and numbers. Any programming you do with Google (or Microsoft) spreadsheets will require you to get very familiar with how these symbols work, and how you are supposed to use them.
Try scrolling as far down and to the right you can. You’ll see that you can get to Z on the right side and to 1,000 vertically. So is that it – do you have 26,000 cells to work with? Not really – you can add more rows and more columns if you want. We don’t yet know how to do that, at least if you haven’t worked with Sheets before, but if you believe me that this is possible, that you can add more rows or columns, it’s logical to ask, Well, how many more cells can I add?
Nothing in the product itself immediately answers that question. But you can search on the Internet and find out – what search query will find the right information is left as an exercise for you, but I’ll tell you the answer – at the time I am writing this, Google says you can have no more than 256 columns, or 400,000 cells, whichever limit is reached earlier. (Another exercise is to figure out from these numbers what the maximum number of rows is, that you can add.)
Well, we know something about the limits of these symbols – how “big” they can get. But let’s step back a bit and ask – why are they there at all Answering that question is really going to be our first foray, I think, into programming proper. But it’ll take us a few steps first to prepare ourselves.
Let’s go back to just doing math – type in a number into the top-left cell, then click to the cell one to the right (which highlights B and 1, respectively, in the column and row symbols) and type in another number. Let’s say you typed in 23, and 52. Now go one more cell to the right (yep, you are in cell C1 now) and click the following menu items: Insert, Function and SUM.
Now, use your mouse and carefully, starting at A1, click down and then drag it across to cell B1. If you didn’t get the sum of 23 and 52, because your mouse was being unreliable, or your cat jumped up onto the keyboard while you were executing this maneuver, don’t worry. Just start again from the beginning – Sheets can be very forgiving!
If you get the sequence of actions right, you’ll see 75 in the cell C3.