Excel 简明教程

Creating Formulas in Excel 2010

Formulas in MS Excel

公式是工作表的灵魂。如果没有公式,工作表将只是数据的简单表格表示。公式由一个特殊代码组成,该代码被输入到一个单元格中。它执行一些计算并返回一个结果,该结果显示在单元格中。

Formulas are the Bread and butter of worksheet. Without formula, worksheet will be just simple tabular representation of data. A formula consists of special code, which is entered into a cell. It performs some calculations and returns a result, which is displayed in the cell.

公式使用各种运算符和工作表函数来处理值和文本。公式中使用的值和文本可以位于其他单元格中,这使得更改数据变得容易,并赋予工作表以动态特性。例如,你可以快速更改工作表中的数据,公式则会随之更新。

Formulas use a variety of operators and worksheet functions to work with values and text. The values and text used in formulas can be located in other cells, which makes changing data easy and gives worksheets their dynamic nature. For example, you can quickly change the data in a worksheet and formulas works.

Elements of Formulas

公式可以包含下列任意元素 −

A formula can consist of any of these elements −

  1. Mathematical operators, such as +(for addition) and *(for multiplication) Example − =A1+A2 Adds the values in cells A1 and A2.

  2. Values or text Example − =200*0.5 Multiplies 200 times 0.15. This formula uses only values, and it always returns the same result as 100.

  3. Cell references (including named cells and ranges) Example − =A1=C12 Compares cell A1 with cell C12. If the cells are identical, the formula returns TRUE; otherwise, it returns FALSE.

  4. Worksheet functions (such as SUMor AVERAGE) Example − =SUM(A1:A12) Adds the values in the range A1:A12.

Creating Formula

创建公式需要在公式栏中键入。公式以“=”号开头。在手动构建公式时,既可以在单元格地址中键入也可以在工作表中指向它们。使用 Pointing method 为公式提供单元格地址通常是更简单且更强大的公式构建方法。当使用内置函数时,在“函数参数”对话框中定义函数参数时,单击单元格或拖过要使用的单元格区域。请参阅下面的屏幕截图。

For creating a formula you need to type in the Formula Bar. Formula begins with '=' sign. When building formulas manually, you can either type in the cell addresses or you can point to them in the worksheet. Using the Pointing method to supply the cell addresses for formulas is often easier and more powerful method of formula building. When you are using built-in functions, you click the cell or drag through the cell range that you want to use when defining the function’s arguments in the Function Arguments dialog box. See the below screen shot.

formula intro

完成公式输入后,Excel 立即计算结果,然后在工作表中的单元格内显示结果(但是,只要单元格处于活动状态,公式的内容就会继续在公式栏上显示)。如果您在公式中输入错误,导致 Excel 完全无法计算公式,Excel 会显示一个“警告”对话框,建议如何解决问题。

As soon as you complete a formula entry, Excel calculates the result, which is then displayed inside the cell within the worksheet (the contents of the formula, however, continue to be visible on the Formula bar anytime the cell is active). If you make an error in the formula that prevents Excel from being able to calculate the formula at all, Excel displays an Alert dialog box suggesting how to fix the problem.