More stupid Excel tricks: a secret power of IF

The hardest part about working with data, especially in large sets, is the people who input it in the first place. The reason they make it so difficult is because they’re inconsistent, not only in their day-to-day habits, but between one or more different people all entering info into the same database.

When you’re creating something solely for yourself, then by all means be as inconsistent or idiosyncratic as you want. But if it’s a group project creating information that someone like me is going to have to derive useful information from at some point in the future, inconsistency can make my job infinitely more difficult.

This is the reason why things like style guides were created — and they don’t just exist for the written word. Accounting and data management have their own style guides. So does computer programming, although that field has the advantage, because the program itself won’t let you get it wrong. Excel is the same way, although it won’t always tell you how to make it right.

Little things can cause problems and cost a business money. Sally may prefer to spell out words in addresses, like Avenue or Boulevard, while Steve likes to abbreviate with Ave or Blvd. Sam is also big on abbreviations, but always with periods. Seems innocuous, doesn’t it?

It does until the only way to make sure that a massive mailing doesn’t go to the same household at the same address twice is to compare the addresses to each other. That’s because, to a computer, 1234 Main Street, 1234 Main St, and 1234 Main St. are all completely different addresses. There’s no easy way to fix for that because computers don’t have a “kinda sorta look the same” function.

Garbage in, garbage out

It’s also important that a database be designed properly. For example, names should always be entered as separate units — title/prefix, first name, middle name, last name, suffix. They can be combined later when necessary. A lot of good databases do this, but it’s completely worthless if somebody enters the first and middle names in the first name field or adds the suffix to the last name. You may have heard the expression “garbage in, garbage out,” and this is a prime example of that. All of the right fields were there, but if used improperly, it doesn’t matter.

Of course, the proper fields aren’t always included. One example I’ve had to wrestle with recently is a database showing the various insurance policies people have had with the agency. Now, that is useful and necessary information, as well as something that legally needs to be maintained. And it’s all right that a person gets one row of data for each policy that they’ve had. Some people will have one or two rows, others might have a dozen or more.

So what’s the problem? This: There are no data flags to indicate “this is the policy currently in effect.” This is doubly complicated since it’s Medicare related health insurance, so someone can have up to two active policies at a time, one covering prescription medications and the other a Medicare supplement. Or a policy may have expired after they decide to drop an MAPD and go back to “original” Medicare but the only way to know that is to look for an ending or termination date — if it was ever entered.

The secret power of “IF”

This is where one of my “stupid Excel tricks” came into it. You may or may not be familiar with some of the numeric functions dealing with columns or rows of numbers, but they basically operate on a whole range. They include functions like SUM, MAX, MIN, and AVG. The usual usage is to apply them to a defined range or series of cells and they have no operators, so you get things like:

=SUM([Range])
=MAX([Range])
=MIN([Cell1],[Cell2],[Cell3],...[Cellx])

Here’s the fun trick, though. If you add one or more “IF” statements within any of these functions, you can perform the operation on a sub-range of data defined by certain criteria. In the example I’m giving, it would look at all of the insurance effective dates for one person and determine the most recent one, which is usually a good indicator of which policy is in effect.

Generally, each item you’re evaluating is in the form of [DataRange]=[CellValue], or in actual Excel terminology, it might look like “$A$1:$A$470=A12” for the version entered in row 12. After the criteria ranges, you enter the range that you want to perform the operation on, close out the parenthesis, then enter.

So let’s say that we have last name in column B, first name in column D, and the dates we want to look at to find the latest are in column N. Our formula would look like this, assuming that the first row has the field headers and the data starts in row two:

