0% found this document useful (0 votes)
71 views

MS Excel Notes

The document provides summaries of commonly used formulas in Microsoft Excel for data analysis, including summary functions, SUM, SUMIF, and SUBTOTAL formulas. Summary functions allow automatic subtotals, consolidations, and calculations in PivotTables and PivotCharts. The SUM function adds numbers and SUMIF adds cells that meet criteria. SUBTOTAL returns subtotals in lists by function like SUM, COUNT, AVERAGE, MAX, MIN and more.

Uploaded by

Nehal shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

MS Excel Notes

The document provides summaries of commonly used formulas in Microsoft Excel for data analysis, including summary functions, SUM, SUMIF, and SUBTOTAL formulas. Summary functions allow automatic subtotals, consolidations, and calculations in PivotTables and PivotCharts. The SUM function adds numbers and SUMIF adds cells that meet criteria. SUBTOTAL returns subtotals in lists by function like SUM, COUNT, AVERAGE, MAX, MIN and more.

Uploaded by

Nehal shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Examples of commonly used formulas for MS Excel

Page 1 of 12
Summary functions for data analysis

Summary functions are used in automatic subtotals, data consolidations,


and PivotTable and PivotChart reports. In PivotTable and PivotChart reports,
the following summary functions are available for all types of source data
except OLAP.

Function Summarizes
Sum The sum of the values. This is the default function for numeric
data.
Count The number of data values. The Count summary function
works the same as the COUNTA worksheet function. Count
is the default function for data other than numbers.
Average The average of the values.
Max The largest value.
Min The smallest value.
Product The product of the values.
Count Nums The number of data values that are numbers. The Count
Nums summary function works the same as the
COUNT worksheet function.
StdDev An estimate of the standard deviation of a population, where
the sample is a subset of the entire population.
StdDevp The standard deviation of a population, where the population
is all of the data to be summarized.
Var An estimate of the variance of a population, where the sample
is a subset of the entire population.
Varp The variance of a population, where the population is all of
the data to be summarized.

Page 2 of 12
SUM
Adds all the numbers in a range of cells.

Syntax

SUM (number1,number2, ...)

Number1, number2, ... are 1 to 30 arguments for which you want the total value or sum.

Remarks

Numbers, logical values, and text representations of numbers that you type directly
into the list of arguments are counted. See the first and second examples following.
If an argument is an array or reference, only numbers in that array or reference are
counted. Empty cells, logical values, text, or error values in the array or reference
are ignored. See the third example following.
Arguments that are error values or text that cannot be translated into numbers cause
errors.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

1 Data
2 -5

3 15

4 30

5 '5

6 TRUE

Formula Description (Result)

=SUM(3, 2) Adds 3 and 2 (5)

=SUM("5", 15, Adds 5, 15 and 1, because the text values are translated into numbers,

Page 3 of 12
TRUE) and the logical value TRUE is translated into the number 1 (21)

=SUM(A2:A4) Adds the first three numbers in the column above (40)

=SUM(A2:A4, Adds the first three numbers in the column above, and 15 (55)
15)
=SUM(A5,A6, 2) Adds the values in the last two rows above, and 2. Because
nonnumeric values in references are not translated, the values in
the column above are ignored (2)

SUMIF
Adds the cells specified by a given criteria.

Syntax

SUMIF (range, criteria, sum_range)

Range is the range of cells you want evaluated.

Criteria is the criteria in the form of a number, expression, or text that defines which cells will be
added. For example, criteria can be expressed as 32, "32", ">32", "apples".

Sum_range are the actual cells to sum.

Remarks

The cells in sum_range are summed only if their corresponding cells in range match
the criteria.
If sum_range is omitted, the cells in range are summed.
Microsoft Excel provides additional functions that can be used to analyze your data
based on a condition. For example, to count the number of occurrences of a string of text
or a number within a range of cells, use the COUNTIF function. To have a formula return
one of two values based on a condition, such as a sales bonus based on a specified
sales amount, use the IF function.

Example

Page 4 of 12
The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

A B

Property Value Commission


100,000 7,000
1
200,000 14,000
2
300,000 21,000
3
400,000 28,000
4
Formula Description (Result)
5
=SUMIF(A2:A5,">160000",B2:B5) Sum of the commissions for property values over
160000 (63,000)

SUBTOTAL
Returns a subtotal in a list or database. It is generally easier to create a list with subtotals
using the Subtotals command (Data menu). Once the subtotal list is created, you can modify
it by editing the SUBTOTAL function.

Syntax

SUBTOTAL (function_num,ref1,ref2,...)

Function_num is the number 1 to 11 that specifies which function to use in calculating subtotals
within a list.

Function_Num Function

1 AVERAGE

Page 5 of 12
2 COUNT

3 COUNTA

4 MAX

5 MIN

6 PRODUCT

7 STDEV

8 STDEVP

9 SUM

10 VAR

11 VARP

Ref1, ref2, are 1 to 29 ranges or references for which you want the subtotal.

Remarks

If there are other subtotals within ref1, ref2,… (or nested subtotals), these
nested subtotals are ignored to avoid double counting.
SUBTOTAL will ignore any hidden rows that result from a list being filtered. This is
important when you want to subtotal only the visible data that results from a list that you
have filtered.
If any of the references are 3-D references, SUBTOTAL returns the #VALUE! error value.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

