Formulas can be tricky. If you’ve ever had trouble dragging and dropping formulas, or repeating formulas in multiple cells read up on this quick trick that will make formulas a breeze.
Making a Formula Stick
Formulas are a handy addition that help automate a number of actions in your sheets. So when you find a good one --like a formula to automate RYG balls or calculate projected deal revenue --you’ll probably want to use it in more place than one. Make sure you know these careful steps to create a universal formula that’s applicable to any cell, and still work in the way that you want it to.
Breaking it down
Let’s start by looking at an example of a mileage tracking sheet to put it in perspective.
The following sheet allows Pat Wilson to track her car mileage for work trips. Pat enters her monthly mileage rate on the first row within the Total Amount column. This rate (.555) is what we want to base the rest of the formulas in the column around.
When referring to this cell in a formula we call this [Total Amount]1 -- where the name in brackets is the column name (Total Amount) and the 1 refers to the row number. See blue circle in screenshot.
In each of the rows below, we use this rate to multiply the Total Miles by the Rate and get the Total Amount for the Trip. If I were to create this formula on Row 2 it might look like:
= [Total Amount]1 * [Total Miles]2
This works perfectly in Row 2 because it means the total amount of Row 1 multiplied by the Total Miles in Row 2.
Here’s where formulas can get tricky (pay close attention)
If I wanted to apply this same formula to row three by dragging or copying, I’d find my new formula would look like
=[Total Amount]2 * [Total Miles]3
This would give me a Total Amount of $138.75! Clearly not the right rate for a 25 mile trip. This is because it changed our formula ‘relative’ to where we dragged it to.This is because when copying a formula by dragging it down to another row or column, you must mark the formula with an absolute reference. A reference is the part of the formula that makes it stick.
Without a reference defined specifically in your formula, it will update itself relative to wherever you drag copy the formula in your sheet, potentially creating some wonky numbers.
What does dragging or copying a formula do then?
In our example dragging the formula down to the next row incremented the row number on each of our referenced cells by one.
= [Total Amount]1 * [Total Miles]2
changed to
=[Total Amount]2* [Total Miles]3
This is calculating the total amount of row two multiplied by the total miles in row three and did not take the rate into consideration at all. (Notice the numbers in red changed ‘relative’ to where we dragged it to.)
To continue to point to our monthly rate in [Total Amount]1 yet multiply this by the total miles found on the new row in [Total Miles]3, the correct formula would read:
= [Total Amount]1 * [Total Miles]3
So how do we adjust the formula to work?
To place the correct formula in the cell by copying or dragging, we use an absolute cell reference. Implement an absolute cell reference by placing a dollar sign before the row number on my reference to the rate like so:
= [Total Amount]$1 * [Total Miles]2
This will tell the formula to always point to this row regardless of the drag action.
Shortcut: While editing a formula in a cell, press Ctrl+L to make the column name or row number absolute by inserting the $ symbol for you. Be sure your cursor is within the cell reference in the formula.
I can now drag this formula to any row below and it will always point to row 1 for the rate and the current row for the total miles.
Formulas can be tricky, so don't get discouraged! Refer to our formulas video if you need more step - by -step help!
'Til next week, dig in and explore!
- The Support Team