=MAX(IF($B$1:$B$525=B2,IF($D$1:$D:$D$525=D2,$N$1:$N$525))

If you’ve entered it right, the formula should be displaying the right number. In effect, you’ll have created a column down the far right side in which the value opposite any particular person’s name equals the maximum date value, meaning the latest. Then you can do an advanced filter (oh, google it!) to pull out just the unique name data and date, then use that to do an INDEX and MATCH to create a dataset of just the most recent plan and effective date. (I covered those two functions in a previous post.)

Or… the original database administrator could have just put those current plan flags in the data in first place, set them to automatically update whenever a newer plan of the same type was added, and voilà! Every step since I wrote “This is where one of my “stupid Excel tricks came into it” 396 words ago would have been unnecessary. Time and money saved and problem solved because there was never a problem in the first place.

The art of improv in Excel

On the other hand… solving these ridiculous problems of making large but inconsistent datasets consistent with as little need as possible to look at every individual record just lets me show off my ninja skills with Excel.

It’s really no different than improv. Badly entered data keeps throwing surprises at me, and I have to keep coming up with new and improved ways to ferret out and fix that bad data. In improv, this is a good thing, and one of our mottos is, “Get yourself in trouble,” because that creates comedy gold as things in the scene either get irredeemably worse or are suddenly resolved.

In real life, not so much. It’s a pain in the ass to have to fix the curveballs tossed at us by other people’s laziness and lack of diligence — unless we approach it like a game and an interesting challenge. Then, real life becomes improv again in the best sense.

And I’ll find it forever amusing that the same rules can apply to both a spontaneous, unplanned, free-wheeling art form, and an un-wielding, rigid and unforgiving computer program. They both have their rules. Only the latter won’t allow them to be bent. Okay, some improv games have rules that are not supposed to be bent. But half the fun is in bending those rules, intentionally or not.

With Excel and data-bashing, all of the fun is in following Excel’s rules, but getting them to do things they were never intended to.

Image source: Author, sample output from a completely randomized database generator in Excel used to create completely artificial test data for practicing functions and formulae without compromising anyone’s privacy. Maybe I’ll write about this one some day, if there’s interest.

Look, up in the sky!

Throughout history, humans have been fascinated with the sky, and a lot of our myths were attempts to explain what goes on up there. In many cultures, the five planets visible to the naked eye (Mercury, Venus, Mars, Jupiter, and Saturn) were named after deities or attributes of the planets with surprising consistency.

Mercury was often named for its swiftness in orbiting the Sun; Venus was always associated with beauty because of its brightness; Mars’s red color led to it being named either for a violent deity or that color; Jupiter was always associated with the chief deity even though nobody in those times had any idea it was the largest planet; and Saturn, at least in the west, was named after Jupiter’s father.

This led to Uranus, which wasn’t discovered until the 18th century, being named after Saturn’s father, i.e. Jupiter’s grandfather. Neptune, discovered in the 19th century, and Pluto, discovered in the 20th century before being rightfully demoted from planetary status, were only named for Jupiter’s less cool brothers.

Since the planets were given attributes associated with deities, their relationship to each other must have meant something, and so the bogus art of astrology was invented, although it was obviously not complete prior to Uranus, Neptune, and Pluto being added, but then was clearly incorrect during the entire period of time that Pluto was a planet. (Hint: That was a joke. It was incorrect the entire time.)

Since humans are also hard-wired to see patterns, the stars above led to the definition of constellations, the night-time version of the “What is that cloud shaped like?” game.

It wasn’t really until the renaissance and the rise of science, including things like optics (one of Newton’s discoveries), which gave us telescopes, that we really started to take a look at the skies study them. But it is still astounding how so many laypeople know so little about what’s up there that we have had completely natural phenomena freaking us out since forever. Here are five examples of things in the sky that made people lose their stuff.

1. Total eclipse of the heart… er… Sun

Until science openly explained them, eclipses of any kind were scary. For one thing, nobody knew when they were coming until Royal Astronomer became a thing, but only the elite were privy to the information, so the Sun would go out or the Moon would turn blood red, or either one of them would appear to lose a piece at random and without warning. Generally, the belief was that the Moon or Sun (particularly the latter) was being consumed by some malevolent yet invisible beast that needed to be scared away.

But long after modern science explained that an eclipse was nothing more than the Moon passing in front of the Sun or the Earth passing in front of the Moon, shit went down in 1878, at least in low-information areas.

The thing about this eclipse was that it had been predicted close to a century before, had been well-publicized, and was going to put the path of totality across the entire U.S. for the first time since its founding. There’s even a book about it, American Eclipse. But there’s also a tragic part of the story. While the news had spread across most of the growing nation, it didn’t make it to Texas, and farm workers there, confronted with the sudden loss of the Sun, took it to mean all kinds of things. A lot of them thought that it was a portent of the return of Jesus, and in at least one case, a father killed his children and then himself in order to avoid the apocalypse.

2. Captain Comet!

Ah, comets. They are an incredibly rare sight in the sky and well worth traveling to see if that’s what you need to do. I remember a long trek into the darkness when I was pretty young to go see Comet Hyakutake, and yes it was worth it. It was a glorious blue-green fuzzball planted in space with a huge tail. Of course, I knew what it was. In the past, not so much.

In the ancient world, yet again, they were seen as bad omens because something in the heavens had gone wrong. The heavens, you see, were supposed to be perfect, but there was suddenly this weird… blot on them. Was it a star that grew fuzzy? Was it coming to eat the Earth? What could be done?

That may all sound silly, but as recently as 1910, people still flipped their shit over the return of one of the more predictable and periodic of “fuzzy stars.” That would be Comet Halley. And, by the way, it’s not pronounced “Hay-lee.” It’s “Hall-lee.”

And why did it happen? Simple. A French astronomer who should have known better, wrote that the tail of the comet was full of gases, including hydrogen and cyanide, and if the Earth passed through the tail, we would either be gassed to death or blown up. Unfortunately, another French astronomer at the time actually played “Got your back” with him, and that was all it took.

It was pseudoscience bullshit at its finest, propagated by the unquestioning and uninformed (when it comes to science) media, and it created a panic even though it was completely wrong.

The worst part about Halley’s 1910 appearance? It bore out Mark Twain’s statement, paraphrased probably: “I came into the world with it, I will go out with it.” And he did. Goddamit.

3. Meteoric rise is an oxymoron

And it definitely is, because a meteor only becomes one because it’s falling. And while we’re here, let’s look at three often confused words: Meteor, meteoroid, and meteorite.

The order is this: Before it gets here and is still out in space, it’s a meteoroid. Once it hits our atmosphere and starts to glow and burn up, it has become a meteor. Only the bits that actually survive to slam into the planet get to be called meteorites. Oid, or, ite. I suppose you could think of it as being in the vOID, coming fOR you, and then crash, goodnITE.

So the things that mostly cause panic are meteors, and quite recently, a meteor blowing up over Russia convinced people that they were under attack. It was a fireball that crashed into the atmosphere on February 15, 2013, and it actually did cause damage and injuries on the ground.

The numbers on the Chelyabinsk meteor are truly staggering, especially to think that they involved no high explosives, just friction and pure physics (Hello again, Sir Isaac!) The thing was about 66 feet in diameter, which is the length of a cricket pitch, or about four feet longer than a bowling lane. It compares to a lot of things, and you can find some fun examples here.

But there was nothing fun about this asteroid. It came screaming through our atmosphere at about 41,000 miles an hour at a steep angle. The heat from the friction of our atmosphere quickly turned it into a fireball of the superbolide variety, which is one that is brighter than the sun. It exploded about 18 miles up. That explosion created a fireball of hot gas and dust a little over four miles in diameter. The kinetic energy of the event was about 30 times the force of the atom bomb dropped on Hiroshima.

Over 7,200 buildings were damaged and 1,500 people were injured enough to need medical attention, mostly due to flying glass and other effects of the shockwave. Unlike other items on this list, these events actually can be dangerous, although this was the first time in recorded history that people were known to have been injured by a meteor. The Tunguska event, in 1908, was a little bit bigger and also in Russia, but happened in a remote and sparsely populated area, with no reported human injuries. Local reindeer were not so lucky.

4. Conjunction junction, what’s your function?

A conjunction is defined as any two or more objects in space which appear to be close together or overlapping when viewed from the Earth. Every solar eclipse is a conjunction of the Sun and Moon as seen from the Earth. Oddly enough, a lunar eclipse is not a conjunction from our point of view, because it’s our planet that’s casting the shadow on the Moon.

Conjunctions shouldn’t be all that surprising for a few reasons.

First is that most of the planets pretty much orbit in the same plane, defined by the plane in which the Earth orbits because that makes the most sense from an observational standpoint.

The inclination of Earth’s orbit is zero degrees by definition and the plane we orbit in is called the ecliptic. You can probably figure out where that name came from. Out of the planets, the one with the greatest inclination is Mercury, at 7º. Counting objects in the solar system in general, the dwarf planet Pluto has an inclination of 17.2º — which is just another argument against it being a true planet. None of the planets not yet mentioned have an inclination of more than 4º, which really isn’t a whole lot.

The second reason conjunctions should not be all that surprising is because each planet has to move at a particular velocity relative to its distance from the Sun to maintain its orbit. The farther out you are, the faster you have to go. Although this is a function of gravity, the airplane analogy will show you why this makes sense.

As an airplane gains speed, the velocity of air over the wings increases, generating more lift, bringing the airplane higher. In space, there’s no air to deal with, but remember that any object in orbit is essentially falling around the body it orbits, but doing it fast enough to keep missing.

If it slows down too much, it will start to fall, but if it speeds up its orbit will get bigger. This is directly analogous to ballistics, which describes the arc of a flying projectile. The faster it launches the farther it goes and the bigger the arc it makes. An arc in orbit becomes an ellipse.

Since every planet is moving at the speed required to keep it at the distance it is, things are likely to sync up occasionally. Sometimes, it will only be one or two planets, but on certain instances, it will be most or all of them. This video is a perfect example. Each one of the balls is on a string of a different length, so its natural period is different. Sometimes, the pattern becomes quite chaotic, but every so often it syncs up perfectly. Note that all of them did start in sync, so it is mathematically inevitable that they will sync up again at the point that all of the different period multiply to the same number. Our solar system is no different since the planets all started as rings of gas and dust swirling around the Sun. There was a sync point somewhen.

So conjunctions are a completely normal phenomenon, but that doesn’t mean that people haven’t gone completely stupid with them. The first way is via astrology, which isn’t even worth debunking because it’s such a load. The Sun is 99.8% of the mass of the solar system, so it constantly has more influence in every possible way over everything else hands down. What influence did the planets have upon your personality at birth? Less than zero. The only relevant factor, really, is that people’s personalities are formed by their relative age when they started school, so that is influenced by the season they were born in, but that’s about it.

As for the modern version of people going completely stupid over conjunctions, it happened in the early 1980s, after the 1974 publication of the book The Jupiter Effect by John Gribbin and Stephen Plagemann. In short, they predicted that a conjunction of the planets on March 10, 1982 would cause a series of earthquakes that would wipe out Los Angeles.

Since you’re reading this in at least the year 2020 and I’m quite safely in Los Angeles, you know how their prediction turned out. This didn’t stop them from backtracking a month later and releasing a follow-up book called The Jupiter Effect Reconsidered (aka We Want More Money from the Gullible) in which they claimed, “Oh… we miscalculated. The date was actually in 1980, and the conjunction (that hadn’t happened yet) caused Mount St. Helens to erupt.”

Still, just like with the whole end of the world 2012 predictions, at least some people bought into it.

5. The original star wars

The last item on our list is possibly a one-off, occurring on April 14, 1561 in Nuremberg, Germany. Whether it actually even happened is debatable since only a single account of it survives in the form of a broadsheet — basically the blog post of its day. If it had been as widespread as the story makes it seem, after all, there should have been reports from all across Europe unless, of course, the point of view from Nuremberg created the exceptional event in the first place.

It was described as an aerial battle that began between 4 and 5 a.m. when “a dreadful apparition occurred on the sun.” I’ll quote the rest of the paragraph in translation in full from the article linked above: “At first there appeared in the middle of the sun two blood-red semicircular arcs, just like the moon in its last quarter. And in the sun, above and below and on both sides, the color was blood, there stood a round ball of partly dull, partly black ferrous color. Likewise there stood on both sides and as a torus about the sun such blood-red ones and other balls in large numbers, about three in a line and four in a square, also some alone.”

The unknown author goes on to describe the objects — spheres, rods, and crosses — as battling with each other for about an hour, swirling back and forth. Eventually, the objects seemed to become fatigued and fell to the Earth, where they “wasted away… with immense smoke.

Now, what could have caused this phenomenon? The obvious answers are that it was a slow news day or that it was religious propaganda or some other wind-up. But if it were an actual phenomenon and really only remarked on in one village, then it’s quite possible that it was a meteor shower with an apparent radiant, or source, that happened to line up with the Sun.

It was a Monday, with a new Moon. The Sun rose in the east at 5:05 a.m., so the invisible Moon was somewhere around that part of the sky, too. But this also immediately calls the story into question, since the phenomenon seen coming from the Sun happened before sunrise according to the account. But if we consider that to just be human error, what we have is the Pearl Harbor effect. The attackers come in with the rising Sun behind them, making them hard to see or understand.

On top of that, if they’re coming in from that direction, they’re coming in at a very shallow angle. See the notes on the Russian meteor above. This can lead to some super-heated objects, which would glow red as reported, and anything not red hot against the Sun would appear black. If it happened to be a swarm of objects, like a bunch of small rocks and dust or a bigger piece that broke up, all flying in at once, the chaotic motion could certainly make it seem like a battle.

There is a meteor shower that happens around that time of year called the Lyrids, which is very short-lived, although I haven’t yet been able to find out whether its radiant was near the Sun in 1561. But a particularly heavy shower coming in at just the right angle could have an unusual effect in a limited area.

Or… the author just pulled it out of his ass for his own reasons. We can never know.


Photo credit: Staff Sgt. Christopher Ruano, F.E. Warren Air Force Base.

Betelgeuse, Betelgeuse, Betelgeuse

There’s been a lot of talk in the news lately about the star Betelgeuse, and whether it’s about to explode and go nova. The main reason this discussion is happening is because the star suddenly got very dim very quickly, and dimmer than we have ever observed it to be. The dimming itself isn’t unusual because Betelgeuse is a variable star, meaning that its apparent brightness changes. What’s unusual now is the magnitude of that change. In only two months, Betelgeuse dropped from 10th brightest star in the northern night sky to 21st.

Stars and the physics in them have always fascinated me because they are a perfect example of macro and micro coming together — the very large displaying the power of the very tiny at work.

Fusion without confusion

What is a star? Simply put, it’s a big ball of gas that is so massive that its own gravity makes it ignite in nuclear fusion, creating heat and light. As far as we know, the very first stars started out as cloud of the lightest, simplest element, hydrogen, which in its basic form is one proton with one electron bound to it. I say “bound to” rather than “orbiting” because that old model of discrete little electrons circling the nucleus like planets orbit the Sun is just wrong. It’s better to think of the electron or electrons as existing as a potential force spread out over a certain area statistically, with the shapes and volumes of those areas varying with the energy of the electron. It’s not in one place at any given time, but it’s likely to be in certain places and not in others, and this goes for every electron in the atom.

Yes, welcome to the weirdness of quantum physics. The layman’s takeaway here is that the electrons create what you can think of as a force field far “above” the nucleus that keeps other nuclei from getting too close. They’re like the walls of houses that keep the nosy neighbors from wandering in.

And that works just fine on most scales. The electrons are doing all of the work so that the atoms in your cells don’t fuse together and it even works right up to the level you can perceive. When you touch a table, for example, you aren’t really touching it. Rather, the electrons in your finger are bumping against the electrons in the table and are acting as mutual bouncers keeping each other out so that your hand and the table don’t merge.

Oh, sure, you will exchange some electrons with whatever you touch because they can just be finicky like that. But, for the most part, this is an impenetrable barrier that keeps things well-defined.

It doesn’t break down until enormous forces come into play. In the case of stars, that force is called gravity, and it’s not until that ball of hydrogen reaches a certain density that things begin to happen. Mainly, the force of gravity working on it becomes enough to overcome the force of the electrons maintaining boundaries. All of a sudden, those neat electron orbital shells go wonky, and the protons start to get to know each other. Now, normally, they would repel because they have the same charge, but their charges are so much weaker that by this point it doesn’t matter. Protons start to get forced together, and then the magic happens.

It’s elementary

I won’t get too heavy into the physics here — you can learn more if you’d like — but the key point is that this gravitational mushing turns hydrogen into helium, the next heaviest element, which has two protons, two neutrons, and two electrons, and in the process a lot of energy (relatively speaking) gets released.

This continues on for a long time until the hydrogen has almost but not quite run out, at which point the star starts to smoosh all of that helium into carbon, and the process cascades from there. Combining each new element with more helium runs down the chain to create oxygen, neon, magnesium, silicon, sulfur, argon, calcium, titanium, chromium, and then iron.

A star is basically a forge that creates the heavier elements that become the building blocks of planets, all subsequent new stars (which don’t start as pure hydrogen), and, eventually, life.

There’s one critical element to mention, though: while the force of gravity has been enough to make the fusion happen, at the same time the opposing force of the energy released by that fusion has been enough to push back and create a sort of equilibrium so that the star doesn’t collapse or expand. It pretty much maintains its size.

And then iron synthesis comes along, and it’s a game changer. Why? Because, unlike those other fusion reactions, this one doesn’t produce sufficient energy to fight gravity any longer. Boom, it’s like a light switch is turned off. All of a sudden, the floorboards give out, and all of that mass up above the ceiling is free to come crashing down into the basement, and that doesn’t go well when it hits bottom. Above a certain original mass, you get a black hole. Below it, you get an enormous explosion which scatters all of those elements outward and releases an incredible amount of energy.

It would be a super nova

If that happened to Betelgeuse during 14th or 15th centuries, we’d see it here soon, since the star is only about six hundred light years away. For a while, it would be brighter than the full Moon at night, and visible during the day. And it couldn’t happen to a nicer star. It’s one that you’ve probably seen since its constellation is so memorable.

Betelgeuse is the right shoulder of Orion, assuming that he’s facing us, and is visibly red from down here. In official terms, the star is known as Alpha Orionis, meaning the first, or brightest, star in the constellation Orion. The interesting part about this designation is that it’s only sometimes the brightest, again because of the variable thing. Rigel is often brighter, but when Sir John Herschel made his observations and his catalog, Betelgeuse was brighter, so it got the A rating.

If you’re wondering about the name of the star, it’s got nothing to do with the Tim Burton film. Rather, it comes from the Arabic name for it, إبط الجوزاء (‘iibt aljawaza’). If you pronounce it fast enough a few times, it kind of starts to sound like “Betelgeuse.”

Just don’t say it three times. Or, maybe, do — because seeing a supernova of this magnitude at this point in our history wouldn’t only be great for humanity in general, it would be a boon to many different sciences. The last visible supernova happened in 1987, but it was only visible from the Southern Hemisphere, and it was about 160,000 light years away, or just over 49,000 parsecs.

This one would be visible by everyone in the Northern Hemisphere, day and night, for a good period of time, and it would serve to make people aware of the universe out there, and maybe even ask questions and listen to scientists. It might even get them to realize that the ultimate survival route for the entire human race — and a lot of other species on this planet — is to get off of this planet and start colonizing, except to do it in a low-impact and benevolent way, rather than the slash-and-burn methods used by our ancestors who raped and pillaged their way out of Europe and into the “new” world. (Funny how none of it was new to the people who had been living there already.)

Anyway… here’s to hoping that one of the most violent events in the universe can grace our night and day skies soon, and pull us out of ourselves. Maybe we do need a cataclysmic event to unite the planet — but that doesn’t mean that the cataclysm needs to be anywhere near us. Just that we need to be aware of it.

What better screen than the sky above?

If you say the name three times, it appears. Betelgeuse.

Betelgeuse.

Betelgeuse!

Contrarians

There is an interesting class of words in English called contronyms. They are defined as words that have two contradictory definitions. You might wonder how this happens. There seem to be three different reasons.

The first is that the words are homographs. If you remember your Latin, this comes from the words “homo” for same, and “graph,” which refers to writing, so homographs are words that are written the same, but that’s the only thing they have in common. Contrast this to homophones, meaning same sound but with different meanings. Additionally, the words should have different etymologies. That is, they did not come from the same source words.

A good homographic example of this is the word “cleave,” which can either mean to join together or to split apart. “The bride and groom cleaved onto each other until hard times cleaved them apart.” The former sense comes from the Old English word cleofian, with the same meaning. The latter comes from Old English clēofan, to separate, which actually is a different word despite looking so similar.

The second way contronyms happen is through a form of polysemy, which comes from the Greek for many (poly) signs (semy, the root of semiotics.) [That link is provided for the sake of showing sources, but unless you’re a linguist it will make your head explode trying to read it. —Ed.] The main point to remember is that contronyms can happen as language evolves and a word begins to be used in a different sense by different groups.

Frequently, this refers to technical jargon, although it doesn’t always create contronyms. A good example is the word “insult.” In the medical field, it refers to a physical injury and not nasty words Medically speaking, adding insult to injury would be completely redundant.

A modern example of a contronym created this way is the word “sick” — in one sense, it refers to something that’s not well off: “Javi is feeling very sick today.” In another sense, it means something that’s really excellent: “Javi busted out some sick rhymes to win that rap battle.”

Finally, contronyms can happen when two different versions of the language use words in a different sense. The classic example of this is the word “table” as used in meetings. In American English, when a bill is tabled, that means that it’s removed from discussion and either dropped or put on hold. In British English, when a bill is tabled, that means it’s brought up for debate.

A few fun examples

There are a lot of contronyms, not just in English, but in other languages. Spanish has its own autoantónimos, and some of them even match their English counterparts. For example, rent/alquilar refers to the act of either renting from someone or renting to someone; sanction/sancionar refers to imposing a penalty or officially allowing something.

They can be a lot of fun, so let’s look at a few from a very long list, used together in their opposite meanings, along with some alternate meanings the word might also have.

Bill: When it’s not on a duck, you can pay a bill with a twenty-dollar bill, so this word has your money covered coming and going.

Bolt: When a lightning bolt strikes nearby, you might be inclined to bolt the door fast and stay inside, or you may bolt in fear and run away.

Custom: Everybody had followed exactly the same custom for years: to custom order for the New Year so that everyone’s shoes were completely different.

Dust: After the detectives dusted for prints, I had to dust the furniture to get it all off.

Fast: After a brief fast, I wanted to run away fast, but alas I was held fast because my belt got stuck to the chair.

Garnish: He was a chef who loved to garnish the entrees with parsley and cherry tomatoes, but was very sad after his divorce when his ex got a judge to garnish his wages.

Give out: (a rare two-word contronym!) He gave out his business cards tirelessly until his energy gave out completely.

Left: By the time there was only one bottle of wine left, all of the guests left and walked to the left, disappointed.

Off: Bob the Burglar thought that the alarm was off until he broke inside and set it off.

Out: It wasn’t until all of the lights went out that they could see how many stars were out at night.

Oversight: The oversight committee thought that they had monitored everything, but they realized their big oversight too late to fix it.

Refrain: “I wish you would refrain from singing that,” the teacher demanded, but the students went on and sang the same refrain again and again.

Rock: Joe was always solid and immobile as a rock until someone started to play rock music, at which point he would rock back and forth uncontrollably.

Strike: During the general sports strike, the replacement archers managed to strike the targets every time. Meanwhile, the baseball batters weren’t so lucky, getting strike after strike.

Throw out: (another two-worder!) I’m just going to throw out this idea for everyone to consider, but we really need to throw out the trash.

Trim: Before we can trim the Christmas tree, we really need to trim some of these branches.

Weather: The house had weathered many a winter season until its walls became too weathered to stand any longer.

Wind up: (two-worder number three!) I don’t mean to wind you up, but after you wind up this jack-in-the-box, we really need to wind up the evening and go home.

Why?

Some of the most interesting and fun contronyms lend themselves to neat wordplay, some of which I indulged in above. Since one of the hallmarks of humor is the unexpected, throwing a pair of contronyms into a sentence can be a great tool for spicing up your writing. I would offer an apology for my puns but I think I can write a pretty good apology in support of the concept. And there’s another word with great Greek roots: Apo-, a prefix meaning, among other things, a response or defense; logo, which means word; and –ia, a suffix in Greek indicating either a female singular or neuter plural noun or adjective.

So… words in response to or defense of something. This may sound like a subtle difference, but it’s not. If I offer an apology for my puns, then I’d say something like, “I am really sorry that I’ve made those puns.” If I write an apology for puns, then it would be a long piece tracing their history, showing examples, and describing why they are a valid form of humor — the exact opposite of apologizing for them.

But I won’t apologize for puns. Especially not when a contronym also has other meanings, because that’s where we can get into triple word score on a single sentence.

I mean, I’m not trying to be mean, but I think that puns are a wicked mean form of humor, you know what I mean.

Photo: “Black Sheep Meets White Sheep” (cc) 2011 by Leon Riskin, used unchanged under Creative Commons license 2.0.

Stupid Excel tricks #1: INDEX and MATCH

Enter the matrix… math

There is an entire class of functions in Excel that take things to a whole new level, and they are called matrices. Maybe you ran across this in math in school and have forgotten, maybe not, but the idea with a matrix is that it takes one grid of numbers of X x Y dimensions and uses operators to manipulate it using another grid of numbers that may or may not have the same dimensions.

The great part is that to use these functions in Excel, you don’t need to know any of that. Like I’ve mentioned before, it’s exactly like using a cookbook. Plug in the ingredients as specified, voila, the dish pops out the other end.

Maybe you’ve used the functions VLOOKUP and HLOOKUP, or maybe not, but they can be useful if you want to match exactly one criteria in a table and if the data you’re looking up is somewhere to the right of that criteria. So it’s perfect if you have something like a unique account number on the far left and want to use that to look up a name or phone number to the right of it:

=VLOOKUP(M2,$A1:$L556,6,FALSE)

This tells Excel to take the value in cell M2, compare it to all of the values in column A of the named range, then look up the value in the sixth column counting from the column defined in the second variable (in this case, F) where the first column is equal to M2. “FALSE” just means to use an exact match, whereas “TRUE” would mean to use an approximate match.

Again, this is great if you’re searching something with unique values in both places — there is only one account number, and only one data point associated with it.

Now what if you have multiple entries for the same person with different account numbers, or multiple sizes and colors of a product with differing prices, or you need to search on more than one data point in different columns, or your table was set up with the criteria you want to use somewhere to the right of the data points you’re searching?

Welcome, matrix functions! These are two nested commands that work miracles together. The first is INDEX, and what it basically does is point to a column with data that you’re going to pull stuff from, then follow that up with the criteria you’re going to use to do that. You can see the difference from the LOOKUP functions right off the bat, because those start with the single data point you’re going to use to search the data. The INDEX function starts with the place you’re going to get the answer from.

The MATCH function is the matrix math, and it allows you to specify multiple criteria matched to different columns in the source data. The nice part about it is that you can have as many different criteria as you need — first name, last name, account number; size, gender, color, style; title, author, binding, edition; and so on. And each of these can point to any particular bit of data you need — monthly cost, price, location, phone number, address, and so on. Any bit of data in the table can be found this way.

If you want to put a physical analogy on it, it’s this. LOOKUP functions are a librarian with a sliding ladder that moves horizontally or can be climbed vertically. But the way it works is that they first move it or climb it in the direction you specify until it hits the target word. Then, it slides or climbs the other direction however many rows or columns you specified, and has now targeted exactly one cell with the answer. Oh — and it can only move to the right or down from that initial search cell.

On the other hand, think of INDEX and MATCH as a whole bunch of librarians who have set out all over the same bookcases, but are simultaneously searching the rows and columns, and calling back and forth to each other to indicate what bits they’ve found that match.

If you work with any kind of inventory or any data sets where people’s info is broken down (as it should be) into separate first and last names and account identifiers, then you need to know these functions, because they will save you a ton of time. And the basic way they work is like this:

INDEX($E1:$E1405,MATCH(1,(W2=$C$1:$C$1405)*(X2=$D$1:$D$1405)*(AA2=$J1:$J1405),0))

(Note: All column and row designations here are arbitrary and made up, so they don’t matter.)

That might look complicated, but it’s not. Let’s break it down. The first part, referring to the E column is the “Where” of the formula. That is, this is the column you’re pulling your data from. For example, if you want to use size, color, and style to find price, then this would be whatever column has the price data in it.

Next, we nest the MATCH function, and this lets INDEX know that what comes next will be the instructions it needs. The “1,” inside the parenthesis is a flag for MATCH, telling it to return one value. After that, each nested thing — and you can have as many as you need — follows the form “Single cell to look at equals column to search.” So, as seen here, for example, in the search data, column W might be the first name, and cell W2 is the cell corresponding what we’re looking at. Meanwhile, column C in the target data might also include first names, so what we’re saying is “Look for the single value of W2 down the entire column of C1 to C1405. The dollar signs are there to lock it as a fixed range.

All of the other parentheticals here follow the same pattern. Maybe X is the column for last name in the source and D is where the last names are in the target; and AA is account number, as is J.

The two other interesting things to note in building matrix equations: The single cell and the column are joined by an equals sign, not a comma, and this is important because, without it, your formula will break. What this tells Excel is that whatever the matrix pulls out of single cell must equal what’s in the column at that point.

The other thing to notice is that between the searches within parentheses, there aren’t commas, but rather asterisks, *, which indicate multiplication, and this is the heart of Matrix math.

What this tells the formula is to take the results of the first thingie, apply those criteria and pass it along to the second. In other words, if the first evaluation turned up nothing, that is mathematically a zero, and so it would quash anything coming from the second and third functions. On the other hand, if it comes up as a one, then whatever the second formula turns up will stay if there’s a one, dump if not, and then pass on to the third, fourth, etc..

Lather, rinse, repeat, for as many steps down the process you’ve created. A false at any point in the matrix math will kill it and result in nil. Meanwhile, as long as the tests keep turning up positives, what will fall out of the ass end of it is the honest legit “This data is the true data.”

Funny how that works, isn’t it? The only other trick you need to remember is that after you’ve entered this formula, you need to close it out by hitting Ctrl-Shift-Enter to let Excel know it’s a matrix formula. Then, if you want to copy it, you can’t use the usual Ctrl-C, Ctrl-V. Instead, you have to highlight the column with the formula at the top, then hit Ctrl-D. Voila… the whole thing repeats down the column.

And there you have it — a way to search multiple criteria in a row in order to find a specific data point in a table. You’re welcome.

Being a basic bit

Zeroes and Ones are the building blocks of what’s known as binary, and the juice that our digital world runs on. Another way to think of it is this. In our so-called Base 10 world, we deal with ten digits, and depending upon what you’re counting, you can either go from 0 to 9 (things) or 1 to (1)0 (dates, place order). Since 9 is the highest digit, when any column hits it, the 9 next rolls back to 0 and the digit to its left increments up, initially from 1.

So after the number 9, we get 10. After 19, we get 20, after 99, it’s 100, and so on. Also note that 100 happens to be 10 x 10, 1,000 is 10 x 100, 10,000 is 100 x 100, etc. This will be important in a moment.

In the binary world, things roll over faster. In fact, the only digits you have are 0 and 1, so counting works like this: start with 0, then 1. But 1 is as high as we can go, so after 1 comes 10, which, in binary, represents 2.

That might seem strange, but here’s the logic behind it, going back to 10. What is 10, anyway? Well, it’s the number that comes after we’ve run out of digits. Since we’re used to base 10, it doesn’t require any explanation to see that 10 always comes after 9. At least in base 10. I’ll get to that in a moment, but first there’s a very important concept to introduce, and that’s called “powers.”

The powers that be

No, I’m not talking Austin Powers. Rather, raising a number to a power just means multiplying the number by itself that many times. In its basic form, you’ll often see Xn. That’s what this means. It’s just a more efficient way of writing things out:

            2 x 2 = 22 = 4

            3 x 3 x 3 = 33 = 3 x 9 = 27

            10 x 10 x 10 x 10 x 10 = 105 = 100 x 100 x 10 = 10,000 x 10 = 100,000

Here’s an interesting thing about powers of 10, though. The end result will always have exactly as many zeros as the exponent, or power that you raised 10 to. 109. Simple: 1,000,000,000. If it’s 102, 100, and so on.

And the two fun sort of exceptions that aren’t exceptions to keep in mind:

            X x 0 x N = N, aka X0 = 1

            X x 1 = X1 = X.

101 is 10 with 1 zero, or 10; 100 is 10 with no zeroes, or 1.

In other words, any number to the power of zero equals 1, and any number to the power of 1 equals itself. And there you go, that’s all you need except for this: When it comes to determining what the power is, we count “backwards” from right to left. The last digit before the decimal takes the 0 power, next to the left is 1, next over from that is 2, and so on.

Everything in its place

Since places correspond to powers, in Base 10 we would call the digits, right to left, the ones, tens, hundreds, thousands, ten-thousands, hundred-thousands, and so on places. In binary, you’d have the ones, twos, fours, eights, sixteens, thirty-twos, etc.

Makes sense? Then let’s look at a four-digit number in binary: 1776.

But here’s an interesting trick: in computer logic, it often becomes much easier for the circuits to literally read in the digits backwards in order to do these steps upwards in the proper order. This saves the step of having to figure out how long a string is before assigning the proper power to the most significant digit, which is the last one on the left.

So, to calculate, we’ll count it from right to left, which will make it easier to follow what’s happening. Let’s go with 6771 for ease of use. The 6 is in the zero position, so it represents 6 x 100, in which case this is 6 x 1, meaning just plain old 6.

Next, a 7 times 101, which is just 10, so this spot is worth 70 and we’re up to 76.

Next, 7 times 102, which is 100 times 7. Add that to the rest, it’s now 776.

Finally, a 1 in the spot multiplied by 103, which is 10 x 10 x 10, which is 10 x 100, so… 1,000. Slap that on the rest, and there you go: 1776.

This works exactly the same way in any other base. So let’s look at a typical binary number: 1011 1110. As humans, we could deal with doing the whole thing backwards, but again, let’s make it easy for the machine, feed it in right to left, and watch the sequence in action:

Digit (D) 0    1    1    1    1    1    0    1
Power (p) 0    1    2    3    4    5    6    7
2^p       1    2    4    8    16   32   64   128
2^p x D   0    2    4    8    16   32   0    128
SUM       0    2    6    14   30   62   62   190

Or in base three or trinary, let’s look at 21221121, entered again in reverse:

Digit (D) 1    2    1    1    2    2    1    2
Power (p) 0    1    2    3    4    5    6    7
3^p       1    3    9    27   81   243  729  2187
3^p x D   1    6    9    27   162  486  729  4374
SUM       1    7    16   43   205  691  1420 5794

Now, let’s take a look at an interesting property in Base 10 and see if it translates over.

Dressed to the nines

In Base 10, any number divisible by nine also has all of its digits add up to nine. You can easily see this with the first few pairs of two-digit multiples of nine: 18, 27, 36, 45, 54, and so on. The tens digit goes up by one while the ones digit goes down by one, and that makes perfect sense. Why? Because when you add nine, what you’re really doing is the same as adding 10 and then taking away one.

It doesn’t matter how big the number is. If you can add the digits up to nine, then you can say it’s divisible by nine. To just pull a number out of thin air, I guarantee that 83,764,251 is evenly divisible by nine. I could also put any number of nines anywhere in that number and it would still be divisible, or put the digits in any order. And if you have a number that has all of the digits from 0 to 9 in any order, then it’s divisible by 9.

So does this property hold for other bases? What about Base 8? In that case, we should expect seven to be the magic number. I’ll spare you the torturing of Excel I did to run a  test, but the answer is: Yes. If a number is divisible by seven in Base 8, then its digits add up to seven. Here’s the list from the Base 8 equivalent of 1 to 99 (which is 1 to 77): 7, 16, 25, 34, 43, 52, 61, 70. Now none of those numbers in Base 10 is divisible by seven, but in Base 8 they are. Here’s how and why it works.

When you divide a number in Base 10 by 9, you start on the left, figure out how many times 9 goes into that whole number, carry the remainder to the next digit, and repeat the process. So to divide 27 by 9, you start by dividing 20 by 9. This gives you 2 times 9 = 18. Subtract 18 from 20, you get 2. Carry that over to the next place, which is 7, add 2 and 7, you get 9, which is divisible by 9. Add the 2 from the first result to 1, and your answer is 3.

Did you notice anything interesting there? It’s that you happened to wind up with the number in the Base digit twice. Two times 9, with the remainder of 2 adding to the other digit, and what was the other thing we noticed? That’s right. The sum of the digits is 9, so what’s left when you divide the ten’s digit by 9 has to add to the one’s digit to total 9.

This is true in any other base. Let’s look at our Base 8 example of 34. We can’t cheat by converting to Base 10, so the 3 tells us that 7 goes into the number three times. But since 3 times 7 is 3 less than 3 times 8, that’s our remainder. Add that to the 4 to get 7, and boom, done. In Base 8 34/7 = 3+1 = 4. Convert the Base 8 to Base 10 to get 28, and voila… 4 times 7 is 28. The answer is the same either way when you reduce it to a single digit.

A spot check bears this out with other bases, so it would seem to be a rule (though I’m not sure how to write the formula) that for any Base, B, and any number evenly divisible by B-1, the digits of that number will add up to B-1.

That’s the funny thing about whole numbers and integers. They have periodicity. What they do is predictable. Multiples of any integer will appear at regular intervals without jumping around no matter how far towards any particular ∞ you go. Irrational numbers and primes, not so much. But it’s good to know that the basis of digital computing is so reliable and regular. In fact, here’s a funny thing about binary: Every single number in binary is evenly divisible by 1 because all of the digits of every single number in it adds up to a number divisible by… 1. And a Base 1 numbering system is impossible, because the largest possible number in it is 0. It also breaks the whole Base rule above, because nothing can be divided by 0. Base 1 is the Black Hole of the numbering system. The rest should be pretty transparent.

Don’t make it rocket science when it’s not

So many tools

It never ceases to boggle my mind when people don’t jump on the chance to learn and fully take advantage of the amazing modern tools we’ve been handed and which are ubiquitous. If you work in any kind of office environment at all, whether it’s some stodgy traditional business or a bleeding-edge industry like tech or gaming, at the very least you’re dealing with either Microsoft’s Word, Excel, Outlook, etc., or the Apple equivalents.

If you’re using the Open Office or Chrome/Cloud versions, then this piece probably isn’t directed at you because you definitely get it. But, otherwise… really, people? These are literally the things that you use every day, and yet I constantly see very few people ever progressing beyond the merest basic ability to use any of the programs.

That is: Open document, type shit with defaults, save or send as-is.

If I open a spreadsheet you’ve worked on in an older version of Excel and see three tabs at the bottom named Sheets 1, 2, and 3, I will know that you’re an amateur. Likewise if the font is set to that hideous Calibri. Same thing in Word minus the tabs, but same crappy font, ragged aligned left, with auto-spacing before paragraphs or lines.

Word to the wise, people. The first thing you should do in Word is go in and set your default formatting so that the autospace before lines or paragraphs is 0, and line spacing is single.

Why is paper still a thing?

But this is just an intro to some recent heinous, and it’s this. I’ve managed to stumble into a situation where a lot of coworkers prefer to do things on paper, and it makes me nuts. Simple question: Why? Physical files can only be in one place, usually aren’t in the place where they’re supposed to be, and there isn’t a magic search function that can find them other than somebody maybe remembering that they worked on it recently, and where they put it. There’s also no standardization of fonts, so if someone scribbles a note in that file, there’s no guarantee that someone else will be able to read it six months later.

Not to mention that it’s just wasteful. Especially wasteful when there are so many ways to avoid it and so many resources to make that easier.

Case in point: One of the things I do regularly is enter and reconcile commission statements from various vendors, but I’ve had to do it by printing the things, manually entering the data into a spreadsheet, and then doing a careful audit to fix the inevitable errors, since some of these run to hundreds of entries.

But then I figured out how to pull the data directly from the statement, slap it into Excel, format it, and then use a few formulae to pull the new info into the old spreadsheet. The great advantages are that it uses the original data directly, so there are no entry errors to deal with. Also, the second pass just involves pulling out a copy of the original statement data and the target input by formula data, putting them side-by-side, using a few more formulae to spot errors due to differences in how names were spelled, making a few tweaks, and reconciling the thing a lot faster than before.

Pre-paperless innovation, a big statement could take me a few days (interspersed among all the other office duties) to finally balance it to zero. New method? I made it through four statements in one day, each one entered and balanced in two steps instead of about six.

The thing is, this isn’t really all that difficult, and anybody could learn to do it. One of the big helps in this process were the Excel functions INDEX and MATCH (which I’ll explain in a future post), and it took all of a two minute Google search and then reading the first good link to figure out how they worked in order to figure out how to do what I needed to do. What I needed to do: Compare the client’s first and last names and insurance plan type in one table in order to pull out a specific number from another. And this is literally all you need to do to learn how to make your office tools work for you.

Try it. Google “change the default font in Word,” or “turn off auto-correct in Word,” or “alternatives to VLOOKUP in Excel,” or any one of a number of other topics, and you’ll find the answers. It really isn’t any more complicated than reading a cookbook and making food from a recipe. Really, it’s not.

Using computers made easy

There is too much of an aura of mystery put around computers, but trust me, they are more simple than you think — and I’ve been working with them since… well, since most of my life, because I was just born at the right time. All that they ultimately understand are “Off” and “On.” “Zero” and “One.” Those are the only two states a switch can be in, that is what digital computing is, and it only gets two digits.

Maybe someday I’ll write a bit about how the electrons inside do what they do and turn it into intelligible information for humans, but for now suffice it to say that they pretty much only do a few things — input, store, and retrieve data through various devices; allow you to manipulate that data with various software programs; then allow you to re-store and output that data, again through various devices.

The nice thing about graphical user interfaces (GUIs) like Windows, OS, Android, Linux, etc., is that they tend to standardize across programs written in them, so that every program tends to use the same convention for the basics: Open, Close, Save, Save As, Print. Programs of the same type will also follow the same conventions — Format, Spellcheck, View, Layout, etc., for text editors; Image, Layer, Select, Filter, Effect, etc., for graphic design programs; Inset, Formulas, Calculate, Data, Sort, etc., for spreadsheets.

Finally, almost every program will have a Help function, whether it’s invoked via the F1 key, or by some combination of a control/alt/Apple/shift-click plus H move. Help menus, when well-done are great and, guess what? They were basically the hyperlinked documents we’ve all come to know and love via the internet, except that they’ve been around since long before the internet. Most of the time, they’ll answer the question but, if they don’t, you can always google it, as I mentioned above.

How to create job security

You may be wondering, “Okay, if my job is just doing data entry, or writing emails, or accounting, or… etc., why do I need to know so much about the software when no one else does?”

Simple. As the economy moves more and more toward service, knowledge becomes value. If you’re the one in the office who gets a reputation as the computer expert, you will get noticed, and you will save a higher-up’s cookies more than once. You’ll also earn the attention and gratitude of your co-workers if you become the one they come to when “I did something and something happened and I don’t know how to fix it,” and you know immediately upon looking that they accidentally, say, set Word to Web Layout instead of Print Layout. It’s called creating job security by taking that extra simple step that too many people refuse to. Try it!

Image Source: NASA, Apollo 11.