1 Data

2 120

Page 6 of 12
3 10

4 150

5 23

Formula Description (Result)

=SUBTOTAL(9,A2:A5) Subtotal of the column above using the SUM function (303)
=SUBTOTAL(1,A2:A5) Subtotal of the column above using the AVERAGE function
(75.75)

Increase or decrease a number by a percentage


Use the formulas below to do these tasks.

Worksheet example

The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

A B

Number Percent Increase

23 3%

1 Formula Description (Result)

2 =A2*(1+5%) Increases number in A2 by 5% (24.15)

=A2*(1+B2) Increase number in A2 by the percent value in B2: 3% (23.69)

=A2*(1-B2) Decrease number in A2 by the percent value in B2: 3% (22.31)

Note When you use a number followed by a percent sign (%), the number is interpreted as a
hundredth of its value. For example, 5% is interpreted as .05.

Page 7 of 12
SUMX2MY2
Returns the sum of the difference of squares of corresponding values in two arrays.

Syntax

SUMX2MY2 (array_x, array_y)

Array_x is the first array or range of values.

Array_y is the second array or range of values.

Remarks

The arguments should be either numbers or names, arrays, or references that contain
numbers.
If an array or reference argument contains text, logical values, or empty cells,
those values are ignored; however, cells with the value zero are included.
If array_x and array_y have a different number of values, SUMX2MY2 returns the #N/A
error value.
The equation for the sum of the difference of squares is:

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

A B

1 First array Second array

2 2 6

3 3 5

4 9 11

Page 8 of 12
5 1 7

6 8 5

7 7 4

8 5 4

Formula Description (Result)


=SUMX2MY2(A2:A8,B2:B8) Sum of the difference of squares of the two
arrays above (-55)
=SUMX2MY2({2, 3, 9, 1, 8, 7, 5}, {6, 5, 11, Sum of the difference of squares of the two
7, 5, 4, 4}) arrays constants (-55)

Calculate a running balance


1. Set up a worksheet like the following example, or copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

Example

A B C

1 Deposits Withdrawals Balance

2 $1,000 $625 =SUM(A2,-B2)

3 1000 740 =SUM(C2,A3,-B3)

2. Click anywhere outside cell C3 to see the calculated total.


3. To maintain the running balance, add a row for each new entry.

COUNT
Counts the cells that contain numbers in a column of a list or database that match conditions
you specify.

The field argument is optional. If field is omitted, DCOUNT counts all records in the database that
match the criteria.

Page 9 of 12
Syntax

COUNT (database, field, criteria)

Database is the range of cells that makes up the list or database. A database is a list of related
data in which rows of related information are records, and columns of data are fields. The first row
of the list contains labels for each column.

Field indicates which column is used in the function. Field can be given as text with the column
label enclosed between double quotation marks, such as "Age" or "Yield," or as a number that
represents the position of the column within the list: 1 for the first column, 2 for the second
column, and so on.

Criteria are the range of cells that contains the conditions you specify. You can use any range for
the criteria argument, as long as it includes at least one column label and at least one cell below
the column label for specifying a condition for the column.

COUNT
Counts the number of cells that contain numbers and also numbers within the list of arguments.
Use COUNT to get the number of entries in a number field that's in a range or array of numbers.

Syntax

COUNT (value1,value2,...)

Value1, value2, ... are 1 to 30 arguments that can contain or refer to a variety of different types
of data, but only numbers are counted.

Remarks

Arguments that are numbers, dates, or text representations of numbers are counted;
arguments that are error values or text that cannot be translated into numbers are
ignored.
If an argument is an array or reference, only numbers in that array or reference are
counted. Empty cells, logical values, text, or error values in the array or reference
are ignored. If you need to count logical values, text, or error values, use the
COUNTA function.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.

Page 10 of 12
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

Data

Sales
12/8/2008
1
2
19
3
22.24
4
TRUE
5
#DIV/0!
6
Formula Description (Result)
7
=COUNT(A2:A8) Counts the number of cells that contain numbers in the list above (3)
8
=COUNT(A5:A8) Counts the number of cells that contain numbers in the last 4 rows of
the list (2)
=COUNT(A2:A8,2) Counts the number of cells that contain numbers in the list, and the
value 2 (4)

Count days before a date


Use the TODAY function to do this task.

Worksheet example

The example may be easier to understand if you copy it to a blank worksheet.

Page 11 of 12
How?

1. Create a blank workbook or worksheet.


2. Select the example in the Help topic. Do not select the row or column headers.
3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the
results, press CTRL+` (grave accent), or on the Tools menu, point to Formula
Auditing, and then click Formula Auditing Mode.

Date
1/1/2008
1
6/1/2007
2
Formula Description (Result)
3
=A2-TODAY() Number of days from current date to end of 2007 (Varies)

=A2-A3 Number of days from 6/1/2007 until the end of 2007 (214)

Notes

In the first formula above, the current date used is taken from the system clock.
In the last formula above, to view the date as a number, select the cell and click
Cells on the Format menu. Click the Number tab, and then click Number in the
Category box.

Page 12 of 12

You might also like