Excel function
Excel function
The SUM function adds values. You can add individual values, cell references or ranges or a mix of
all three.
For example:
Syntax:
SUM(number1,[number2],...)
number1 The first number you want to add. The number can be like 4, a cell reference like B6,
or a cell range like B2:B8.
Required
number2- This is the second number you want to add. You can specify up to 255 numbers in this
255 way.
Optional
This section will discuss some best practices for working with the SUM function. Much of this can
be applied to working with other functions as well.
The =1+2 or =A+B Method – While you can enter =1+2+3 or =A1+B1+C2 and get fully
accurate results, these methods are error prone for several reasons:
1. Typos – Imagine trying to enter more and/or much larger values like this:
▪ =14598.93+65437.90+78496.23
Then try to validate that your entries are correct. It's much easier to put these values in
individual cells and use a SUM formula. In addition, you can format the values when they're
1
Page
in cells, making them much more readable then when they're in a formula.
Atanu Bhandary
2. #VALUE! errors from referencing text instead of numbers
▪ =A1+B1+C1 or =A1+A2+A3
Your formula can break if there are any non-numeric (text) values in the referenced cells,
which will return a #VALUE! error. SUM will ignore text values and give you the sum of just
the numeric values.
If you delete a row or column, the formula will not update to exclude the deleted row and it
will return a #REF! error, where a SUM function will automatically update.
4. Formulas won't update references when inserting rows or columns
If you insert a row or column, the formula will not update to include the added row, where a
SUM function will automatically update (as long as you're not outside of the range
referenced in the formula). This is especially important if you expect your formula to update
and it doesn't, as it will leave you with incomplete results that you might not catch.
▪ =SUM(A1,A2,A3,B1,B2,B3)
Is equally error prone when inserting or deleting rows within the referenced range for the
same reasons. It's much better to use individual ranges, like:
▪ =SUM(A1:A3,B1:B3)
AVERAGE function
Atanu Bhandary
This article describes the formula syntax and usage of the AVERAGE function in Microsoft Excel.
Description
Returns the average (arithmetic mean) of the arguments. For example, if the range A1:A20 contains
numbers, the formula =AVERAGE(A1:A20) returns the average of those numbers.
Syntax
▪ Number1 Required. The first number, cell reference, or range for which you want the
average.
▪ Number2, ... Optional. Additional numbers, cell references or ranges for which you want
the average, up to a maximum of 255.
MIN function
This article describes the formula syntax and usage of the MIN function in Microsoft Excel.
Description
Syntax
▪ Number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255
numbers for which you want to find the minimum value.
MAX function
This article describes the formula syntax and usage of the MAX function in Microsoft Excel.
Description
Syntax
Page
▪ Number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255
numbers for which you want to find the maximum value.
PRODUCT function
This article describes the formula syntax and usage of the PRODUCT function in Microsoft Excel.
Description
The PRODUCT function multiplies all the numbers given as arguments and returns the product.
For example, if cells A1 and A2 contain numbers, you can use the formula =PRODUCT(A1, A2) to
multiply those two numbers together. You can also perform the same operation by using the
multiply (*) mathematical operator; for example, =A1 * A2.
The PRODUCT function is useful when you need to multiply many cells together. For example, the
formula =PRODUCT(A1:A3, C1:C3) is equivalent to =A1 * A2 * A3 * C1 * C2 * C3.
Syntax
▪ number1 Required. The first number or range that you want to multiply.
▪ number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a
maximum of 255 arguments.
COUNT function
The COUNT function counts the number of cells that contain numbers, and counts numbers within
the list of arguments. Use the COUNT function to get the number of entries in a number field that
is in a range or array of numbers. For example, you can enter the following formula to count the
numbers in the range A1:A20: =COUNT(A1:A20). In this example, if five of the cells in the range
contain numbers, the result is 5.
Syntax
▪ value1 Required. The first item, cell reference, or range within which you want to count
numbers.
5
▪ value2, ... Optional. Up to 255 additional items, cell references, or ranges within which
Page
ODD function
Atanu Bhandary
This article describes the formula syntax and usage of the ODD function in Microsoft Excel.
Description
Syntax
ODD(number)
EVEN function
This article describes the formula syntax and usage of the EVEN function in Microsoft Excel.
Description
Returns number rounded up to the nearest even integer. You can use this function for processing
items that come in twos. For example, a packing crate accepts rows of one or two items. The crate
is full when the number of items, rounded up to the nearest two, matches the crate's capacity.
Syntax
EVEN(number)
INT function
This article describes the formula syntax and usage of the INT function in Microsoft Excel.
Description
Syntax
INT(number)
6
Page
▪ Number Required. The real number you want to round down to an integer.
Atanu Bhandary
Example
Copy the example data in the following table and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
Data
19.5
=INT(-8.9) Rounds -8.9 down. Rounding a negative number down rounds it away from 0. -9
=A2-INT(A2) Returns the decimal part of a positive real number in cell A2. 0.5
ABS function
This article describes the formula syntax and usage of the ABS function in Microsoft Excel.
Description
Returns the absolute value of a number. The absolute value of a number is the number without its
sign.
Syntax
ABS(number)
▪ Number Required. The real number of which you want the absolute value.
7
Example
Page
Copy the table below, and paste into cell A1 in Excel. You may need to select any cells that contain
formulas and press F2 and then Enter to make the formulas work. You may also want to make the
columns wider to make your worksheet easier to read.
Atanu Bhandary
Data
-4
ROUND function
Description
The ROUND function rounds a number to a specified number of digits. For example, if cell A1
contains 23.7825, and you want to round that value to two decimal places, you can use the
following formula:
=ROUND(A1, 2)
Syntax
ROUND(number, num_digits)
Remarks
8
Page
▪ If num_digits is greater than 0 (zero), then number is rounded to the specified number of
decimal places.
▪ If num_digits is 0, the number is rounded to the nearest integer.
Atanu Bhandary
▪ If num_digits is less than 0, the number is rounded to the left of the decimal point.
▪ To always round up (away from zero), use the ROUNDUP function.
▪ To always round down (toward zero), use the ROUNDDOWN function.
▪ To round a number to a specific multiple (for example, to round to the nearest 0.5), use the
MROUND function.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
=ROUND(21.5, -1) Rounds 21.5 to one decimal place to the left of the decimal point 20
EXP function
This article describes the formula syntax and usage of the EXP function in Microsoft Excel.
Description
Returns e raised to the power of number. The constant e equals 2.71828182845904, the base of
9
Syntax
EXP(number)
Atanu Bhandary
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
POWER function
Let's say you want to calculate an extremely small tolerance level for a machined part or the vast
distance between two galaxies. To raise a number to a power, use the POWER function.
Description
Syntax
POWER(number, power)
Remark
10
The "^" operator can be used instead of POWER to indicate to what power the base number is to
be raised, such as in 5^2.
Page
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
Atanu Bhandary
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
Formula Description Result
=POWER(5,2) 5 squared. 25
SQRT function
This article describes the formula syntax and usage of the SQRT function in Microsoft Excel.
Description
Syntax
SQRT(number)
▪ Number Required. The number for which you want the square root.
Remark
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
Data
11
-16
Page
=SQRT(A2) Square root of -16. Because the number is negative, the #NUM! error #NUM!
message is returned.
=SQRT(ABS(A2)) Avoiding the #NUM! error message by first using the ABS function to 4
find the absolute value of -16 and then finding the square root.
MOD function
This article describes the formula syntax and usage of the MOD function in Microsoft Excel.
Description
Returns the remainder after number is divided by divisor. The result has the same sign as divisor.
Syntax
MOD(number, divisor)
▪ Number Required. The number for which you want to find the remainder.
▪ Divisor Required. The number by which you want to divide number.
Remarks
MOD(n, d) = n - d*INT(n/d)
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
12
Page
CONCAT function
The CONCAT function combines the text from multiple ranges and/or strings, but it doesn't
provide delimiter or IgnoreEmpty arguments.
CONCAT replaces the CONCATENATE function. However, the CONCATENATE function will stay
available for compatibility with earlier versions of Excel.
Note: This feature is available on Windows or Mac if you have Office 2019, or if you have an Office
365 subscription . If you are an Office 365 subscriber, make sure you have the latest version of
Office.
Syntax
CONCAT(text1, [text2],…)
Argument Description
text1 Text item to be joined. A string, or array of strings, such as a range of cells.
(required)
[text2, Additional text items to be joined. There can be a maximum of 253 text arguments for the
...] text items. Each can be a string, or array of strings, such as a range of cells.
(optional)
For example, =CONCAT("The"," ","sun"," ","will"," ","come"," ","up"," ","tomorrow.") will return The
sun will come up tomorrow.
13
UPPER function
Page
This article describes the formula syntax and usage of the UPPER function in Microsoft Excel.
Description
Atanu Bhandary
UPPER(text)
▪ Text Required. The text you want converted to uppercase. Text can be a reference or text
string.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
Data
total
Yield
LOWER function
This article describes the formula syntax and usage of the LOWER function in Microsoft Excel.
Description
14
Syntax
LOWER(text)
▪ Text Required. The text you want to convert to lowercase. LOWER does not change
characters in text that are not letters.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
Data
E. E. Cummings
Apt. 2B
NOW function
This article describes the formula syntax and usage of the NOW function in Microsoft Excel. Find
links to more information about working with dates and times in the See Also section.
Description
Returns the serial number of the current date and time. If the cell format was General before the
function was entered, Excel changes the cell format so that it matches the date and time format of
your regional settings. You can change the date and time format for the cell by using the
commands in the Number group of the Home tab on the Ribbon.
The NOW function is useful when you need to display the current date and time on a worksheet or
calculate a value based on the current date and time, and have that value updated each time you
open the worksheet.
15
Note: If the NOW function does not update cell values when you expect it to, you might need to
Page
change settings that control when the workbook or worksheet recalculates. These settings can be
changed in Control Panel for the Excel desktop application.
Syntax
Atanu Bhandary
NOW()
▪ Excel stores dates as sequential serial numbers so that they can be used in calculations. By
default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448
because it is 39,447 days after January 1, 1900.
▪ Numbers to the right of the decimal point in the serial number represent the time; numbers
to the left represent the date. For example, the serial number 0.5 represents the time 12:00
noon.
▪ The results of the NOW function change only when the worksheet is calculated or when a
macro that contains the function is run. It is not updated continuously.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
=NOW()-0.5 Returns the date and time 12 hours ago (-0.5 days ago). 11/6/2011 7:03
=NOW()+7 Returns the date and time 7 days in the future. 11/13/2011 19:03
=NOW()-2.25 Returns the date and time 2 days and 6 hours ago (-2.25 days ago). 11/4/2011 13:03
TODAY function
This article describes the formula syntax and usage of the TODAY function in Microsoft Excel.
Description
The TODAY function returns the serial number of the current date. The serial number is the date-
16
time code used by Excel for date and time calculations. If the cell format was General before the
Page
function was entered, Excel changes the cell format to Date. If you want to view the serial number,
you must change the cell format to General or Number.
The TODAY function is useful when you need to have the current date displayed on a worksheet,
Atanu Bhandary
regardless of when you open the workbook. It is also useful for calculating intervals. For example, if
you know that someone was born in 1963, you might use the following formula to find that
person's age as of this year's birthday:
=YEAR(TODAY())-1963
This formula uses the TODAY function as an argument for the YEAR function to obtain the current
year, and then subtracts 1963, returning the person's age.
Note: If the TODAY function does not update the date when you expect it to, you might need to
change the settings that control when the workbook or worksheet recalculates. On the File tab,
click Options, and then in the Formulas category under Calculation options, make sure that
Automatic is selected.
Syntax
TODAY()
Note: Excel stores dates as sequential serial numbers so they can be used in calculations. By
default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is
39,447 days after January 1, 1900.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For
formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust
the column widths to see all the data.
=TODAY()+5 Returns the current date plus 5 days. For example, if the 12/6/2011
current date is 1/1/2012, this formula returns 1/6/2012.
=DATEVALUE("1/1/2030")- Returns the number of days between the current date 1/31/1918
TODAY() and 1/1/2030. Note that cell A4 must be formatted as
General or Number for the result to display correctly.
17
returns 5.