Javatpoint Logo
Javatpoint Logo

How to edit, evaluate, and debug formulas in Excel?

Role of Formulas in Excel

Formulas in Excel are used to perform calculations and manipulate data a spreadsheet. They allow users to perform mathematical operations, logical tests, and other functions on data entered in cells. Formulas are important in Excel because they provide a way to automate calculations and analysis of large amounts of data. They can calculate totals, averages, percentages, and other metrics. They can also manipulate text, dates, and other data types. Excel provides a wide range of built-in functions that can be used in formulas, such as SUM, AVERAGE, MAX, MIN, IF, and COUNTIF, to name a few. In addition, users can create their own custom functions to perform more complex functions. Formulas are a crucial part of Excel and are used extensively in business, finance, and many other industries for data analysis, reporting, and decision-making.

What is called editing the formula?

Editing the formula in Excel is the process of making changes to the existing formula within a cell. Excel uses formulas to perform calculations and manipulate data; editing the formula allows you to modify the calculation. To edit a formula in Excel, you can click on the cell that contains the formula and then click on the formula bar at the top of the screen. This will allow you to edit the formula directly in the formula bar. Alternatively, you can also double-click on the cell to enter edit mode and then make changes to the formula within the cell. Once you have made the necessary changes to the formula, changes to the formula, you can press the Enter key to update the calculation and display the new result in the cell.

How to edit the formula in Excel?

There are several methods to edit the formulas in Excel. The methods are described as follows.

1. Edit the formula using F2 Key.

Step 1: Enter the data in the worksheet respectively namely A1:C5.

Step 2: In this example, the data present in A1:B1, A2:B2, A3:B3, A4:B4, and A5:B5 needs to add. Hence select a new cell where the user wants to display the result namely D1 and enter the formula as =SUM (A1:B1).

Step 3: The result will be displayed in cell D1. To get the result for the remaining data, drag the fill handle toward cell D5.

How to edit, evaluate, and debug formulas in Excel?

Here in the worksheet, the formula needs to be edited as the data in cell C1:C5 needs to be added to the existing formula.

Step 4: To edit the formula, double-click the cell containing the formula, and select the cell containing data, or another option is to select the cell containing the formula and press the F2 Key. This makes the formula in edit mode.

How to edit, evaluate, and debug formulas in Excel?

Here, the data in cells A1 and B1 is selected, and at the bottom of the worksheet, an Edit option is displayed in the Status bar. The formula is in edit mode.

Step 5: Now edit the formula based on the requirement. Here the new cell C1 is added along with the formula and the respective result is displayed in the cell.

How to edit, evaluate, and debug formulas in Excel?

2. Editing directly in the formula bar

Pressing F2 Key, it places the cursor at the end of the formula. If the formula needs to be edited in the formula bar, the steps to be followed are,

Step 1: Choose File > Options

Step 2: In that, choose the option called "Advanced."

Step 3: Uncheck the option "Allow editing directly in the cell." Click Ok to save the changes.

How to edit, evaluate, and debug formulas in Excel?

Step 4: Another option to edit the formula is to click anywhere in the formula bar.

What is called evaluating the formula?

In Microsoft Excel, "evaluating a formula" means calculating a formula's result and displaying the result in the cell. Excel formulas are mathematical functions, cell references, and operators that perform calculations on the data in the cells. When you create a formula, Excel doesn't automatically calculate the result but instead displays the formula in the cell.

How to evaluate the formula in Excel

1. F9 Key to evaluate the formula

In Microsoft Excel, pressing the F9 Key will evaluate the selected part of a formula. This means that Excel will replace the selected part of the formula with its calculated value. For example, if you have a formula that adds two numbers together, such as "=5+10", selecting the "5+10" part of the formula and then pressing F9 will replace it with "15", the result of the calculation.

Note: if you press F9 on the entire formula, it will replace the formula with its calculated value, which may differ from what you want if the formula contains references to other cells or functions.

Example: Evaluate the formula in the given data.

To evaluate the formula, the steps to be followed are,

Step 1: Enter the data in the spreadsheet namely A1:B5

Step 2: Select a new cell where the user wants to display the result and enter the formula as =IF (SUM (A1:A5)>SUM (B1:B5), "Good," Bad")

How to edit, evaluate, and debug formulas in Excel?

Step 3: To evaluate the formula select the cell containing the formula C1.

Step 4: To change the cell into edit mode, press F2 or double-click the cell.

Step 5: Select the required formula part for testing purposes and press F9.

Step 6: In this example, if the cell ranges A1:A5 is selected, it displays the actual values by pressing the F9 Key.

How to edit, evaluate, and debug formulas in Excel?

Step 7: For example, if the SUM functions are selected along with the cell range, it displays the calculated value.

How to edit, evaluate, and debug formulas in Excel?

Note: Before pressing the F9 Key, select some part in the formula, or else replace the entire formula with the calculated value.

Don't press the Enter key, while evaluating the formula, as it replaces the selected part with the calculated values or cell values.

To return to the original position, press the Esc key to cancel the formula testing and exit the evaluation mode in the formula.

2. Using Evaluate Formula Feature

The "Evaluate Formula" feature in Excel allows you to see how Excel calculates a formula step by step, which can be very useful in identifying and resolving errors. If you notice an error in the calculation, you can use this feature to identify the source and make necessary changes to the formula.

Step 1: Select the cell containing the formula, namely C1.

Step 2: Choose the Evaluate Formula option in the Formula tab.

How to edit, evaluate, and debug formulas in Excel?

Step 3: The Evaluate Formula dialog box will open. In that, choose the Evaluate option. By clicking the Evaluate option, it will move to the next step.

Step 4: Click the Evaluate button until it reaches the end of the formula. Here each part of the formula is evaluated.

Step 5: To end the evaluation click the Close option.

What is called debugging the formula?

In Microsoft Excel, the debugging formula or formula editing feature helps you identify errors in your formulas. It is useful for troubleshooting and correcting errors in complex formulas. The formula auditing tools include the Trace Precedents, Trace Dependents, Evaluate Formula, and Error Checking Features. Here is a brief explanation of each of these features:

Trace Precedents: This tool allows you to see which cells affect the value of the selected cells. It shows you the cells directly or indirectly referenced in the selected formula.

Trace Dependents: This tool allows you to see which cells depend on the selected cell's value. It shows you the cells that directly or indirectly reference the selected cell.

Evaluate Formula: This tool allows the user to step through the formula calculation process to see the intermediate results at each stage. This can help the users identify where errors occur in complex formulas.

Error Checking: This tool automatically checks for errors in your formulas and provides suggestions for correcting them. It can identify common errors like division by zero, incorrect syntax, and circular references.

To use these features, you can click on the cell containing the formula you want to debug and then click the "Formulas" tab in the ribbon. From there, you can select the appropriate tool for debugging your formula.

How to debug the formula in Excel?

1. Using Trace Precedents

Trace Precedents is a tool in Microsoft Excel that allows you to visually trace the relationship between a selected cell and the cells directly or indirectly referenced by it. This is useful in identifying and understanding the various formulas and dependencies that exist within a complex spreadsheet and can help you to detect errors and inconsistencies that may be present.

To use Trace Precedents, the steps to be followed are,

Step 1: Select the cell for which you want to trace the precedents. Here cell C1 is selected

Step 2: Click on the Formulas tab in the ribbon at the top of the screen.

Step 3: Click on the Trace Precedents button in the Formula Auditing section

How to edit, evaluate, and debug formulas in Excel?

Step 4: Excel will draw arrows pointing from the selected cell to the cells directly feeding it. You can continue to click the Trace Precedents button to trace the precedents further up the chain.

How to edit, evaluate, and debug formulas in Excel?

Step 5: To remove the arrows and return to the original view, Click on the Remove Arrows button in the Formula Auditing Section.

How to edit, evaluate, and debug formulas in Excel?

By choosing the Remove Arrow option, it removes the arrow in the worksheet.

How to edit, evaluate, and debug formulas in Excel?

2. Trace Dependents

The Trace Dependents feature in Excel allows you to trace the cells dependent on a selected cell visually. This is useful when you need to understand how changes to a particular cell affect other cells in your worksheet. Here are the steps to use Trace Dependents in Excel:

Step 1: Select the cell for which you want to trace dependents

Step 2: Click on the "Formulas" tab in the ribbon at the top of the screen.

Step 3: Click on the "Trace Dependents" button in the "Formula Auditing" section of the ribbon. This button has an icon of a blue arrow pointing to the right with a question mark.

How to edit, evaluate, and debug formulas in Excel?

Step 4: Excel will draw all the cells dependent on the selected cell. The arrows will show the data flow from the selected cell to the dependent cells.

How to edit, evaluate, and debug formulas in Excel?

Step 5: If there are multiple dependencies, you can use the "Trace Dependents" button again to trace the dependents of the dependent cells.

How to edit, evaluate, and debug formulas in Excel?

Step 6: To remove the arrows, click on the "Remove Arrows" button in the "Formula Auditing" section of the ribbon. This button has an icon of a blue arrow pointing to the left with a question mark.

How to edit, evaluate, and debug formulas in Excel?

The Remove arrow removes the arrow from the spreadsheet.

How to edit, evaluate, and debug formulas in Excel?

Note: The trace dependents feature only works with cells containing formulas referencing other cells. If a cell contains a value that is not calculated from other cells, Trace Dependents will not work.

Summary

In conclusion, editing, evaluating, and debugging formulas in Excel are essential skills that every Excel user should master. These skills help you create accurate and efficient formulas that save time and effort. By mastering these skills, you can confidently create formulas and ensure that your data is accurate and reliable.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA