In microsoft excel what is a formula

Overview of formulas in Excel

Get started on how to create formulas and use built-in functions to perform calculations and solve problems.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Important: The calculated results of formulas and some Excel worksheet functions may differ slightly between a Windows PC using x86 or x86-64 architecture and a Windows RT PC using ARM architecture. Learn more about the differences.

Important: In this article we discuss XLOOKUP and VLOOKUP, which are similar. Try using the new XLOOKUP function, an improved version of VLOOKUP that works in any direction and returns exact matches by default, making it easier and more convenient to use than its predecessor.

Create a formula that refers to values in other cells

  1. Select a cell.

  2. Type the equal sign =.

    Note: Formulas in Excel always begin with the equal sign.

  3. Select a cell or type its address in the selected cell.

    select cell

  4. Enter an operator. For example, – for subtraction.

  5. Select the next cell, or type its address in the selected cell.

    next cell

  6. Press Enter. The result of the calculation appears in the cell with the formula.

See a formula

  1. When a formula is entered into a cell, it also appears in the Formula bar.

    Formula Bar

  2. To see a formula, select a cell, and it will appear in the formula bar.

    See formula bar

Enter a formula that contains a built-in function

  1. Select an empty cell.

  2. Type an equal sign = and then type a function. For example, =SUM for getting the total sales.

  3. Type an opening parenthesis (.

  4. Select the range of cells, and then type a closing parenthesis).

    range

  5. Press Enter to get the result.

Download our Formulas tutorial workbook

We’ve put together a Get started with Formulas workbook that you can download. If you’re new to Excel, or even if you have some experience with it, you can walk through Excel’s most common formulas in this tour. With real-world examples and helpful visuals, you’ll be able to Sum, Count, Average, and Vlookup like a pro.

Formulas in-depth

You can browse through the individual sections below to learn more about specific formula elements.

A formula can also contain any or all of the following: functions, references, operators, and constants.

Parts of a formula   

Parts of a formula

1. Functions: The PI() function returns the value of pi: 3.142…

2. References: A2 returns the value in cell A2.

3. Constants: Numbers or text values entered directly into a formula, such as 2.

4. Operators: The ^ (caret) operator raises a number to a power, and the * (asterisk) operator multiplies numbers.

A constant is a value that is not calculated; it always stays the same. For example, the date 10/9/2008, the number 210, and the text «Quarterly Earnings» are all constants. An expression or a value resulting from an expression is not a constant. If you use constants in a formula instead of references to cells (for example, =30+70+110), the result changes only if you modify the formula. In general, it’s best to place constants in individual cells where they can be easily changed if needed, then reference those cells in formulas.

A reference identifies a cell or a range of cells on a worksheet, and tells Excel where to look for the values or data you want to use in a formula. You can use references to use data contained in different parts of a worksheet in one formula or use the value from one cell in several formulas. You can also refer to cells on other sheets in the same workbook, and to other workbooks. References to cells in other workbooks are called links or external references.

  • The A1 reference style

    By default, Excel uses the A1 reference style, which refers to columns with letters (A through XFD, for a total of 16,384 columns) and refers to rows with numbers (1 through 1,048,576). These letters and numbers are called row and column headings. To refer to a cell, enter the column letter followed by the row number. For example, B2 refers to the cell at the intersection of column B and row 2.

    To refer to

    Use

    The cell in column A and row 10

    A10

    The range of cells in column A and rows 10 through 20

    A10:A20

    The range of cells in row 15 and columns B through E

    B15:E15

    All cells in row 5

    5:5

    All cells in rows 5 through 10

    5:10

    All cells in column H

    H:H

    All cells in columns H through J

    H:J

    The range of cells in columns A through E and rows 10 through 20

    A10:E20

  • Making a reference to a cell or a range of cells on another worksheet in the same workbook

    In the following example, the AVERAGE function calculates the average value for the range B1:B10 on the worksheet named Marketing in the same workbook.

    Sheet reference example

    1. Refers to the worksheet named Marketing

    2. Refers to the range of cells from B1 to B10

    3. The exclamation point (!) Separates the worksheet reference from the cell range reference

    Note: If the referenced worksheet has spaces or numbers in it, then you need to add apostrophes (‘) before and after the worksheet name, like =’123′!A1 or =’January Revenue’!A1.

  • The difference between absolute, relative and mixed references

    1. Relative references    A relative cell reference in a formula, such as A1, is based on the relative position of the cell that contains the formula and the cell the reference refers to. If the position of the cell that contains the formula changes, the reference is changed. If you copy or fill the formula across rows or down columns, the reference automatically adjusts. By default, new formulas use relative references. For example, if you copy or fill a relative reference in cell B2 to cell B3, it automatically adjusts from =A1 to =A2.

      Copied formula with relative reference   

      Copied formula with relative reference

    2. Absolute references    An absolute cell reference in a formula, such as $A$1, always refer to a cell in a specific location. If the position of the cell that contains the formula changes, the absolute reference remains the same. If you copy or fill the formula across rows or down columns, the absolute reference does not adjust. By default, new formulas use relative references, so you may need to switch them to absolute references. For example, if you copy or fill an absolute reference in cell B2 to cell B3, it stays the same in both cells: =$A$1.

      Copied formula with absolute reference   

      Copied formula with absolute reference

    3. Mixed references    A mixed reference has either an absolute column and relative row, or absolute row and relative column. An absolute column reference takes the form $A1, $B1, and so on. An absolute row reference takes the form A$1, B$1, and so on. If the position of the cell that contains the formula changes, the relative reference is changed, and the absolute reference does not change. If you copy or fill the formula across rows or down columns, the relative reference automatically adjusts, and the absolute reference does not adjust. For example, if you copy or fill a mixed reference from cell A2 to B3, it adjusts from =A$1 to =B$1.

      Copied formula with mixed reference   

      Copied formula with mixed reference

  • The 3-D reference style

    Conveniently referencing multiple worksheets    If you want to analyze data in the same cell or range of cells on multiple worksheets within a workbook, use a 3-D reference. A 3-D reference includes the cell or range reference, preceded by a range of worksheet names. Excel uses any worksheets stored between the starting and ending names of the reference. For example, =SUM(Sheet2:Sheet13!B5) adds all the values contained in cell B5 on all the worksheets between and including Sheet 2 and Sheet 13.

    • You can use 3-D references to refer to cells on other sheets, to define names, and to create formulas by using the following functions: SUM, AVERAGE, AVERAGEA, COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV.P, STDEV.S, STDEVA, STDEVPA, VAR.P, VAR.S, VARA, and VARPA.

    • 3-D references cannot be used in array formulas.

    • 3-D references cannot be used with the intersection operator (a single space) or in formulas that use implicit intersection.

    What occurs when you move, copy, insert, or delete worksheets    The following examples explain what happens when you move, copy, insert, or delete worksheets that are included in a 3-D reference. The examples use the formula =SUM(Sheet2:Sheet6!A2:A5) to add cells A2 through A5 on worksheets 2 through 6.

    • Insert or copy    If you insert or copy sheets between Sheet2 and Sheet6 (the endpoints in this example), Excel includes all values in cells A2 through A5 from the added sheets in the calculations.

    • Delete     If you delete sheets between Sheet2 and Sheet6, Excel removes their values from the calculation.

    • Move    If you move sheets from between Sheet2 and Sheet6 to a location outside the referenced sheet range, Excel removes their values from the calculation.

    • Move an endpoint    If you move Sheet2 or Sheet6 to another location in the same workbook, Excel adjusts the calculation to accommodate the new range of sheets between them.

    • Delete an endpoint    If you delete Sheet2 or Sheet6, Excel adjusts the calculation to accommodate the range of sheets between them.

  • The R1C1 reference style

    You can also use a reference style where both the rows and the columns on the worksheet are numbered. The R1C1 reference style is useful for computing row and column positions in macros. In the R1C1 style, Excel indicates the location of a cell with an «R» followed by a row number and a «C» followed by a column number.

    Reference

    Meaning

    R[-2]C

    A relative reference to the cell two rows up and in the same column

    R[2]C[2]

    A relative reference to the cell two rows down and two columns to the right

    R2C2

    An absolute reference to the cell in the second row and in the second column

    R[-1]

    A relative reference to the entire row above the active cell

    R

    An absolute reference to the current row

    When you record a macro, Excel records some commands by using the R1C1 reference style. For example, if you record a command, such as clicking the AutoSum button to insert a formula that adds a range of cells, Excel records the formula by using R1C1 style, not A1 style, references.

    You can turn the R1C1 reference style on or off by setting or clearing the R1C1 reference style check box under the Working with formulas section in the Formulas category of the Options dialog box. To display this dialog box, click the File tab.

    Top of Page

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

Switch between relative, absolute and mixed references for functions

Using calculation operators in Excel formulas

The order in which Excel performs operations in formulas

Using functions and nested functions in Excel formulas

Define and use names in formulas

Guidelines and examples of array formulas

Delete or remove a formula

How to avoid broken formulas

Find and correct errors in formulas

Excel keyboard shortcuts and function keys

Excel functions (by category)

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

If you’re new to Excel for the web, you’ll soon find that it’s more than just a grid in which you enter numbers in columns or rows. Yes, you can use Excel for the web to find totals for a column or row of numbers, but you can also calculate a mortgage payment, solve math or engineering problems, or find a best case scenario based on variable numbers that you plug in.

Excel for the web does this by using formulas in cells. A formula performs calculations or other actions on the data in your worksheet. A formula always starts with an equal sign (=), which can be followed by numbers, math operators (such as a plus or minus sign), and functions, which can really expand the power of a formula.

For example, the following formula multiplies 2 by 3 and then adds 5 to that result to come up with the answer, 11.

=2*3+5

This next formula uses the PMT function to calculate a mortgage payment ($1,073.64), which is based on a 5 percent interest rate (5% divided by 12 months equals the monthly interest rate) over a 30-year period (360 months) for a $200,000 loan:

=PMT(0.05/12,360,200000)

Here are some additional examples of formulas that you can enter in a worksheet.

  • =A1+A2+A3    Adds the values in cells A1, A2, and A3.

  • =SQRT(A1)    Uses the SQRT function to return the square root of the value in A1.

  • =TODAY()    Returns the current date.

  • =UPPER(«hello»)     Converts the text «hello» to «HELLO» by using the UPPER worksheet function.

  • =IF(A1>0)    Tests the cell A1 to determine if it contains a value greater than 0.

The parts of a formula

A formula can also contain any or all of the following: functions, references, operators, and constants.

Parts of a formula

1. Functions: The PI() function returns the value of pi: 3.142…

2. References: A2 returns the value in cell A2.

3. Constants: Numbers or text values entered directly into a formula, such as 2.

4. Operators: The ^ (caret) operator raises a number to a power, and the * (asterisk) operator multiplies numbers.

Using constants in formulas

A constant is a value that is not calculated; it always stays the same. For example, the date 10/9/2008, the number 210, and the text «Quarterly Earnings» are all constants. An expression or a value resulting from an expression is not a constant. If you use constants in a formula instead of references to cells (for example, =30+70+110), the result changes only if you modify the formula.

Using calculation operators in formulas

Operators specify the type of calculation that you want to perform on the elements of a formula. There is a default order in which calculations occur (this follows general mathematical rules), but you can change this order by using parentheses.

Types of operators

There are four different types of calculation operators: arithmetic, comparison, text concatenation, and reference.

Arithmetic operators

To perform basic mathematical operations, such as addition, subtraction, multiplication, or division; combine numbers; and produce numeric results, use the following arithmetic operators.

Arithmetic operator

Meaning

Example

+ (plus sign)

Addition

3+3

– (minus sign)

Subtraction
Negation

3–1
–1

* (asterisk)

Multiplication

3*3

/ (forward slash)

Division

3/3

% (percent sign)

Percent

20%

^ (caret)

Exponentiation

3^2

Comparison operators

You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value — either TRUE or FALSE.

Comparison operator

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

Text concatenation operator

Use the ampersand (&) to concatenate (join) one or more text strings to produce a single piece of text.

Text operator

Meaning

Example

& (ampersand)

Connects, or concatenates, two values to produce one continuous text value

«North»&»wind» results in «Northwind»

Reference operators

Combine ranges of cells for calculations with the following operators.

Reference operator

Meaning

Example

: (colon)

Range operator, which produces one reference to all the cells between two references, including the two references.

B5:B15

, (comma)

Union operator, which combines multiple references into one reference

SUM(B5:B15,D5:D15)

(space)

Intersection operator, which produces one reference to cells common to the two references

B7:D7 C6:C8

The order in which Excel for the web performs operations in formulas

In some cases, the order in which a calculation is performed can affect the return value of the formula, so it’s important to understand how the order is determined and how you can change the order to obtain the results you want.

Calculation order

Formulas calculate values in a specific order. A formula always begins with an equal sign (=). Excel for the web interprets the characters that follow the equal sign as a formula. Following the equal sign are the elements to be calculated (the operands), such as constants or cell references. These are separated by calculation operators. Excel for the web calculates the formula from left to right, according to a specific order for each operator in the formula.

Operator precedence

If you combine several operators in a single formula, Excel for the web performs the operations in the order shown in the following table. If a formula contains operators with the same precedence—for example, if a formula contains both a multiplication and division operator— Excel for the web evaluates the operators from left to right.

Operator

Description

: (colon)

(single space)

, (comma)

Reference operators

Negation (as in –1)

%

Percent

^

Exponentiation

* and /

Multiplication and division

+ and –

Addition and subtraction

&

Connects two strings of text (concatenation)

=
< >
<=
>=
<>

Comparison

Use of parentheses

To change the order of evaluation, enclose in parentheses the part of the formula to be calculated first. For example, the following formula produces 11 because Excel for the web performs multiplication before addition. The formula multiplies 2 by 3 and then adds 5 to the result.

=5+2*3

In contrast, if you use parentheses to change the syntax, Excel for the web adds 5 and 2 together and then multiplies the result by 3 to produce 21.

=(5+2)*3

In the following example, the parentheses that enclose the first part of the formula force Excel for the web to calculate B4+25 first and then divide the result by the sum of the values in cells D5, E5, and F5.

=(B4+25)/SUM(D5:F5)

Using functions and nested functions in formulas

Functions are predefined formulas that perform calculations by using specific values, called arguments, in a particular order, or structure. Functions can be used to perform simple or complex calculations.

The syntax of functions

The following example of the ROUND function rounding off a number in cell A10 illustrates the syntax of a function.

Structure of a function

1. Structure. The structure of a function begins with an equal sign (=), followed by the function name, an opening parenthesis, the arguments for the function separated by commas, and a closing parenthesis.

2. Function name. For a list of available functions, click a cell and press SHIFT+F3.

3. Arguments. Arguments can be numbers, text, logical values such as TRUE or FALSE, arrays, error values such as #N/A, or cell references. The argument you designate must produce a valid value for that argument. Arguments can also be constants, formulas, or other functions.

