Friday, May 18, 2007

Excel Formulas are Algebra, part 1

If you are already familiar with Excel formulas, you don't need to bother with this post or its companions of similar title.

Some who are new to Excel either don't know it has formulas, or thinks they are hard, particularly if they think they aren't good at math. Some fear the word "Algebra", and remember 7th or 8th grade torture sessions. However, let's take a tiny quiz. Here are two simple algebra problems:

1) x = y + 3; y = 2; what is x?

2) z = x*1.1; x = 30; what is z?

Did you answer "5" and "33"? If so, you did a little algebra.

Now, suppose you are faced with a column of numbers, perhaps a few hundred. Maybe they are prices of labware. You need to add 4% to each. Adding 4% is the same as multiplying a number by 1.04; now look at this image:


This little formula will take whatever is in cell E2 and multiply by 1.04.

Once you press the Enter key (or click on a different cell), you'll see something like this:


Now, what you do is move back to cell F2, and double-click on the tiny black square to the lower right. That is the Fill Handle. The formula will be put in the entire F column, until it runs out of numbers in the E column.

You may have a question at this point, about what happens to E2 in the formula, which I'll address in the next post.

First, let us close by relating this formula to algebra.

A statement like y=x*1.04 means "whatever 'x' is, multiply it by 1.04, and that is the new value of 'y'."
An Excel formula like =E2*1.04 means "whatever is in cell E2, multiply it by 1.04, and that is the new value to put in this cell (the one containing the formula)."

No comments: