- cross-posted to:
- science_memes@mander.xyz
- cross-posted to:
- science_memes@mander.xyz
Explanation (which might be wrong, since I’m writing this after banging my head against a wall. Please do correct me if I’m wrong):
In regular numbering systems (i.e., decimal), we exhaust all 10 digits (0–9) before we reach two-digit numbers. The first number to require 3 digits is 10². The first to use 4 is 10³, and so on.
In music intervals, there is no “0”. The interval c’–c’, for instance, is called a prime (1). This has the funny consequence that moving by a fifth and then by a fourth doesn’t land you on the ninth, but the octave (8). Moving by an octave and then another octave gets you to the 15th, not the 16th.
In Excel, shit hits the fan when you need to convert column names (A, B, C…) to numbers (0, 1, 2…). Since we use 26 characters as our ‘digits’, we’re in the hexavigesimal system. Knowing what I told you in the first paragraph, you’d expect the first double-digit column (AA) to be 26. And you’re right.
However, when do we need 3 digits? Which column is column AAA? A sane person would say it’s 26², so 676. Ha! No. Column number 676 is actually ZA. What gives? Well, we only ditch the zero for single digit numbers. All subsequent columns actually use 27 different characters, the ‘empty character’ being one of them. That’s where we get the ‘single digit’ – there actually is a second digit, only it’s empty.
So the column AAA actually has index 702, or 26×27. Which index does the column AAAA have? 26×27². The system of adding powers of the base works, only we changed bases midway through.
You can see the lopsidedness in the index lookup table (I’m not displaying all characters for brevity). Sane number systems have square tables. Excel’s is 26×27 (shown are 4×5).
1: what the frick are you doing in Excel that needs even 10^2 columns? Rows go up to 2^20 (~10^6), and the thing starts to run like ass way before that.
2: Excel does have a RXCX format, if you really do need to go out hundreds of columns.)
3: feel free to ignore. Bitching about being forced to use the wrong tool is definitely more stress than anyone needs.
Nothing. Here’s this meme’s origin story:
At work we have a tool that imports Excel spreadsheets into user-defined data records. We let the user decide which column goes into which record field.
Today I noticed that when you upload a spreadsheet with more than 26 columns (that is, you enter the double-digit range), the columns aren’t sorted anymore. (When I programmed that, stupid me thought that it was absolutely unreasonable to import 26 columns, given the way the data is processed later.) Instead of A…Z, AA, AB, …, it was A, AA, AB, B, C, ….
So I thought: I should fix that. It’s easy. Just convert the hexavigesimal system to decimal and sort based on that. I even was happy that I could apply some school knowledge for once. (It wasn’t all useless, yay!) Then my math wasn’t mathing. It took me a few minutes to find the system by which Excel columns are numbered. In the end I was annoyed that a task of 5 minutes took… longer… and made this meme.
By the way, to come back to the 10² columns: I’ll take any bet that such a spreadsheet will be shoved into the importer before I retire from my current company.