If you are an Excel user, you may have been writing Excel formulas from day one, or you may just be learning how helpful they can be. Either way, it's likely that you run into problems from time to time. Just like any other programming language or statistical tool, Excel provides a way to decompose a formula, however long it may be, and perform step-by-step calculations. This way, you can jump inside a nested formula and understand how it works.
In this guide, you will learn to troubleshoot Excel formulas by walking through a scenario based on calculating the distance between two coordinate points and then normalizing the resulted distance. You'll need to understand operator precedence for this guide. For a quick review, you can refer to Wikipedia: Order of operations.
Consider this table, which consists of five rows each with two coordinate points
First, calculate the Euclidean distance, or shortest distance, between each of the pairs. The Euclidean distance is represented as:
d = sqrt( (x2 - x1)^2 + (y2 - y1)^2 )
Create a new column named Euclidean Distance and use the formula above to arrive at the following table:
Notice that the resulting Euclidean Distance column values are not rounded up and they are spread across a range
The next step is to normalize the distance values in a range
[0, 1] using the given formula:
x_current = (x_current - x_minimum) / (x_maximum - x_minimum)
By applying the above formula to the Euclidean Distance column values, you get this table:
|X1||Y1||X2||Y2||Euclidean Distance||Normalized Euclidean Distance|
Notice that all the values in the Normalized Euclidean Distance column lie in a range of
[0, 1]. With the data setup completed, let's learn how Excel computes these formula outputs step by step.
To troubleshoot any Excel formula, follow these steps:
You have learned how to use the Evaluate Formula tool, including its role in breaking down a nested formula and evaluating each term step-by-step. This will help you to analyze large nested formulas and understand how they work.