4. Argument tooltip. A tooltip with the syntax and arguments appears as you type the function. For example, type =ROUND( and the tooltip appears. Tooltips appear only for built-in functions.

Entering functions

When you create a formula that contains a function, you can use the Insert Function dialog box to help you enter worksheet functions. As you enter a function into the formula, the Insert Function dialog box displays the name of the function, each of its arguments, a description of the function and each argument, the current result of the function, and the current result of the entire formula.

To make it easier to create and edit formulas and minimize typing and syntax errors, use Formula AutoComplete. After you type an = (equal sign) and beginning letters or a display trigger, Excel for the web displays, below the cell, a dynamic drop-down list of valid functions, arguments, and names that match the letters or trigger. You can then insert an item from the drop-down list into the formula.

Nesting functions

In certain cases, you may need to use a function as one of the arguments of another function. For example, the following formula uses a nested AVERAGE function and compares the result with the value 50.

Nested functions

1. The AVERAGE and SUM functions are nested within the IF function.

Valid returns    When a nested function is used as an argument, the nested function must return the same type of value that the argument uses. For example, if the argument returns a TRUE or FALSE value, the nested function must return a TRUE or FALSE value. If the function doesn’t, Excel for the web displays a #VALUE! error value.

Nesting level limits    A formula can contain up to seven levels of nested functions. When one function (we’ll call this Function B) is used as an argument in another function (we’ll call this Function A), Function B acts as a second-level function. For example, the AVERAGE function and the SUM function are both second-level functions if they are used as arguments of the IF function. A function nested within the nested AVERAGE function is then a third-level function, and so on.

Using references in formulas

A reference identifies a cell or a range of cells on a worksheet, and tells Excel for the web where to look for the values or data you want to use in a formula. You can use references to use data contained in different parts of a worksheet in one formula or use the value from one cell in several formulas. You can also refer to cells on other sheets in the same workbook, and to other workbooks. References to cells in other workbooks are called links or external references.

The A1 reference style

The default reference style    By default, Excel for the web uses the A1 reference style, which refers to columns with letters (A through XFD, for a total of 16,384 columns) and refers to rows with numbers (1 through 1,048,576). These letters and numbers are called row and column headings. To refer to a cell, enter the column letter followed by the row number. For example, B2 refers to the cell at the intersection of column B and row 2.

To refer to

Use

The cell in column A and row 10

A10

The range of cells in column A and rows 10 through 20

A10:A20

The range of cells in row 15 and columns B through E

B15:E15

All cells in row 5

5:5

All cells in rows 5 through 10

5:10

All cells in column H

H:H

All cells in columns H through J

H:J

The range of cells in columns A through E and rows 10 through 20

A10:E20

Making a reference to another worksheet    In the following example, the AVERAGE worksheet function calculates the average value for the range B1:B10 on the worksheet named Marketing in the same workbook.

Sheet reference example

1. Refers to the worksheet named Marketing

2. Refers to the range of cells between B1 and B10, inclusively

3. Separates the worksheet reference from the cell range reference

The difference between absolute, relative and mixed references

Relative references    A relative cell reference in a formula, such as A1, is based on the relative position of the cell that contains the formula and the cell the reference refers to. If the position of the cell that contains the formula changes, the reference is changed. If you copy or fill the formula across rows or down columns, the reference automatically adjusts. By default, new formulas use relative references. For example, if you copy or fill a relative reference in cell B2 to cell B3, it automatically adjusts from =A1 to =A2.

Copied formula with relative reference

Absolute references    An absolute cell reference in a formula, such as $A$1, always refer to a cell in a specific location. If the position of the cell that contains the formula changes, the absolute reference remains the same. If you copy or fill the formula across rows or down columns, the absolute reference does not adjust. By default, new formulas use relative references, so you may need to switch them to absolute references. For example, if you copy or fill an absolute reference in cell B2 to cell B3, it stays the same in both cells: =$A$1.

Copied formula with absolute reference

Mixed references    A mixed reference has either an absolute column and relative row, or absolute row and relative column. An absolute column reference takes the form $A1, $B1, and so on. An absolute row reference takes the form A$1, B$1, and so on. If the position of the cell that contains the formula changes, the relative reference is changed, and the absolute reference does not change. If you copy or fill the formula across rows or down columns, the relative reference automatically adjusts, and the absolute reference does not adjust. For example, if you copy or fill a mixed reference from cell A2 to B3, it adjusts from =A$1 to =B$1.

Copied formula with mixed reference

The 3-D reference style

Conveniently referencing multiple worksheets    If you want to analyze data in the same cell or range of cells on multiple worksheets within a workbook, use a 3-D reference. A 3-D reference includes the cell or range reference, preceded by a range of worksheet names. Excel for the web uses any worksheets stored between the starting and ending names of the reference. For example, =SUM(Sheet2:Sheet13!B5) adds all the values contained in cell B5 on all the worksheets between and including Sheet 2 and Sheet 13.

  • You can use 3-D references to refer to cells on other sheets, to define names, and to create formulas by using the following functions: SUM, AVERAGE, AVERAGEA, COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV.P, STDEV.S, STDEVA, STDEVPA, VAR.P, VAR.S, VARA, and VARPA.

  • 3-D references cannot be used in array formulas.

  • 3-D references cannot be used with the intersection operator (a single space) or in formulas that use implicit intersection.

What occurs when you move, copy, insert, or delete worksheets    The following examples explain what happens when you move, copy, insert, or delete worksheets that are included in a 3-D reference. The examples use the formula =SUM(Sheet2:Sheet6!A2:A5) to add cells A2 through A5 on worksheets 2 through 6.

  • Insert or copy    If you insert or copy sheets between Sheet2 and Sheet6 (the endpoints in this example), Excel for the web includes all values in cells A2 through A5 from the added sheets in the calculations.

  • Delete     If you delete sheets between Sheet2 and Sheet6, Excel for the web removes their values from the calculation.

  • Move    If you move sheets from between Sheet2 and Sheet6 to a location outside the referenced sheet range, Excel for the web removes their values from the calculation.

  • Move an endpoint    If you move Sheet2 or Sheet6 to another location in the same workbook, Excel for the web adjusts the calculation to accommodate the new range of sheets between them.

  • Delete an endpoint    If you delete Sheet2 or Sheet6, Excel for the web adjusts the calculation to accommodate the range of sheets between them.

The R1C1 reference style

You can also use a reference style where both the rows and the columns on the worksheet are numbered. The R1C1 reference style is useful for computing row and column positions in macros. In the R1C1 style, Excel for the web indicates the location of a cell with an «R» followed by a row number and a «C» followed by a column number.

Reference

Meaning

R[-2]C

A relative reference to the cell two rows up and in the same column

R[2]C[2]

A relative reference to the cell two rows down and two columns to the right

R2C2

An absolute reference to the cell in the second row and in the second column

R[-1]

A relative reference to the entire row above the active cell

R

An absolute reference to the current row

When you record a macro, Excel for the web records some commands by using the R1C1 reference style. For example, if you record a command, such as clicking the AutoSum button to insert a formula that adds a range of cells, Excel for the web records the formula by using R1C1 style, not A1 style, references.

Using names in formulas

You can create defined names to represent cells, ranges of cells, formulas, constants, or Excel for the web tables. A name is a meaningful shorthand that makes it easier to understand the purpose of a cell reference, constant, formula, or table, each of which may be difficult to comprehend at first glance. The following information shows common examples of names and how using them in formulas can improve clarity and make formulas easier to understand.

Example Type

Example, using ranges instead of names

Example, using names

Reference

=SUM(A16:A20)

=SUM(Sales)

Constant

=PRODUCT(A12,9.5%)

=PRODUCT(Price,KCTaxRate)

Formula

=TEXT(VLOOKUP(MAX(A16,A20),A16:B20,2,FALSE),»m/dd/yyyy»)

=TEXT(VLOOKUP(MAX(Sales),SalesInfo,2,FALSE),»m/dd/yyyy»)

Table

A22:B25

=PRODUCT(Price,Table1[@Tax Rate])

Types of names

There are several types of names that you can create and use.

Defined name    A name that represents a cell, range of cells, formula, or constant value. You can create your own defined name. Also, Excel for the web sometimes creates a defined name for you, such as when you set a print area.

Table name    A name for an Excel for the web table, which is a collection of data about a particular subject that is stored in records (rows) and fields (columns). Excel for the web creates a default Excel for the web table name of «Table1», «Table2», and so on, each time you insert an Excel for the web table, but you can change these names to make them more meaningful.

Creating and entering names

You create a name by using Create a name from selection. You can conveniently create names from existing row and column labels by using a selection of cells in the worksheet.

Note: By default, names use absolute cell references.

You can enter a name by:

  • Typing     Typing the name, for example, as an argument to a formula.

  • Using Formula AutoComplete    Use the Formula AutoComplete drop-down list, where valid names are automatically listed for you.

Using array formulas and array constants

Excel for the web doesn’t support creating array formulas. You can view the results of array formulas created in Excel desktop application, but you can’t edit or recalculate them. If you have the Excel desktop application, click Open in Excel to work with arrays.

The following array example calculates the total value of an array of stock prices and shares, without using a row of cells to calculate and display the individual values for each stock.

Array formula that produces a single result

When you enter the formula ={SUM(B2:D2*B3:D3)} as an array formula, it multiples the Shares and Price for each stock, and then adds the results of those calculations together.

To calculate multiple results    Some worksheet functions return arrays of values, or require an array of values as an argument. To calculate multiple results with an array formula, you must enter the array into a range of cells that has the same number of rows and columns as the array arguments.

For example, given a series of three sales figures (in column B) for a series of three months (in column A), the TREND function determines the straight-line values for the sales figures. To display all the results of the formula, it is entered into three cells in column C (C1:C3).

Array formula that produces multiple results

When you enter the formula =TREND(B1:B3,A1:A3) as an array formula, it produces three separate results (22196, 17079, and 11962), based on the three sales figures and the three months.

Using array constants

In an ordinary formula, you can enter a reference to a cell containing a value, or the value itself, also called a constant. Similarly, in an array formula you can enter a reference to an array, or enter the array of values contained within the cells, also called an array constant. Array formulas accept constants in the same way that non-array formulas do, but you must enter the array constants in a certain format.

Array constants can contain numbers, text, logical values such as TRUE or FALSE, or error values such as #N/A. Different types of values can be in the same array constant — for example, {1,3,4;TRUE,FALSE,TRUE}. Numbers in array constants can be in integer, decimal, or scientific format. Text must be enclosed in double quotation marks — for example, «Tuesday».

Array constants cannot contain cell references, columns or rows of unequal length, formulas, or the special characters $ (dollar sign), parentheses, or % (percent sign).

When you format array constants, make sure you:

  • Enclose them in braces ( { } ).

  • Separate values in different columns by using commas (,). For example, to represent the values 10, 20, 30, and 40, you enter {10,20,30,40}. This array constant is known as a 1-by-4 array and is equivalent to a 1-row-by-4-column reference.

  • Separate values in different rows by using semicolons (;). For example, to represent the values 10, 20, 30, and 40 in one row and 50, 60, 70, and 80 in the row immediately below, you enter a 2-by-4 array constant: {10,20,30,40;50,60,70,80}.

Самая популярная программа для работы с электронными таблицами «Microsoft Excel» упростила жизнь многим пользователям, позволив производить любые расчеты с помощью формул. Она способна автоматизировать даже самые сложные вычисления, но для этого нужно знать принципы работы с формулами. Мы подготовили самую подробную инструкцию по работе с Эксель. Не забудьте сохранить в закладки 😉

Содержание

  • Кому важно знать формулы Excel и где выучить основы.

  • Элементы, из которых состоит формула в Excel.

  • Основные виды.

  • Примеры работ, которые можно выполнять с формулами.

  • 22 формулы в Excel, которые облегчат жизнь.

  • Использование операторов.

  • Использование ссылок.

  • Использование имён.

  • Использование функций.

  • Операции с формулами.

  • Как в формуле указать постоянную ячейку.

  • Как поставить «плюс», «равно» без формулы.

  • Самые распространенные ошибки при составлении формул в редакторе Excel.

  • Коды ошибок при работе с формулами.

  • Отличие в версиях MS Excel.

  • Заключение.

Кому важно знать формулы Excel и где изучить основы

Excel — эффективный помощник бухгалтеров и финансистов, владельцев малого бизнеса и даже студентов. Менеджеры ведут базы клиентов, а маркетологи считают в таблицах медиапланы. Аналитики с помощью эксель формул обрабатывают большие объемы данных и строят гипотезы.

Эксель довольно сложная программа, но простые функции и базовые формулы можно освоить достаточно быстро по статьям и видео-урокам. Однако, если ваша профессиональная деятельность подразумевает работу с большим объемом данных и требует глубокого изучения возможностей Excel — стоит пройти специальные курсы, например тут или тут.

Элементы, из которых состоит формула в Excel

Формулы эксель: основные виды

Формулы в Excel бывают простыми, сложными и комбинированными. В таблицах их можно писать как самостоятельно, так и с помощью интегрированных программных функций.

Простые

Позволяют совершить одно простое действие: сложить, вычесть, разделить или умножить. Самой простой является формула=СУММ.

Например:

=СУММ (A1; B1) — это сумма значений двух соседних ячеек.

=СУММ (С1; М1; Р1) — сумма конкретных ячеек.

=СУММ (В1: В10) — сумма значений в указанном диапазоне.

Сложные

Это многосоставные формулы для более продвинутых пользователей. В данную категорию входят ЕСЛИ, СУММЕСЛИ, СУММЕСЛИМН. О них подробно расскажем ниже.

Комбинированные

Эксель позволяет комбинировать несколько функций: сложение + умножение, сравнение + умножение. Это удобно, когда, например, нужно вычислить сумму двух чисел, и, если результат будет больше 100, его нужно умножить на 3, а если меньше — на 6.

Выглядит формула так ↓

=ЕСЛИ (СУММ (A1; B1)<100; СУММ (A1; B1)*3;(СУММ (A1; B1)*6))

Встроенные

Новичкам удобнее пользоваться готовыми, встроенными в программу формулами вместо того, чтобы писать их вручную. Чтобы найти нужную формулу:

  • кликните по нужной ячейке таблицы;

  • нажмите одновременно Shift + F3;

  • выберите из предложенного перечня нужную формулу;

  • в окошко «Аргументы функций» внесите свои данные.

Примеры работ, которые можно выполнять с формулами

Разберем основные действия, которые можно совершить, используя формулы в таблицах Эксель и рассмотрим полезные «фишки» для упрощения работы.

Поиск перечня доступных функций

Перейдите в закладку «Формулы» / «Вставить функцию». Или сразу нажмите на кнопочку «Fx».

Выберите в категории «Полный алфавитный перечень», после чего в списке отобразятся все доступные эксель-формулы.

Выберите любую формулу и прочитайте ее описание. А если хотите изучить ее более детально, нажмите на «Справку» ниже.

Вставка функции в таблицу

Вы можете сами писать функции в Excel вручную после «=», или использовать меню, описанное выше. Например, выбрав СУММ, появится окошко, где нужно ввести аргументы (кликнуть по клеткам, значения которых собираетесь складывать):

После этого в таблице появится формула в стандартном виде. Ее можно редактировать при необходимости.

Использование математических операций

Начинайте с «=» в ячейке и применяйте для вычислений любые стандартные знаки «*», «/», «^» и т.д. Можно написать номер ячейки самостоятельно или кликнуть по ней левой кнопкой мышки. Например: =В2*М2. После нажатия Enter появится произведение двух ячеек.

Растягивание функций и обозначение константы

Введите функцию =В2*C2, получите результат, а затем зажмите правый нижний уголок ячейки и протащите вниз. Формула растянется на весь выбранный диапазон и автоматически посчитает значения для всех строк от B3*C3 до B13*C13.

Чтобы обозначить константу (зафиксировать конкретную ячейку/строку/столбец), нужно поставить «$» перед буквой и цифрой ячейки.

Например: =В2*$С$2. Когда вы растяните функцию, константа или $С$2 так и останется неизменяемой, а вот первый аргумент будет меняться.

Подсказка:

  • $С$2 — не меняются столбец и строка.

  • B$2 — не меняется строка 2.

  • $B2 — константой остается только столбец В.

22 формулы в Эксель, которые облегчат жизнь

Собрали самые полезные формулы, которые наверняка пригодятся в работе.

МАКС

=МАКС (число1; [число2];…)

Показывает наибольшее число в выбранном диапазоне или перечне ячейках.

МИН

=МИН (число1; [число2];…)

Показывает самое маленькое число в выбранном диапазоне или перечне ячеек.

СРЗНАЧ

=СРЗНАЧ (число1; [число2];…)

Считает среднее арифметическое всех чисел в диапазоне или в выбранных ячейках. Все значения суммируются, а сумма делится на их количество.

СУММ

=СУММ (число1; [число2];…)

Одна из наиболее популярных и часто используемых функций в таблицах Эксель. Считает сумму чисел всех указанных ячеек или диапазона.

ЕСЛИ

=ЕСЛИ (лог_выражение; значение_если_истина; [значение_если_ложь])

Сложная формула, которая позволяет сравнивать данные.

Например:

=ЕСЛИ (В1>10;”больше 10″;»меньше или равно 10″)

В1 — ячейка с данными;

>10 — логическое выражение;

больше 10 — правда;

меньше или равно 10 — ложное значение (если его не указывать, появится слово ЛОЖЬ).

СУММЕСЛИ

=СУММЕСЛИ (диапазон; условие; [диапазон_суммирования]).

Формула суммирует числа только, если они отвечают критерию.

Например:

=СУММЕСЛИ (С2: С6;»>20″)

С2: С6 — диапазон ячеек;

>20 —значит, что числа меньше 20 не будут складываться.

СУММЕСЛИМН

=СУММЕСЛИМН (диапазон_суммирования; диапазон_условия1; условие1; [диапазон_условия2; условие2];…)

Суммирование с несколькими условиями. Указываются диапазоны и условия, которым должны отвечать ячейки.

Например:

=СУММЕСЛИМН (D2: D6; C2: C6;”сувениры”; B2: B6;”ООО ХУ»)

D2: D6 — диапазон, где суммируются числа;

C2: C6 — диапазон ячеек для категории; сувениры — обязательное условие 1, то есть числа другой категории не учитываются;

B2: B6 — дополнительный диапазон;

ООО XY — условие 2, то есть числа другой компании не учитываются.

Дополнительных диапазонов и условий может быть до 127 штук.

СЧЕТ

=СЧЁТ (значение1; [значение2];…)Формула считает количество выбранных ячеек с числами в заданном диапазоне. Ячейки с датами тоже учитываются.

=СЧЁТ (значение1; [значение2];…)

Формула считает количество выбранных ячеек с числами в заданном диапазоне. Ячейки с датами тоже учитываются.

СЧЕТЕСЛИ и СЧЕТЕСЛИМН

=СЧЕТЕСЛИ (диапазон; критерий)

Функция определяет количество заполненных клеточек, которые подходят под конкретные условия в рамках указанного диапазона.

Например:

=СЧЁТЕСЛИМН (диапазон_условия1; условие1 [диапазон_условия2; условие2];…)

Эта формула позволяет использовать одновременно несколько критериев.

ЕСЛИОШИБКА

=ЕСЛИОШИБКА (значение; значение_если_ошибка)

Функция проверяет ошибочность значения или вычисления, а если ошибка отсутствует, возвращает его.

ДНИ

=ДНИ (конечная дата; начальная дата)

Функция показывает количество дней между двумя датами. В формуле указывают сначала конечную дату, а затем начальную.

КОРРЕЛ

=КОРРЕЛ (диапазон1; диапазон2)

Определяет статистическую взаимосвязь между разными данными: курсами валют, расходами и прибылью и т.д. Мах значение — +1, min — −1.

ВПР

=ВПР (искомое_значение; таблица; номер_столбца;[интервальный_просмотр])

Находит данные в таблице и диапазоне.

Например:

=ВПР (В1; С1: С26;2)

В1 — значение, которое ищем.

С1: Е26— диапазон, в котором ведется поиск.

2 — номер столбца для поиска.

ЛЕВСИМВ

=ЛЕВСИМВ (текст;[число_знаков])

Позволяет выделить нужное количество символов. Например, она поможет определить, поместится ли строка в лимитированное количество знаков или нет.

ПСТР

=ПСТР (текст; начальная_позиция; число_знаков)

Помогает достать определенное число знаков с текста. Например, можно убрать лишние слова в ячейках.

ПРОПИСН

=ПРОПИСН (текст)

Простая функция, которая делает все литеры в заданной строке прописными.

СТРОЧН

Функция, обратная предыдущей. Она делает все литеры строчными.

ПОИСКПОЗ

=ПОИСКПОЗ (искомое_значение; просматриваемый_массив; тип_сопоставления)

Дает возможность найти нужный элемент в заданном блоке ячеек и указывает его позицию.

ДЛСТР

=ДЛСТР (текст)

Данная функция определяет длину заданной строки. Пример использования — определение оптимальной длины описания статьи.

СЦЕПИТЬ

=СЦЕПИТЬ (текст1; текст2; текст3)

Позволяет сделать несколько строчек из одной и записать до 255 элементов (8192 символа).

ПРОПНАЧ

=ПРОПНАЧ (текст)

Позволяет поменять местами прописные и строчные символы.

ПЕЧСИМВ

=ПЕЧСИМВ (текст)

Можно убрать все невидимые знаки из текста.

Использование операторов

Операторы в Excel указывают, какие конкретно операции нужно выполнить над элементами формулы. В вычислениях всегда соблюдается математический порядок:

  • скобки;

  • экспоненты;

  • умножение и деление;

  • сложение и вычитание.

Арифметические

Операторы сравнения

Оператор объединения текста

Операторы ссылок

Использование ссылок

Начинающие пользователи обычно работают только с простыми ссылками, но мы расскажем обо всех форматах, даже продвинутых.

Простые ссылки A1

Они используются чаще всего. Буква обозначает столбец, цифра — строку.

Примеры:

  • диапазон ячеек в столбце С с 1 по 23 строку — «С1: С23»;

  • диапазон ячеек в строке 6 с B до Е– «B6: Е6»;

  • все ячейки в строке 11 — «11:11»;

  • все ячейки в столбцах от А до М — «А: М».

Ссылки на другой лист

Если необходимы данные с других листов, используется формула: =СУММ (Лист2! A5: C5)

Выглядит это так:

Абсолютные и относительные ссылки

Относительные ссылки

Рассмотрим, как они работают на примере: Напишем формулу для расчета суммы первой колонки. =СУММ (B4: B9)

Нажимаем на Ctrl+C. Чтобы перенести формулу на соседнюю клетку, переходим туда и жмем на Ctrl+V. Или можно просто протянуть ячейку с формулой, как мы описывали выше.

Индекс таблицы изменится автоматически и новые формулы будут выглядеть так:

Абсолютные ссылки

Чтобы при переносе формул ссылки сохранялись неизменными, требуются абсолютные адреса. Их пишут в формате «$B$2».

Например, есть поставить знак доллара в предыдущую формулу, мы получим: =СУММ ($B$4:$B$9)

Как видите, никаких изменений не произошло.

Смешанные ссылки

Они используются, когда требуется зафиксировать только столбец или строку:

  • $А1– сохраняются столбцы;

  • А$1 — сохраняются строки.

Смешанные ссылки удобны, когда приходится работать с одной постоянной строкой данных и менять значения в столбцах. Или, когда нужно рассчитать результат в ячейках, не расположенных вдоль линии.

Трёхмерные ссылки

Это те, где указывается диапазон листов.

Формула выглядит примерно так: =СУММ (Лист1: Лист5! A6)

То есть будут суммироваться все ячейки А6 на всех листах с первого по пятый.

Ссылки формата R1C1

Номер здесь задается как по строкам, так и по столбцам.

Например:

  • R9C9 — абсолютная ссылка на клетку, которая расположена на девятой строке девятого столбца;

  • R[-2] — ссылка на строчку, расположенную выше на 2 строки;

  • R[-3]C — ссылка на клетку, которая расположена на 3 ячейки выше;

  • R[4]C[4] — ссылка на ячейку, которая распложена на 4 клетки правее и 4 строки ниже.

Использование имён

Функционал Excel позволяет давать собственные уникальные имена ячейкам, таблицам, константам, выражениям, даже диапазонам ячеек. Эти имена можно использовать для совершения любых арифметических действий, расчета налогов, процентов по кредиту, составления сметы и табелей, расчётов зарплаты, скидок, рабочего стажа и т.д.

Все, что нужно сделать — заранее дать имя ячейкам, с которыми планируете работать. В противном случае программа Эксель ничего не будет о них знать.

Как присвоить имя:

  • Выделите нужную ячейку/столбец.

  • Правой кнопкой мышки вызовите меню и перейдите в закладку «Присвоить имя».

  • Напишите желаемое имя, которое должно быть уникальным и не повторяться в одной книге.

  • Сохраните, нажав Ок.

Использование функций

Чтобы вставить необходимую функцию в эксель-таблицах, можно использовать три способа: через панель инструментов, с помощью опции Вставки и вручную. Рассмотрим подробно каждый способ.

Ручной ввод

Этот способ подойдет тем, кто хорошо разбирается в теме и умеет создавать формулы прямо в строке. Для начинающих пользователей и новичков такой вариант покажется слишком сложным, поскольку надо все делать руками.

Панель инструментов

Это более упрощенный способ. Достаточно перейти в закладку «Формулы», выбрать подходящую библиотеку — Логические, Финансовые, Текстовые и др. (в закладке «Последние» будут наиболее востребованные формулы). Остается только выбрать из перечня нужную функцию и расставить аргументы.

Мастер подстановки

Кликните по любой ячейке в таблице. Нажмите на иконку «Fx», после чего откроется «Вставка функций».

Выберите из перечня нужную категорию формул, а затем кликните по функции, которую хотите применить и задайте необходимые для расчетов аргументы.

Вставка функции в формулу с помощью мастера

Рассмотрим эту опцию на примере:

  • Вызовите окошко «Вставка функции», как описывалось выше.

  • В перечне доступных функций выберите «Если».

Теперь составим выражение, чтобы проверить, будет ли сумма трех ячеек больше 10. При этом Правда — «Больше 10», а Ложь — «Меньше 10».

=ЕСЛИ (СУММ (B3: D3)>10;”Больше 10″;»Меньше 10″)

Программа посчитала, что сумма ячеек меньше 10 и выдала нам результат:

Чтобы получить значение в следующих ячейках столбца, нужно растянуть формулу (за правый нижний уголок). Получится следующее:

Мы использовали относительные ссылки, поэтому программа пересчитала выражение для всех строк корректно. Если бы нам нужно было зафиксировать адреса в аргументах, тогда мы бы применяли абсолютные ссылки, о которых писали выше.

Редактирование функций с помощью мастера

Чтобы отредактировать функцию, можно использовать два способа:

  • Строка формул. Для этого требуется перейти в специальное поле и вручную ввести необходимые изменения.

  • Специальный мастер. Нажмите на иконку «Fx» и в появившемся окошке измените нужные вам аргументы. И тут же, кстати, сможете узнать результат после редактирования.

Операции с формулами

С формулами можно совершать много операций — копировать, вставлять, перемещать. Как это делать правильно, расскажем ниже.

Копирование/вставка формулы

Чтобы скопировать формулу из одной ячейки в другую, не нужно изобретать велосипед — просто нажмите старую-добрую комбинацию (копировать), а затем кликните по новой ячейке и нажмите (вставить).

Отмена операций

Здесь вам в помощь стандартная кнопка «Отменить» на панели инструментов. Нажмите на стрелочку возле нее и выберите из контекстного меню те действия. которые хотите отменить.

Повторение действий

Если вы выполнили команду «Отменить», программа сразу активизирует функцию «Вернуть» (возле стрелочки отмены на панели). То есть нажав на нее, вы повторите только что отмененную вами операцию.

Стандартное перетаскивание

Выделенные ячейки переносятся с помощью указателя мышки в другое место листа. Делается это так:

  • Выделите фрагмент ячеек, которые нужно переместить.

  • Поместите указатель мыши над одну из границ фрагмента.

  • Когда указатель мыши станет крестиком с 4-мя стрелками, можете перетаскивать фрагмент в другое место.

Копирование путем перетаскивания

Если вам нужно скопировать выделенный массив ячеек в другое место рабочего листа с сохранением данных, делайте так:

  • Выделите диапазон ячеек, которые нужно скопировать.

  • Зажмите клавишу и поместите указатель мыши на границу выбранного диапазона.

  • Он станет похожим на крестик +. Это говорит о том, что будет выполняться копирование, а не перетаскивание.

  • Перетащите фрагмент в нужное место и отпустите мышку. Excel задаст вопрос — хотите вы заменить содержимое ячеек. Выберите «Отмена» или ОК.

Особенности вставки при перетаскивании

Если содержимое ячеек перемещается в другое место, оно полностью замещает собой существовавшие ранее записи. Если вы не хотите замещать прежние данные, удерживайте клавишу в процессе перетаскивания и копирования.

Автозаполнение формулами

Если необходимо скопировать одну формулу в массив соседних ячеек и выполнить массовые вычисления, используется функция автозаполнения.

Чтобы выполнить автозаполнение формулами, нужно вызвать специальный маркер заполнения. Для этого наведите курсор на нижний правый угол, чтобы появился черный крестик. Это и есть маркер заполнения. Его нужно зажать левой кнопкой мыши и протянуть вдоль всех ячеек, в которых вы хотите получить результат вычислений.

Как в формуле указать постоянную ячейку

Когда вам нужно протянуть формулу таким образом, чтобы ссылка на ячейку оставалась неизменной, делайте следующее:

  • Кликните на клетку, где находится формула.

  • Наведите курсор в нужную вам ячейку и нажмите F4.

  • В формуле аргумент с номером ячейки станет выглядеть так: $A$1 (абсолютная ссылка).

  • Когда вы протяните формулу, ссылка на ячейку $A$1 останется фиксированной и не будет меняться.

Как поставить «плюс», «равно» без формулы

Когда нужно указать отрицательное значение, поставить = или написать температуру воздуха, например, +22 °С, делайте так:

  • Кликаете правой кнопкой по ячейке и выбираете «Формат ячеек».

  • Отмечаете «Текстовый».

Теперь можно ставить = или +, а затем нужное число.

Самые распространенные ошибки при составлении формул в редакторе Excel

Новички, которые работают в редакторе Эксель совсем недавно, часто совершают элементарные ошибки. Поэтому рекомендуем ознакомиться с перечнем наиболее распространенных, чтобы больше не ошибаться.

  • Слишком много вложений в выражении. Лимит 64 штуки.

  • Пути к внешним книгам указаны не полностью. Проверяйте адреса более тщательно.

  • Неверно расставленные скобочки. В редакторе они обозначены разными цветами для удобства.

  • Указывая имена книг и листов, пользователи забывают брать их в кавычки.

  • Числа в неверном формате. Например, символ $ в Эксель — это не знак доллара, а формат абсолютных ссылок.

  • Неправильно введенные диапазоны ячеек. Не забывайте ставить «:».

Коды ошибок при работе с формулами

Если вы сделаете ошибку в записи формулы, программа укажет на нее специальным кодом. Вот самые распространенные:

Отличие в версиях MS Excel

Всё, что написано в этом гайде, касается более современных версий программы 2007, 2010, 2013 и 2016 года. Устаревший Эксель заметно уступает в функционале и количестве доступных инструментов. Например, функция СЦЕП появилась только в 2016 году.

Во всем остальном старые и новые версии Excel не отличаются — операции и расчеты проводятся по одинаковым алгоритмам.

Заключение

Мы написали этот гайд, чтобы вам было легче освоить Excel. Доступным языком рассказали о формулах и о тех операциях, которые можно с ними проводить.

Надеемся, наша шпаргалка станет полезной для вас. Не забудьте сохранить ее в закладки и поделиться с коллегами.

Формулы Excel используют, когда данных очень много. Например, чтобы посчитать сумму нескольких чисел быстрее, чем на калькуляторе. Преимуществ много, поэтому работодатели часто указывают эту программу в требованиях. В конце марта 2022 года 64 225 вакансий на хедхантере содержали формулировки вроде «уверенный пользователь Excel», «работа с формулами в Excel».

Кому важно знать Excel и где выучить основы

Excel нужен бухгалтерам, чтобы вести учет в таблицах. Экономистам, чтобы делать перерасчет цен, анализировать показатели компании. Менеджерам — вести базу клиентов. Аналитикам — строить и проверять гипотезы.

Программу можно освоить самостоятельно, например по статьям в интернете. Но это поможет понять только основные формулы. Если нужны глубокие знания — как строить сложные прогнозы, собирать калькулятор юнит-экономики, — пройдите курсы.

Аналитик данных: новая работа через 5 месяцев

Получится, даже если у вас нет опыта в IT

Узнать больше

На онлайн-курсе Skypro «Аналитик данных» научитесь владеть базовыми формулами Excel, работать с нестандартными данными, статистикой. Кроме Excel вы изучите Metabase, SQL, Power BI, язык программирования Python. Программа подойдет даже тем, у кого совсем нет опыта в анализе и кто не любит математику. Вас ждут живые вебинары, мастер-классы, домашки с разбором, помощь наставников.

Курс «Аналитик данных»

Урок из курса «Аналитик данных» в Skypro

Из чего состоит формула в Excel

Основные знаки:

= с него начинают любую формулу;

( ) заключают формулу и ее части;

; применяют, чтобы указать очередность ячеек или действий;

: ставят, чтобы обозначить диапазон ячеек, а не выбирать всё подряд вручную.

В Excel работают с простыми математическими действиями:

сложением +

вычитанием —

умножением *

делением /

возведением в степень ^

Еще используют символы сравнения:

равенство =

меньше <

больше >

меньше либо равно <=

больше либо равно >=

не равно <>

Основные виды

Все формулы в Excel делятся на простые, сложные и комбинированные. Их можно написать самостоятельно или воспользоваться встроенными.

Простые

Применяют, когда нужно совершить одно простое действие, например сложить или умножить.

СУММ. Складывает несколько чисел. Сумму можно посчитать для нескольких ячеек или целого диапазона.

=СУММ(А1;В1) — для соседних ячеек;

=СУММ(А1;С1;H1) — для определенных ячеек;

=СУММ(А1:Е1) — для диапазона.

Как найти сумму всех ячеек в excel

Сумма всех чисел в ячейках от А1 до Е1

ПРОИЗВЕД. Умножает числа в соседних, выбранных вручную ячейках или диапазоне.

=ПРОИЗВЕД(А1;В1)

=ПРОИЗВЕД(А1;С1;H1)

=ПРОИЗВЕД(А1:Е1)

Как найти произведение ячеек в Excel

Произведение всех чисел в ячейках от А1 до Е1

ОКРУГЛ. Округляет дробное число до целого в большую или меньшую сторону. Укажите ячейку с нужным числом, в качестве второго значения — 0.

=ОКРУГЛВВЕРХ(А1;0) — к большему целому числу;

=ОКРУГЛВНИЗ(А1;0) — к меньшему.

Как округлить до целого числа в Excel

Округление в меньшую сторону

ВПР. Находит данные в таблице или определенном диапазоне.

=ВПР(С1;А1:В6;2)
  • С1 — ячейка, в которую выписывают известные данные. В примере это код цвета.
  • А1 по В6 — диапазон ячеек. Ищем название цвета по коду.
  • 2 — порядковый номер столбца для поиска. В нём указаны названия цвета.

Как создать функцию ВПР в Excel

Формула вычислила, какой цвет соответствует коду

СЦЕПИТЬ. Объединяет данные диапазона ячеек, например текст или цифры. Между содержимым ячеек можно добавить пробел, если объединяете слова в предложения.

=СЦЕПИТЬ(А1;В1;С1) — текст без пробелов;

=СЦЕПИТЬ(А1;» «;В1;» «С1) — с пробелами.

Как сцепить ячейки в Excel

Формула объединила три слова в одно предложение

КОРЕНЬ. Вычисляет квадратный корень числа в ячейке.

=КОРЕНЬ(А1)

Как извлечь корень в Excel

Квадратный корень числа в ячейке А1

ПРОПИСН. Преобразует текст в верхний регистр, то есть делает буквы заглавными.

=ПРОПИСН(А1:С1)

Как изменить регистр текста в Excel

Формула преобразовала строчные буквы в прописные

СТРОЧН. Переводит текст в нижний регистр, то есть делает из больших букв маленькие.

=СТРОЧН(А2)

СЧЕТ. Считает количество ячеек с числами.

=СЧЕТ(А1:В5)

Как сделать подсчет в Excel

Формула вычислила, что в диапазоне А1:В5 четыре ячейки с числами

СЖПРОБЕЛЫ. Убирает лишние пробелы. Например, когда переносите текст из другого документа и сомневаетесь, правильно ли там стоят пробелы.

=СЖПРОБЕЛЫ(А1)

Как удалить двойные пробелы в Excel

Формула удалила двойные и тройные пробелы

Сложные

ПСТР. Выделяет определенное количество знаков в тексте, например одно слово.

=ПСТР(А1;9;5)
  1. Введите =ПСТР.
  2. Кликните на ячейку, где нужно выделить знаки.
  3. Укажите номер начального знака: например, с какого символа начинается слово. Пробелы тоже считайте.
  4. Поставьте количество знаков, которые нужно выделить из текста. Например, если слово состоит из пяти букв, впишите цифру 5.

Как использовать функцию ПСТР в Excel

В ячейке А1 формула выделила 5 символов, начиная с 9-го

ЕСЛИ. Анализирует данные по условию. Например, когда нужно сравнить одно с другим.

=ЕСЛИ(A1>25;"больше 25";"меньше или равно 25")

В формуле указали:

  • А1 — ячейку с данными;
  • >25 — логическое выражение;
  • больше 25, меньше или равно 25 — истинное и ложное значения.

Первый результат возвращается, если сравнение истинно. Второй — если ложно.

Как использовать функцию ЕСЛИ в Excel

Число в А1 больше 25. Поэтому формула показывает первый результат — больше 25.

СУММЕСЛИ. Складывает числа, которые соответствуют критерию. Обычно критерий — числовой промежуток или предел.

=СУММЕСЛИ(В2:В5;">10")

В формуле указали:

  • В2:В5 — диапазон ячеек;
  • >10 — критерий, то есть числа меньше 10 не будут суммироваться.

Как использовать функцию СУММЕСЛИ в Excel

Число 8 меньше указанного в условии, то есть 10. Поэтому оно не вошло в сумму.

СУММЕСЛИМН. Складывает числа, когда условий несколько. В формуле указывают диапазоны — ячейки, которые нужно учитывать. И условия — содержание подходящих ячеек. Например:

=СУММЕСЛИМН(D2:D6;C2:C6;"сувениры";B2:B6;"ООО ХY")
  • D2:D6 — диапазон, из которого суммируем числа;
  • C2:C6 — диапазон ячеек для категории;
  • сувениры — условие, то есть числа другой категории учитываться не будут;
  • B2:B6 — диапазон ячеек для компании;
  • ООО XY — условие, то есть числа другой компании учитываться не будут.

Как использовать функцию СУММЕСЛИМН в Excel

Под условия подошли только ячейки D3 и D6: их сумму и вывела формула

Комбинированные

В Excel можно комбинировать несколько функций: сложение, умножение, сравнение и другие. Например, вам нужно найти сумму двух чисел. Если значение больше 65, сумму нужно умножить на 1,5. Если меньше — на 2.

=ЕСЛИ(СУММ(A1;B1)<65;СУММ(A1;B1)*1,5;(СУММ(A1;B1)*2))

То есть если сумма двух чисел в А1 и В1 окажется меньше 65, программа посчитает первое условие — СУММ(А1;В1)*1,5. Больше 65 — Excel задействует второе условие — СУММ(А1;В1)*2.

Как использовать несколько функций в Excel

Сумма в А1 и В1 больше 65, поэтому формула посчитала по второму условию: умножила на 2

Встроенные

Используйте их, если удобнее пользоваться готовыми формулами, а не вписывать вручную.

  1. Поместите курсор в нужную ячейку.
  2. Откройте диалоговое окно мастера: нажмите клавиши Shift + F3. Откроется список функций.
  3. Выберите нужную формулу. Нажмите на нее, затем на «ОК». Откроется окно «Аргументы функций».
  4. Внесите нужные данные. Например, числа, которые нужно сложить.

Как вставить формулу в Excel

Ищите формулу по алфавиту или тематике, выбирайте любую из тех, что использовали недавно

Как скопировать

Если для разных ячеек нужны однотипные действия, например сложить числа не в одной, а в нескольких строках, скопируйте формулу.

  1. Впишите функцию в ячейку и кликните на нее.
  2. Наведите курсор на правый нижний угол — курсор примет форму креста.
  3. Нажмите левую кнопку мыши, удерживайте ее и тяните до нужной ячейки.
  4. Отпустите кнопку. Появится итог.

Как скопировать функцию Excel

Посчитали сумму ячеек в трех строках

Как обозначить постоянную ячейку

Это нужно, чтобы, когда вы протягивали формулу, ссылка на ячейку не смещалась.

  1. Нажмите на ячейку с формулой.
  2. Поместите курсор в нужную ячейку и нажмите F4.
  3. В формуле фрагмент с описанием ячейки приобретет вид $A$1. Если вы протянете формулу, то ссылка на ячейку $A$1 останется на месте.

Как поставить «плюс», «равно» без формулы

Когда нужна не формула, а данные, например +10 °С:

  1. Кликните правой кнопкой по ячейке.
  2. Выберите «Формат ячеек».
  3. Отметьте «Текстовый», нажмите «ОК».
  4. Поставьте = или +, затем нужное число.
  5. Нажмите Enter.

Главное о формулах в Excel

  • Формула состоит из математических знаков. Чтобы ее вписать, используют символы = ( ) ; : .
  • С помощью простых формул числа складывают, умножают, округляют, извлекают из них квадратный корень. Чтобы отредактировать текст, используют формулы поиска, изменения регистра, удаления лишних пробелов.
  • Сложные и комбинированные формулы помогают делать объемные вычисления, когда нужно соблюдать несколько условий.

Formulas and functions are the bread and butter of Excel. They drive almost everything interesting and useful you will ever do in a spreadsheet. This article introduces the basic concepts you need to know to be proficient with formulas in Excel. More examples here.

What is a formula?

A formula in Excel is an expression that returns a specific result. For example:

=1+2 // returns 3

Basic formula example - 1 + 3 = 3

=6/3 // returns 2

Basic formula example - 6 / 3 = 2

Note: all formulas in Excel must begin with an equals sign (=).

Cell references

In the examples above, values are «hardcoded». That means results won’t change unless you edit the formula again and change a value manually. Generally, this is considered bad form, because it hides information and makes it harder to maintain a spreadsheet.

Instead, use cell references so values can be changed at any time. In the screen below, C1 contains the following formula:

=A1+A2+A3 // returns 9

Formula with cell references

Notice because we are using cell references for A1, A2, and A3, these values can be changed at any time and C1 will still show an accurate result.

All formulas return a result

All formulas in Excel return a result, even when the result is an error. Below a formula is used to calculate percent change. The formula returns a correct result in D2 and D3, but returns a #DIV/0! error in D4, because B4 is empty:

Formula result can be an error

There are different ways of handling errors. In this case, you could provide the missing value in B4, or «catch» the error with the IFERROR function and display a more friendly message (or nothing at all).

Copy and paste formulas

The beauty of cell references is that they automatically update when a formula is copied to a new location. This means you don’t need to enter the same basic formula again and again. In the screen below, the formula in E1 has been copied to the clipboard with Control + C:

Formula in E1 copied to clipboard

Below: formula pasted to cell E2 with Control + V. Notice cell references have changed:

Formula in E1 pasted to E2

Same formula pasted to E3. Cell addresses are updated again:

Formula in E1 pasted to E3

Relative and absolute references

The cell references above are called relative references. This means the reference is relative to the cell it lives in.  The formula in E1 above is:

=B1+C1+D1 // formula in E1

Literally, this means «cell 3 columns left «+ «cell 2 columns left» + «cell 1 column left». That’s why, when the formula is copied down to cell E2, it continues to work in the same way.

Relative references are extremely useful, but there are times when you don’t want a cell reference to change. A cell reference that won’t change when copied is called an absolute reference. To make a reference absolute, use the dollar symbol ($):

=A1 // relative reference
=$A$1 // absolute reference

For example, in the screen below, we want to multiply each value in column D by 10, which is entered in A1. By using an absolute reference for A1, we «lock» that reference so it won’t change when the formula is copied to E2 and E3:

Absolute reference example

Here are the final formulas in E1, E2, and E3:

=D1*$A$1 // formula in E1
=D2*$A$1 // formula in E2
=D3*$A$1 // formula in E3

Notice the reference to D1 updates when the formula is copied, but the reference to A1 never changes. Now we can easily change the value in A1, and all three formulas recalculate. Below the value in A1 has changed from 10 to 12:

Absolute reference example after value in A1 is changed

This simple example also shows why it doesn’t make sense to hardcode values into a formula. By storing the value in A1 in one place, and referring to A1 with an absolute reference, the value can be changed at any time and all associated formulas will update instantly.

Tip: you can toggle between relative and absolute syntax with the F4 key.

How to enter a formula

To enter a formula:

  1. Select a cell
  2. Enter an equals sign (=)
  3. Type the formula, and press enter.

Instead of typing cell references, you can point and click, as seen below. Note references are color-coded:

Entering a formula with point and click references

All formulas in Excel must begin with an equals sign (=). No equals sign, no formula:

Forgot to enter an equals sign means no formula, just text

How to change a formula

To edit a formula, you have 3 options:

  1. Select the cell, edit in the formula bar
  2. Double-click the cell, edit directly
  3. Select the cell, press F2, edit directly

No matter which option you use, press Enter to confirm changes when done. If you want to cancel, and leave the formula unchanged, click the Escape key.

Video: 20 tips for entering formulas

What is a function?

Working in Excel, you will hear the words «formula» and «function» used frequently, sometimes interchangeably. They are closely related, but not exactly the same. Technically, a formula is any expression that begins with an equals sign (=).

A function, on the other hand, is a formula with a special name and purpose. In most cases, functions have names that reflect their intended use. For example, you probably know the SUM function already, which returns the sum of given references:

=SUM(1,2,3) // returns 6
=SUM(A1:A3) // returns A1+A2+A3

The AVERAGE function, as you would expect, returns the average of given references:

=AVERAGE(1,2,3) // returns 2

And the MIN and MAX functions return minimum and maximum values, respectively:

=MIN(1,2,3) // returns 1
=MAX(1,2,3) // returns 3

Excel contains hundreds of specific functions. To get started, see 101 Key Excel functions.

Function arguments

Most functions require inputs to return a result. These inputs are called «arguments». A function’s arguments appear after the function name, inside parentheses, separated by commas.  All functions require a matching opening and closing parentheses (). The pattern looks like this:

=FUNCTIONNAME(argument1,argument2,argument3)

For example, the COUNTIF function counts cells that meet criteria, and takes two arguments, range and criteria:

=COUNTIF(range,criteria) // two arguments

In the screen below, range is A1:A5 and criteria is «red». The formula in C1 is:

=COUNTIF(A1:A5,"red") // returns 2

 COUNTIF requires two arguments, range and criteria

Video: How to use the COUNTIF function

Not all arguments are required. Arguments shown in square brackets are optional. For example, the YEARFRAC function returns fractional number of years between a start date and end date and takes 3 arguments:

=YEARFRAC(start_date,end_date,[basis])

Start_date and end_date are required arguments, basis is an optional argument. See below for an example of how to use YEARFRAC to calculate current age based on birthdate.

How to enter a function

If you know the name of the function, just start typing. Here are the steps:

1. Enter equals sign (=) and start typing. Excel will make a list of matching functions based as you type:

As you type, Excel will show matching functions

When you see the function you want in the list, use the arrow keys to select (or just keep typing).

2. Type the Tab key to accept a function. Excel will complete the function:

Press Tab to enter selected function

3. Fill in required arguments:

Enter required arguments

4. Press Enter to confirm formula:

Press Enter to confirm and enter the function

Combining functions (nesting)

Many Excel formulas use more than one function, and functions can be «nested» inside each other. For example, below we have a birthdate in B1 and we want to calculate current age in B2:

Need a formula to calculate current age in B2

The YEARFRAC function will calculate years with a start date and end date:

YEARFRAC will calculate years with a start date and end date

We can use B1 for start date, then use the TODAY function to supply the end date:

B1 for start date, the TODAY function to supply end date

When we press Enter to confirm, we get current age based on today’s date:

=YEARFRAC(B1,TODAY())

YEARFRAC and TODAY functions to calculate current age

Notice we are using the TODAY function to feed an end date to the YEARFRAC function. In other words, the TODAY function can be nested inside the YEARFRAC function to provide the end date argument. We can take the formula one step further and use the INT function to chop off the decimal value:

=INT(YEARFRAC(B1,TODAY()))

YEARFRAC and TODAY inside INT

Here, the original YEARFRAC formula returns 20.4 to the INT function, and the INT function returns a final result of 20.

Notes:

  1. The current date in images above is February 22, 2019.
  2. Nested IF functions are a classic example of nesting functions. 
  3. The TODAY function is a rare Excel function with no required arguments.

Key takeaway: The output of any formula or function can be fed directly into another formula or function. 

Math Operators

The table below shows the standard math operators available in Excel:

Symbol Operation Example
+ Addition =2+3=5
Subtraction =9-2=7
* Multiplication =6*7=42
/ Division =9/3=3
^ Exponentiation =4^2=16
() Parentheses =(2+4)/3=2

Logical operators

Logical operators provide support for comparisons such as «greater than», «less than», etc. The logical operators available in Excel are shown in the table below:

Operator Meaning Example
= Equal to =A1=10
<> Not equal to =A1<>10
> Greater than =A1>100
< Less than =A1<100
>= Greater than or equal to =A1>=75
<= Less than or equal to =A1<=0

Video: How to build logical formulas

Order of operations

When solving a formula, Excel follows a sequence called «order of operations». First, any expressions in parentheses are evaluated. Next Excel will solve for any exponents. After exponents, Excel will perform multiplication and division, then addition and subtraction. If the formula involves concatenation, this will happen after standard math operations. Finally, Excel will evaluate logical operators, if present.

  1. Parentheses
  2. Exponents
  3. Multiplication and Division
  4. Addition and Subtraction
  5. Concatenation
  6. Logical operators

Tip: you can use the Evaluate feature to watch Excel solve formulas step-by-step.

Convert formulas to values

Sometimes you want to get rid of formulas, and leave only values in their place. The easiest way to do this in Excel is to copy the formula, then paste, using Paste Special > Values. This overwrites the formulas with the values they return. You can use a keyboard shortcut for pasting values, or use the Paste menu on the Home tab on the ribbon.

Video: Paste Special Shortcuts

What’s next?

Below are guides to help you learn more about Excel’s formulas and functions. We also offer online video training.

  • 29 tips for working with formulas and functions (video version here)
  • 500 formula examples with full explanations
  • 101 important Excel functions
  • Guide to all Excel functions (work in progress)
  • Excel formula errors (examples and fixes)
  • Formula criteria — 50 examples
  • Formulas for conditional formatting
  • How to use F9 to debug a formula (video)
  • Excel formula errors and fixes (video)

Понравилась статья? Поделить с друзьями:
  • In math word problems what is and
  • In the beginning the word was love
  • In many areas around the word
  • In the beginning the word was god and the word was with god
  • In line with another word