Working with function in excel

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.

Below is a brief overview of about 100 important Excel functions you should know, with links to detailed examples. We also have a large list of example formulas, a more complete list of Excel functions, and video training. If you are new to Excel formulas, see this introduction.

Note: Excel now includes Dynamic Array formulas, which offer important new functions.

Date and Time Functions

Excel provides many functions to work with dates and times. 

NOW and TODAY

You can get the current date with the TODAY function and the current date and time with the NOW Function. Technically, the NOW function returns the current date and time, but you can format as time only, as seen below:

NOW and TODAY functions

TODAY() // returns current date
NOW() // returns current time

Note: these are volatile functions and will recalculate with every worksheet change. If you want a static value, use date and time shortcuts.

DAY, MONTH, YEAR, and DATE

You can use the DAY, MONTH, and YEAR functions to disassemble any date into its raw components, and the DATE function to put things back together again.

Functions to disassemble and reassemble dates

=DAY("14-Nov-2018") // returns 14
=MONTH("14-Nov-2018") // returns 11
=YEAR("14-Nov-2018") // returns 2018
=DATE(2018,11,14) // returns 14-Nov-2018

HOUR, MINUTE, SECOND, and TIME

Excel provides a set of parallel functions for times. You can use the HOUR, MINUTE, and SECOND functions to extract pieces of a time, and you can assemble a TIME from individual components with the TIME function.

Time function examples

=HOUR("10:30") // returns 10
=MINUTE("10:30") // returns 30
=SECOND("10:30") // returns 0
=TIME(10,30,0) // returns 10:30

DATEDIF and YEARFRAC

You can use the DATEDIF function to get time between dates in years, months, or days. DATEDIF can also be configured to get total time in «normalized» denominations, i.e. «2 years and 6 months and 27 days».

DATEDIF function example

Use YEARFRAC to get fractional years:

YEARFRAC function example

=YEARFRAC("14-Nov-2018","10-Jun-2021") // returns 2.57

EDATE and EOMONTH

A common task with dates is to shift a date forward (or backward) by a given number of months. You can use the EDATE and EOMONTH functions for this. EDATE moves by month and retains the day. EOMONTH works the same way, but always returns the last day of the month.

EDATE and EOMONTH function examples

EDATE(date,6) // 6 months forward
EOMONTH(date,6) // 6 months forward (end of month)

WORKDAY and NETWORKDAYS

To figure out a date n working days in the future, you can use the WORKDAY function. To calculate the number of workdays between two dates, you can use NETWORKDAYS.

WORKDAY function example

WORKDAY(start,n,holidays) // date n workdays in future

Video: How to calculate due dates with WORKDAY

NETWORKDAYS function example

NETWORKDAYS(start,end,holidays) // number of workdays between dates

Note: Both functions automatically skip weekends (Saturday and Sunday) and will also skip holidays, if provided. If you need more flexibility on what days are considered weekends, see the WORKDAY.INTL function and NETWORKDAYS.INTL function. 

WEEKDAY and WEEKNUM

To figure out the day of week from a date, Excel provides the WEEKDAY function. WEEKDAY returns a number between 1-7 that indicates Sunday, Monday, Tuesday, etc. Use the WEEKNUM function to get the week number in a given year.

WEEKDAY and WEEKNUM function examples

=WEEKDAY(date) // returns a number 1-7
=WEEKNUM(date) // returns week number in year

Engineering

CONVERT

Most Engineering functions are pretty technical…you’ll find a lot of functions for complex numbers in this section. However, the CONVERT function is quite useful for everyday unit conversions. You can use CONVERT to change units for distance, weight, temperature, and much more.

CONVERT function example

=CONVERT(72,"F","C") // returns 22.2

Information Functions

ISBLANK, ISERROR, ISNUMBER, and ISFORMULA

Excel provides many functions for checking the value in a cell, including ISNUMBER,  ISTEXT, ISLOGICAL, ISBLANK, ISERROR, and ISFORMULA  These functions are sometimes called the «IS» functions, and they all return TRUE or FALSE based on a cell’s contents.

ISNUMBER ISTEXT ISLOGICAL ISBLANK ISERROR ISFORMULA

Excel also has ISODD and ISEVEN functions that will test a number to see if it’s even or odd.

By the way, the green fill in the screenshot above is applied automatically with a conditional formatting formula.

Logical Functions

Excel’s logical functions are a key building block of many advanced formulas. Logical functions return the boolean values TRUE or FALSE. If you need a primer on logical formulas, this video goes through many examples.

AND, OR and NOT

The core of Excel’s logical functions are the AND function, the OR function, and the NOT function. In the screen below, each of these function is used to run a simple test on the values in column B:

AND, OR, and NOT functions

=AND(B5>3,B5<9)
=OR(B5=3,B5=9)
=NOT(B5=2)
  • Video: How to build logical formulas
  • Guide: 50 examples of formula criteria

IFERROR and IFNA

The IFERROR function and IFNA function can be used as a simple way to trap and handle errors. In the screen below, VLOOKUP is used to retrieve cost from a menu item. Column F contains just a VLOOKUP function, with no error handling. Column G shows how to use IFNA with VLOOKUP to display a custom message when an unrecognized item is entered.

IFNA function with VLOOKUP example

=VLOOKUP(E5,menu,2,0) // no error trapping
=IFNA(VLOOKUP(E5,menu,2,0),"Not found") // catch errors

Whereas IFNA only catches an #N/A error, the IFERROR function will catch any formula error.

IF and IFS functions

The IF function is one of the most used functions in Excel. In the screen below, IF checks test scores and assigns «pass» or «fail»:

IF function example

Multiple IF functions can be nested together to perform more complex logical tests.

New in Excel 2019 and Excel 365, the IFS function can run multiple logical tests without nesting IFs.

IFS function example

=IFS(C5<60,"F",C5<70,"D",C5<80,"C",C5<90,"B",C5>=90,"A")

Lookup and Reference Functions

VLOOKUP and HLOOKUP

Excel offers a number of functions to lookup and retrieve data. Most famous of all is VLOOKUP:

VLOOKUP function example

=VLOOKUP(C5,$F$5:$G$7,2,TRUE)

More: 23 things to know about VLOOKUP.

HLOOKUP works like VLOOKUP, but expects data arranged horizontally:

HLOOKUP function example

=HLOOKUP(C5,$G$4:$I$5,2,TRUE)

INDEX and MATCH

For more complicated lookups, INDEX and MATCH offers more flexibility and power:

INDEX and MATCH function example

=INDEX(C5:E12,MATCH(H4,B5:B12,0),MATCH(H5,C4:E4,0))

Both the INDEX function and the MATCH function are powerhouse functions that turn up in all kinds of formulas.

More: How to use INDEX and MATCH

LOOKUP

The LOOKUP function has default behaviors that make it useful when solving certain problems. LOOKUP assumes values are sorted in ascending order and always performs an approximate match. When LOOKUP can’t find a match, it will match the next smallest value. In the example below we are using LOOKUP to find the last entry in a column:

LOOKUP function example - last non-empty cell

ROW and COLUMN

You can use the ROW function and COLUMN function to find row and column numbers on a worksheet. Notice both ROW and COLUMN return values for the current cell if no reference is supplied:

ROW and COLUMN function example

The row function also shows up often in advanced formulas that process data with relative row numbers.

ROWS and COLUMNS

The ROWS function and COLUMNS function provide a count of rows in a reference. In the screen below, we are counting rows and columns in an Excel Table named «Table1».

ROWS and COLUMNS function example

Note ROWS returns a count of data rows in a table, excluding the header row. By the way, here are 23 things to know about Excel Tables.

HYPERLINK

You can use the HYPERLINK function to construct a link with a formula. Note HYPERLINK lets you build both external links and internal links:

HYPERLINK function example

=HYPERLINK(C5,B5)

GETPIVOTDATA

The GETPIVOTDATA function is useful for retrieving information from existing pivot tables.

GETPIVOTDATA function example

=GETPIVOTDATA("Sales",$B$4,"Region",I6,"Product",I7)

CHOOSE

The CHOOSE function is handy any time you need to make a choice based on a number:

CHOOSE function example

=CHOOSE(2,"red","blue","green") // returns "blue"

Video: How to use the CHOOSE function

TRANSPOSE

The TRANSPOSE function gives you an easy way to transpose vertical data to horizontal, and vice versa.

TRANSPOSE function example

{=TRANSPOSE(B4:C9)}

Note: TRANSPOSE is a formula and is, therefore, dynamic. If you just need to do a one-time transpose operation, use Paste Special instead.

OFFSET

The OFFSET function is useful for all kinds of dynamic ranges. From a starting location, it lets you specify row and column offsets, and also the final row and column size. The result is a range that can respond dynamically to changing conditions and inputs. You can feed this range to other functions, as in the screen below, where OFFSET builds a range that is fed to the SUM function:

OFFSET function example

=SUM(OFFSET(B4,1,I4,4,1)) // sum of Q3

INDIRECT

The INDIRECT function allows you to build references as text. This concept is a bit tricky to understand at first, but it can be useful in many situations. Below, we are using INDIRECT to get values from cell A1 in 5 different worksheets. Each reference is dynamic. If a sheet name changes, the reference will update.

INDIRECT function example

=INDIRECT(B5&"!A1") // =Sheet1!A1

The INDIRECT function is also used to «lock» references so they won’t change, when rows or columns are added or deleted. For more details, see linked examples at the bottom of the INDIRECT function page.

Caution: both OFFSET and INDIRECT are volatile functions and can slow down large or complicated spreadsheets.

STATISTICAL Functions

COUNT and COUNTA

You can count numbers with the COUNT function and non-empty cells with COUNTA. You can count blank cells with COUNTBLANK, but in the screen below we are counting blank cells with COUNTIF, which is more generally useful.

COUNT and COUNTA function examples

=COUNT(B5:F5) // count numbers
=COUNTA(B5:F5) // count numbers and text
=COUNTIF(B5:F5,"") // count blanks

COUNTIF and COUNTIFS

For conditional counts, the COUNTIF function can apply one criteria. The COUNTIFS function can apply multiple criteria at the same time:

COUNTIF and COUNTIFS function examples

=COUNTIF(C5:C12,"red") // count red
=COUNTIF(F5:F12,">50") // count total > 50
=COUNTIFS(C5:C12,"red",D5:D12,"TX") // red and tx
=COUNTIFS(C5:C12,"blue",F5:F12,">50") // blue > 50

Video: How to use the COUNTIF function

SUM, SUMIF, SUMIFS

To sum everything, use the SUM function. To sum conditionally, use SUMIF or SUMIFS. Following the same pattern as the counting functions, the SUMIF function can apply only one criteria while the SUMIFS function can apply multiple criteria.

SUM, SUMIFS, and SUMIFS function examples

=SUM(F5:F12) // everything
=SUMIF(C5:C12,"red",F5:F12) // red only
=SUMIF(F5:F12,">50") // over 50
=SUMIFS(F5:F12,C5:C12,"red",D5:D12,"tx") // red & tx
=SUMIFS(F5:F12,C5:C12,"blue",F5:F12,">50") // blue & >50

Video: How to use the SUMIF function

AVERAGE, AVERAGEIF, and AVERAGEIFS

Following the same pattern, you can calculate an average with AVERAGE, AVERAGEIF, and AVERAGEIFS.

AVERAGE, AVERAGEIF, and AVERAGEIFS function examples

=AVERAGE(F5:F12) // all
=AVERAGEIF(C5:C12,"red",F5:F12) // red only
=AVERAGEIFS(F5:F12,C5:C12,"red",D5:D12,"tx") // red and tx

MIN, MAX, LARGE, SMALL

You can find largest and smallest values with MAX and MIN, and nth largest and smallest values with LARGE and SMALL. In the screen below, data is the named range C5:C13, used in all formulas.

MAX, MIN, LARGE, and SMALL function examples

=MAX(data) // largest
=MIN(data) // smallest
=LARGE(data,1) // 1st largest
=LARGE(data,2) // 2nd largest
=LARGE(data,3) // 3rd largest
=SMALL(data,1) // 1st smallest
=SMALL(data,2) // 2nd smallest
=SMALL(data,3) // 3rd smallest

Video: How to find the nth smallest or largest value

MINIFS, MAXIFS

The MINIFS and MAXIFS. These functions let you find minimum and maximum values with conditions:

MINIFS and MAXIFS function examples

=MAXIFS(D5:D15,C5:C15,"female") // highest female
=MAXIFS(D5:D15,C5:C15,"male") // highest male
=MINIFS(D5:D15,C5:C15,"female") // lowest female
=MINIFS(D5:D15,C5:C15,"male") // lowest male

Note: MINIFS and MAXIFS are new in Excel via Office 365 and Excel 2019.

MODE

The MODE function returns the most commonly occurring number in a range:

MODE function example

=MODE(B5:G5) // returns 1

RANK

To rank values largest to smallest, or smallest to largest, use the RANK function:

RANK function example

Video: How to rank values with the RANK function

MATH Functions

ABS

To change negative values to positive use the ABS function.

ABS function example

=ABS(-134.50) // returns 134.50

RAND and RANDBETWEEN

Both the RAND function and RANDBETWEEN function can generate random numbers on the fly. RAND creates long decimal numbers between zero and 1. RANDBETWEEN generates random integers between two given numbers.

RAND and RANDBETWEEN function examples

=RAND() // between zero and 1
=RANDBETWEEN(1,100) // between 1 and 100

ROUND, ROUNDUP, ROUNDDOWN, INT

To round values up or down, use the ROUND function. To force rounding up to a given number of digits, use ROUNDUP. To force rounding down, use ROUNDDOWN. To discard the decimal part of a number altogether, use the INT function.

ROUND, ROUNDUP, ROUNDDOWN, INT function examples

=ROUND(11.777,1) // returns 11.8
=ROUNDUP(11.777) // returns 11.8
=ROUNDDOWN(11.777,1) // returns 11.7
=INT(11.777) // returns 11

MROUND, CEILING, FLOOR

To round values to the nearest multiple use the MROUND function. The FLOOR function and CEILING function also round to a given multiple. FLOOR forces rounding down, and CEILING forces rounding up.

MROUND, CEILING, FLOOR functions

=MROUND(13.85,.25) // returns 13.75
=CEILING(13.85,.25) // returns 14
=FLOOR(13.85,.25) // returns 13.75

MOD

The MOD function returns the remainder after division. This sounds boring and geeky, but MOD turns up in all kinds of formulas, especially formulas that need to do something «every nth time». In the screen below, you can see how MOD returns zero every third number when the divisor is 3:

MOD function example

SUMPRODUCT

The SUMPRODUCT function is a powerful and versatile tool when dealing with all kinds of data. You can use SUMPRODUCT to easily count and sum based on criteria, and you can use it in elegant ways that just don’t work with COUNTIFS and SUMIFS. In the screen below, we are using SUMPRODUCT to count and sum orders in March. See the SUMPRODUCT page for details and links to many examples.

SUMPRODUCT function example

=SUMPRODUCT(--(MONTH(B5:B12)=3)) // count March
=SUMPRODUCT(--(MONTH(B5:B12)=3),C5:C12) // sum March

SUBTOTAL

The SUBTOTAL function is an «aggregate function» that can perform a number of operations on a set of data. All told, SUBTOTAL can perform 11 operations, including SUM, AVERAGE, COUNT, MAX, MIN, etc. (see this page for the full list). The key feature of SUBTOTAL is that it will ignore rows that have been «filtered out» of an Excel Table, and, optionally, rows that have been manually hidden. In the screen below, SUBTOTAL is used to count and sum only the 7 visible rows in the table:

SUBTOTAL function example

=SUBTOTAL(3,B5:B14) // returns 7
=SUBTOTAL(9,F5:F14) // returns 9.54

AGGREGATE

Like SUBTOTAL, the AGGREGATE function can also run a number of aggregate operations on a set of data and can optionally ignore hidden rows. The key differences are that AGGREGATE can run more operations (19 total) and can also ignore errors.

In the screen below, AGGREGATE is used to perform MIN, MAX, LARGE and SMALL operations while ignoring errors. Normally, the error in cell B9 would prevent these functions from returning a result. See this page for a full list of operations AGGREGATE can perform.

AGGREGATE function example

=AGGREGATE(4,6,values) // MAX ignore errors, returns 100
=AGGREGATE(5,6,values) // MIN ignore errors, returns 75

TEXT Functions

LEFT, RIGHT, MID

To extract characters from the left, right, or middle of text, use LEFT, RIGHT, and MID functions:

LEFT, RIGHT, MID function examples

=LEFT("ABC-1234-RED",3) // returns "ABC"
=MID("ABC-1234-RED",5,4) // returns "1234"
=RIGHT("ABC-1234-RED",3) // returns "RED"

LEN

The LEN function will return the length of a text string. LEN shows up in a lot of formulas that count words or characters.

LEN function example

FIND, SEARCH

To look for specific text in a cell, use the FIND function or SEARCH function. These functions return the numeric position of matching text, but SEARCH allows wildcards and FIND is case-sensitive. Both functions will throw an error when text is not found, so wrap in the ISNUMBER function to return TRUE or FALSE (example here).

FIND and SEARCH function examples

=FIND("Better the devil you know","devil") // returns 12
=SEARCH("This is not my beautiful wife","bea*") // returns 12

REPLACE, SUBSTITUTE

To replace text by position, use the REPLACE function. To replace text by matching, use the SUBSTITUTE function. In the first example, REPLACE removes the two asterisks (**) by replacing the first two characters with an empty string («»). In the second example, SUBSTITUTE removes all hash characters (#) by replacing «#» with «».

REPLACE and SUBSTITUTE function examples

=REPLACE("**Red",1,2,"") // returns "Red"
=SUBSTITUTE("##Red##","#","") // returns "Red"

CODE, CHAR

To figure out the numeric code for a character, use the CODE function. To translate the numeric code back to a character, use the CHAR function. In the example below, CODE translates each character in column B to its corresponding code. In column F, CHAR translates the code back to a character.

CODE and CHAR function examples

=CODE("a") // returns 97
=CHAR(97) // returns "a"

Video: How to use the CODE and CHAR functions

TRIM, CLEAN

To get rid of extra space in text, use the TRIM function. To remove line breaks and other non-printing characters, use CLEAN.

TRIM and CLEAN function examples

=TRIM(A1) // remove extra space
=CLEAN(A1) // remove line breaks

Video: How to clean text with TRIM and CLEAN

CONCAT, TEXTJOIN, CONCATENATE

New in Excel  via Office 365 are CONCAT and TEXTJOIN. The CONCAT function lets you concatenate (join) multiple values, including a range of values without a delimiter. The TEXTJOIN function does the same thing, but allows you to specify a delimiter and can also ignore empty values.

CONCAT and TEXTJOIN function examples

=TEXTJOIN(",",TRUE,B4:H4) // returns "red,blue,green,pink,black"
=CONCAT(B7:H7) // returns "8675309"

Excel also provides the CONCATENATE function, but it doesn’t offer special features. I wouldn’t bother with it and would instead concatenate directly with the ampersand (&) character in a formula.

EXACT

The EXACT function allows you to compare two text strings in a case-sensitive manner.

EXACT function example

UPPER, LOWER, PROPER

To change the case of text, use the UPPER, LOWER, and PROPER function

UPPER, LOWER, PROPER function examples

=UPPER("Sue BROWN") // returns "SUE BROWN"
=LOWER("Sue BROWN") // returns "sue brown"
=PROPER("Sue BROWN") // returns "Sue Brown"

Video: How to change case with formulas

TEXT

Last but definitely not least is the TEXT function. The text function lets you apply number formatting to numbers (including dates, times, etc.) as text. This is especially useful when you need to embed a formatted number in a message, like «Sale ends on [date]».

TEXT function example

=TEXT(B5,"$#,##0.00") 
=TEXT(B6,"000000")
="Save "&TEXT(B7,"0%")
="Sale ends "&TEXT(B8,"mmm d")

More: Detailed examples of custom number formatting.

Dynamic Array functions

Dynamic arrays are new in Excel 365, and are a major upgrade to Excel’s formula engine. As part of the dynamic array update, Excel includes new functions which directly leverage dynamic arrays to solve problems that are traditionally hard to solve with conventional formulas. If you are using Excel 365, make sure you are aware of these new functions:

Function Purpose
FILTER Filter data and return matching records
RANDARRAY Generate array of random numbers
SEQUENCE Generate array of sequential numbers
SORT Sort range by column
SORTBY Sort range by another range or array
UNIQUE Extract unique values from a list or range
XLOOKUP Modern replacement for VLOOKUP
XMATCH Modern replacement for the MATCH function

Video: New dynamic array functions in Excel (about 3 minutes).

Quick navigation

ABS, AGGREGATE, AND, AVERAGE, AVERAGEIF, AVERAGEIFS, CEILING, CHAR, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, CONCAT, CONCATENATE, CONVERT, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, DATE, DATEDIF, DAY, EDATE, EOMONTH, EXACT, FIND, FLOOR, GETPIVOTDATA, HLOOKUP, HOUR, HYPERLINK, IF, IFERROR, IFNA, IFS, INDEX, INDIRECT, INT, ISBLANK, ISERROR, ISEVEN, ISFORMULA, ISLOGICAL, ISNUMBER, ISODD, ISTEXT, LARGE, LEFT, LEN, LOOKUP, LOWER, MATCH, MAX, MAXIFS, MID, MIN, MINIFS, MINUTE, MOD, MODE, MONTH, MROUND, NETWORKDAYS, NOT, NOW, OFFSET, OR, PROPER, RAND, RANDBETWEEN, RANK, REPLACE, RIGHT, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, SEARCH, SECOND, SMALL, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, TEXT, TEXTJOIN, TIME, TODAY, TRANSPOSE, TRIM, UPPER, VLOOKUP, WEEKDAY, WEEKNUM, WORKDAY, YEAR, YEARFRAC 

The Excel functions – there are computing tools, suitable for various industries: finance, statistics, banking, accounting, engineering and design, analysis of research data, etc.

Merely a scanty part of the possibilities of computational functions are comprised in this tutorial with Excel lessons. We`ll consider the practical application of functions on simple instances & further.



The function of calculating the average number

How to calculate the arithmetic mean in Excel? Make the table, as depicted in the picture:

How to calculate.

In the cells D5 and E5 we introduce the functions, that help to receive the average of the grades of achievement in the lessons of English & Mathematics. The cell E4 does not matter, so the result will be calculated from 2 estimates.

  1. Work with the cell D5.
  2. Choose the tool from the drop-down list: «Home» – «Sum» – «Average». In this drop-down list there are frequently used mathematical functions.
  3. Average.

  4. The span is determined mechanically, it remains only to press Enter.
  5. The function, that includes the cell D5 now, you need to replicate in the cell E5.

replicate.

The secondary function in Excel: = AVERAGE () in the cell E5 ignores the text. It will ignore the empty cell also. But if the cell has a value of 0, then the result will change naturally.

secondary function.

In Excel, there is still the function = AVERAGEA() – the average meaning is an arithmetic number. It differs from the previous one in that:

AVERAGEA.

  • = AVERAGE() – there are skips cells that don`t contain numbers;
  • = AVERAGEA() – there are skips only empty cells, and accepts text values as 0.



The function of counting the number of values in Excel

  1. In the cells D6 and E6 in our table you need to enter the function of counting the number of numerical values. The function will allow us to learn the number of grades given.
  2. Go to the cell D6 and pick out the tool from the drop-down list: «Home» – «Sum» – «Number».
  3. This time, the automatic detection of a range of cells is not suitable for us, so you need to fix it to D2:D4. Press Enter after that.
  4. From D6 to the cell E6, you should copy = COUNT () – it need for counting the number of non-empty cells.
  5. COUNT.

In this example it’s clear, that the function = COUNT() overlooks cells, that don`t comprise number or are empty.

The IF function in Excel

In the cells D7 and E7 you need to introduce a logical function, that will allow us to check whether all students have grades. There is example of IF function:

  1. Go to the cell D7, select the tool: «FORMULAS» – «Logical» – «IF».
  2. Logical.

  3. Fill in the arguments of the function in the dialog box, as you can see in the figure and click OK (note, that the 2-nd link $A$4 is absolute):
  4. IF.

  5. The function from D7 is copied to E7.
  6. YES or NO.

The specification of function arguments: = IF (). There are the number of all students in the cell A4, and in the cell D6 and E6 – the number of estimates. The IF () checks whether D6 and E6 are the same as A4. If functions are the same, we get the answer YES, and if not, the answer is NO.

In logical expression, there are 2 types of references are used for convenience: relative and absolute. This allows us to copy the formula without errors in the results of its calculation.

The notation. The «Formulas» tab provides access only to the most frequently used functions. You may get more by calling the «Functions Wizard» window by clicking on the «Insert function» button at the beginning of the formula line. Or we may press SHIFT + F3.

How to round numbers in Excel

The = ROUND () is more accurate and useful than rounding by using a cell format. This is easily seen in practice.

  1. Make the original chart as shown in the picture:
  2. ROUND.

  3. The cell B2 you need format so, that only 2 decimal places are displayed. This can be done using the «Format cells» dialog box or the tool located on the «HOME» tab – «Decrease Decimal».
  4. Decrease Decimal.

  5. In the column C you should add the subtraction formula of 1.25 from the values of column B: =B-1.25.

Now you know how to use the ROUND function in Excel.

The description of function arguments =ROUND():

  1. The first reason – is the cell reference to the value to be rounded.
  2. The second reason – is the number of symbols after point, that need to left after rounding.

Attention! The formatting cells only displays rounding, but does not change the value, and = ROUND () – rounds the value. Therefore, for calculations and computations, you need to use the function = ROUND (), inasmuch formatting of the cells will result in erroneous values in the meanings.

Home / What is a Function in Excel

Home / What is a Function in Excel

What is a Function in Excel

In Excel, a function is a predefined formula that performs a specific calculation by using values a user input as arguments. Every Excel function has a specific purpose, in simple words, it calculates a specific value. Each function has its arguments (the value one needs to input) to get the result value in the cell.

Components

Each function has two major components. In short, each function (except a few) is made up of two following things:

  • Function Name
  • Arguments

Let me show you an example. Let’s take a look at the below function which we have inserted in the cell A1.

Now if you look at the formula bar you can understand the structure of the function by splitting it into two parts i.e. name and arguments.

Function Arguments

As I have already mentioned that in a function you need to specify input values to get the desired result. An argument is that value which you need to specify. If you look at the syntax of a function you can see there in each function there is set arguments to specify.

Below are the types of arguments:

  • Required: A required argument is compulsory for a user to specify and without which a function can’t calculate its result.
  • Optional: If you skip specifying these arguments it will not stop a function to calculate its result value.
  • No Arguments: There are few functions (like NOW) where you don’t need to specify any argument.

How to INSERT a Function in Excel

The easiest way to insert a function in a cell in Excel is to type the name of the function you want to insert starting with equals to sign.

Let’s say you want to insert the SUM function:

  • First of all, you need to type = and the then type SUM.
  • After that, enter the opening parentheses.
  • Specify the arguments (refer to a cell or you can directly enter values into the function).
  • In the end, type closing parentheses and hit enter.

Major Types

Below are the major types:

  • Text Functions: If you deal with data where you have text, then below are some of the functions which you need to learn to work efficiently.
  • Date Functions: Dates are one of the major ingredients of data that you use every day, and helps you to analyze your data in a better way.
  • Time Functions: Just like dates, time is could also be there in data and you can use time functions to deal with data where you have time values.
  • Logical Functions: Logical functions can help you create some of the most helpful formula in your spreadsheet.
  • Maths Functions: Excel is all about calculations and analysis, and mathematical functions and you can use these functions to get better in calculations and analysis.
  • Statistical Functions: One of the best things about Excel is there are a bunch of statistical functions there that you can use to analyze data easily.
  • Lookup Functions: In Excel, there some specific functions which can help you to look up a value or specific information about a cell or a range of cells.
  • Information Function: These some specific functions which you can use to get information about the values you supplied.
  • Financial Functions: These functions can help you calculate some of the common but important financial calculations in an easy way.

About the Author

puneet one point one

Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.

Here you will find a detailed tutorial on 100+ Excel Functions & VBA Functions. Each Excel function is covered in detail with Examples and Videos.

Excel Functions – Date and Time

Excel Function Description
Excel DATE Function

Excel DATE function can be used when you want to get the date value using the year, month and, day values as the input arguments. It returns a serial number that represents a specific date in Excel.

​Excel DATEVALUE Function

Excel DATEVALUE function is best suited for situations when a date is stored as text. This function converts the date from text format to a serial number that Excel recognizes as a date.

Excel DAY Function

Excel DAY function can be used when you want to get the day value (ranging between 1 to 31) from a specified date. It returns a value between 0 and 31 depending on the date used as the input.

Excel HOUR Function

Excel HOUR function can be used when you want to get the HOUR integer value from a specified time value. It returns a value between 0 (12:00 A.M.) and 23 (11:00 P.M.) depending on the time value used as the input

Excel MINUTE Function

Excel MINUTE function can be used when you want to get the MINUTE integer value from a specified time value. It returns a value between 0 and 59 depending on the time value used as the input.

Excel NETWORKDAYS Function Excel NETWORKDAYS function can be used when you want to get the number of working days between two given dates. It does not count the weekends between the specified dates (by default the weekend is Saturday and Sunday). It can also exclude any specified holidays.
Excel NETWORKDAYS.INTL Function

Excel NETWORKDAYS.INTL function can be used when you want to get the number of working days between two given dates. It does not count the weekends and holidays, both of which can be specified by the user. It also enables you to specify the weekend (for example, you can specify Friday and Saturday as the weekend, or only Sunday as the weekend).

Excel NOW Function Excel NOW function can be used to get the current date and time value.
Excel SECOND Function

Excel SECOND function can be used want to get the integer value of the seconds from a specified time value. It returns a value between 0 and 59 depending on the time value used as the input.

Excel TODAY Function Excel TODAY function can be used to get the current date. It returns a serial number that represents the current date.
Excel WEEKDAY Function

Excel WEEKDAY function can be used to get the day of the week as a number for the specified date. It returns a number between 1 and 7 that represents the corresponding day of the week.

Excel WORKDAY Function

Excel WORKDAY function can be used when you want to get the date after a given number of working days. By default, it takes Saturday and Sunday as the weekend

Excel WORKDAY.INTL Function

Excel WORKDAY.INTL function can be used when you want to get the date after a given number of working days. In this function, you can specify the weekend to be days other than Saturday and Sunday.

Excel DATEDIF Function

Excel DATEDIF function can be used when you want to calculate the number of years, months, or days between the two specified dates. A good example would be calculating the age.

Excel Functions – Logical

Excel Function Description
Excel AND Function

Excel AND function can be used when you want to check multiple conditions. It returns TRUE only when all the given conditions are true.

Excel FALSE Function

Excel FALSE function returns the logical value FALSE. It does not take any input arguments.

Excel IF Function

Excel IF Function is best suited for situations where you want to evaluate a condition, and the return a value if it is TRUE and another value if it is FALSE.

Excel IFS Function

Excel IFS Function is best suited for situations where you want to test multiple conditions at once and then return the result based on it. This is helpful as you don’t have to create long nested IF formulas that can get confusing.

Excel IFERROR Function Excel IFERROR function is best-suited to handle formula that evaluates to an error. You can specify a value to show if the formula returns an error.
Excel NOT Function

Excel NOT function can be used when you want to reverse the value of a logical argument (TRUE/FALSE).

Excel OR Function Excel OR function can be used when you want to check multiple conditions. It returns TRUE if any of the given condition is true.
Excel TRUE Function

Excel TRUE function returns the logical value TRUE. It does not take any input arguments.

Excel Functions – Lookup & Reference

Excel Function Description
Excel COLUMN Function

Excel COLUMN function can be used when you want to get the column number of a specified cell.

Excel COLUMNS Function

Excel COLUMNS function can be used when you want to get the number of columns in a specified range or array. It returns a number that represents the total number of columns in the specified range or array.

Excel HLOOKUP Function

Excel HLOOKUP function is best suited for situations when you are looking for a matching data point in a row, and when the matching data point is found, you go down that column and fetch a value from a cell which is specified a number of rows below the top row.

Excel INDEX Function

Excel INDEX function can be used when you have the position (row number and column number) of a value in a table, and you want to fetch that value. This is often use with the MATCH function and is a powerful alternative to the VLOOKUP function.

Excel INDIRECT Function

Excel INDIRECT function can be used when you have the references as text and you want to get the values from those references. It returns the reference specified by the text string.

Excel MATCH Function

Excel MATCH function can be used when you want to get the relative position of a lookup value in a list or an array. It returns a number that represents the position of the lookup value in the array.

Excel OFFSET Function

Excel OFFSET function can be used when you want to get a reference which offsets specified number of rows and columns from the starting point. It returns the reference that OFFSET function points to.

Excel ROW Function

Excel ROW Function function can be used when you want to get the row number of a cell reference. For example, =ROW(B4) would return 4, as it is in the fourth row.

Excel ROWS Function

Excel ROWS Function can be used when you want to get the number of rows in a specified range or array. It returns a number that represents the total number of rows in the specified range or array.

Excel VLOOKUP Function

Excel VLOOKUP function is best suited for situations when you are looking for a matching data point in a column, and when the matching data point is found, you go to the right in that row and fetch a value from a cell which is a specified number of columns to the right.

Excel XLOOKUP Function

Excel XLOOKUP function is a new function for Office 365 users and is an enhanced version of the VLOOKUP/HLOOKUP functions. It can be used to lookup and fetch the value in a dataset, and can replace most of what we do with older lookup formulas.

Excel FILTER Function

Excel FILTER function is a new function for Office 365 users that allows you to quickly filter and extract data based on the given condition (or multiple conditions).

Excel Functions – Math

Excel Function Description
Excel INT Function

Excel INT Function can be used when you want to get the integer portion of a number.

Excel MOD Function

Excel MOD function can be used when you want to get the remainder when one number is divided by another. It returns a numerical value that represents the remainder when one number is divided by another.

Excel RAND Function

Excel RAND function can be used when you want to generate evenly distributed random numbers between 0 and 1. It returns a number between 0 and 1

Excel RANDBETWEEN Function

Excel RANDBETWEEN function can be used when you want to generate evenly distributed random numbers between a top and bottom range specified by the user. It returns a number between the top and bottom range specified by the user.

Excel ROUND Function

Excel ROUND function can be used when you want to return a number rounded to a specified number of digits.

Excel SUM Function Excel SUM function can be used to add all numbers in a range of cells.
Excel SUMIF Function

Excel SUMIF function can be used when you want to add the values in a range if the specified condition is met.

Excel SUMIFS Function

Excel SUMIFS function can be used when you want to add the values in a range if multiple specified criteria are met.

Excel SUMPRODUCT Function

Excel SUMPRODUCT function can be used when you want to first multiply two or more sets to arrays and then get its sum

Excel Functions – Statistics

Excel Function Description
Excel RANK Function

Excel RANK function can be used when you want to rank a number against a list of numbers. It returns a number that represents the relative rank of the number against the list of numbers.

Excel AVERAGE Function

Excel AVERAGE function can be used when you want to get the average (arithmetic mean) of the specified arguments.

Excel AVERAGEIF Function

Excel AVERAGEIF function can be used when you want to get the average (arithmetic mean) of all the values in a range of cells that meet a given criteria.

Excel AVERAGEIFS Function

Excel AVERAGEIFS function can be used when you want to get the average (arithmetic mean) of all the cells in a range that meets multiple criteria.

Excel COUNT Function Excel COUNT function can be used to count the number of cells that contain numbers.
Excel COUNTA Function

Excel COUNTA function can be used when you want to count all the cells in a range that are not empty.

Excel COUNTBLANK Function

Excel COUNTBALNK function can be used when you have to count all the empty cells in a range.

Excel COUNTIF Function

Excel COUNTIF function can be used when you want to count the number of cells that meet a specified criterion.

Excel COUNTIFS Function

Excel COUNTIFS function can be used when you want to count the number of cells that meet a single or multiple criteria.

Excel LARGE Function

Excel LARGE function can be used to get the Kth largest value from a range of cells or array. For example, you can get the third largest value from a range of cells.

Excel MAX Function

Excel MAX function can be used when you want to get the largest value from a set of values.

Excel MIN Function

Excel MIN function can be used when you want to get the smallest value from a set of values.

Excel SMALL Function

Excel SMALL function can be used to get the Kth smallest value from a range of cells or array. For example, you can get the third smallestvalue from a range of cells.

​Excel Functions – Text Functions

Excel Function Description
Excel CONCATENATE Function

Excel CONCATENATE function can be used when you want to join 2 or more characters or strings. It can be used to join text, numbers, cell references, or a combination of these.

Excel FIND Function

Excel FIND function can be used when you want to locate a text string within another text string and find its position. It returns a number that represents the starting position of the string you are finding in another string. It is case-sensitive.

Excel LEFT Function Excel LEFT function can be used to extract text from left of the string. It returns the specified number of characters from the left of the string
Excel LEN Function

Excel LEN function can be used when you want to get the total number of characters in a specified string. This is useful when you want to know the length of a string in a cell.

Excel LOWER Function

Excel LOWER function can be used when you want to convert all uppercase letter in a text string to lowercase. Numbers, special characters, and punctuations are not changed by the LOWER function.

Excel MID Function

Excel MID function can be used to extract a specified number of characters from a string. It returns the sub-string from a string.

Excel PROPER Function

Excel PROPER function can be used when you want to capitalize the first character of every word. Numbers, special characters, and punctuations are not changed by the PROPER function.

Excel REPLACE Function

Excel REPLACE function can be used when you want to replace a part of the text string with another string. It returns a text string where a part of the text has been replaced by the specified string.

Excel REPT Function

Excel REPT function can be used when you want to repeat a specified text a certain number of times.

Excel RIGHT Function The RIGHT function can be used to extract text from the right of the string. It returns the specified number of characters from the right of the string
Excel SEARCH Function

Excel SEARCH function can be used when you want to locate a text string within another text string and find its position. It returns a number that represents the starting position of the string you are finding in another string. It is NOT case-sensitive.

Excel SUBSTITUTE Function

Excel SUBSTITUTE function can be used when you want to substitute text with new specified text in a string. It returns a text string where an old text has been substituted by the new one.

Excel TEXT Function

Excel TEXT function can be used when you want to convert a number to text format and display it in a specified format.

Excel TRIM Function Excel TRIM function can be used when you want to remove leading, trailing, and double spaces in Excel.
Excel UPPER Function Excel UPPER function can be used when you want to convert all lowercase letters in a text string to uppercase. Numbers, special characters, and punctuations are not changed by the UPPER function.

Excel Functions – Info

Excel Function Description
Excel ISBLANK Function

Excel ISERROR Function

Excel ISNA Function

Excel ISNUMBER Function

Excel ISEVEN Function

Excel ISODD Function

Excel ISLOGICAL Function

Excel ISTEXT Function

Excel IS function returns TRUE when specified condition is TRUE. For example, ISNA would return TRUE if the cell has a #N/A! error.

Excel Functions – Financial

Excel Function Description
​Excel PMT Function Excel PMT function helps you calculate the payment you need to make for a loan when you know the total loan amount, interest rate, and the number of constant payments.
Excel NPV Function Excel NPV function allows you to calculate the Net Present Value of all the cashflows when you know the discount rate
Excel IRR Function Excel IRR function allows you to calculate the Internal Rate of Return when you have the cashflows data

VBA Functions

Excel Function Description
VBA TRIM Function

VBA TRIM function allows you to remove the leading and trailing spaces from a text string in Excel. It can be a useful VBA function if you want to quickly clean the data.

VBA SPLIT Function

VBA SPLIT function alllows you to split a text string based on the delimiter. For example, if you want to split text based on a comma or tab or colon, you can do that with the SPLIT function.

VBA MsgBox Function

VBA MsgBox is a function that displays a dialog box that you can use to inform your users by showing a custom message or get some basic inputs (such as Yes/No or OK/Cancel).

VBA INSTR Function

VBA InStr function finds the position of a specified substring within the string and returns the first position of its occurrence.

VBA UCase Function

Excel VBA UCASE function takes a string as the input and converts all the lower case characters into upper case.

VBA LCase Function

Excel VBA LCASE function takes a string as the input and converts all the upper case characters into lower case.

VBA DIR Function

Use VBA DIR function when you want to get the name of the file or a folder, using their path name

Useful Excel Resources:

  • 100+ Excel Interview Questions
  • 200+ Excel Keyboard Shortcuts
  • Free Excel Templates
  • Free Online Excel Training
  • Best Excel Books
  • Excel Formulas Not Working: Possible Reasons and How to FIX IT!
  • 20 Advanced Excel Functions and Formulas (for Excel Pros)
  • Formula vs Function in Excel – What’s the Difference?

The complete Excel Functions list includes lookup, logic, date and time, text, information, and math functions with examples. Excel Functions are built-in presets, so Excel functions are hard-coded formulas with short, user-friendly names.

The list contains 300+ built-in Excel functions. Furthermore, look at the library of useful advanced functions (UDFs). If you want to jump to a specific category, use the list below; else, use the Search box for the latest tutorials.

  • User-defined functions (must-have)
  • Logical
  • Text
  • Lookup
  • Date and Time
  • Dynamic array
  • Information
  • Math
  • Statistical
  • Financial

Excel Function List

Logical

The functions below use logical tests and logical operators to evaluate a formula. Learn more about Boolean expressions.

LOOKUP

Here is the list of lookup functions in Excel. Of course, we already know that XLOOKUP changes everything. But it is worth keeping in mind the older lookup functions too.

User-defined functions

UDFs are advanced functions.

Date and Time

Date and Time functions help you create calculations based on dates and times.

Text

Text functions in Excel enable you to perform various calculations using strings.

Dynamic Array

Dynamic Arrays are resizable arrays. From now, Excel calculates the array automatically and returns values into multiple cells based on a formula entered in a single cell.

Information

Take a quick overview of information functions in Excel.

Math

Math Functions are great.

Math – Part 2

Financial

Use financial functions if you want.

Financial – Part 2

Statistical

Statistical – Part 2

Trigonometry

Engineering

Database

How to use Excel Functions?

To use a function, type an equal sign (=) in the formula bar or the cell to enter a function you want to use. After that, enter the function’s name and the arguments. There are custom functions in Excel, user-defined functions. If you want to learn more about how to solve complex tasks using UDFs, read our guide.

Microsoft Excel Tutorial – How to Create Formulas and Functions

Spreadsheets aren’t merely for arranging data into rows and columns. Most of the time, you use them for data analysis as well.

Microsoft Excel is one of the most widely used spreadsheet applications, especially in finance and accounting. This is partly because of its easy UI and unmatched depth of functions.

In this article, you will learn:

  • What Excel formulas are
  • How to write a formula in Excel
  • What Excel functions are
  • How to work with an Excel function
  • Lastly, we’ll take a look at dynamic Excel functions.

What do I need to install on my computer to follow this article?

To follow along, you will need to have Microsoft Excel installed on your computer. We’ll use a Windows computer for this article.

How can I install Microsoft Excel on my computer?

Follow these steps to install Microsoft Excel on your Windows computer:

  1. Sign in to www.office.com if you’re not already signed in.
  2. Sign in with the account associated with your Microsoft 365 subscription. You can also try out Office for free as well.
  3. Once signed in, select “Install Office” from the Office home page. This will automatically download Microsoft Office onto your Windows computer.
  4. Run the installer to set up Microsoft Office and select «Close» once you’re done.
  5. Once done, select the “Start” button (located at the lower-left corner of your screen) and type “Microsoft Excel.”
  6. Click on Microsoft Excel to open it.
  7. Accept the license agreement, and let’s get started.

What are Excel Formulas?

An Excel formula is an expression that carries out an operation based on the value of a cell or range of cells. You can use an Excel formula to:

  • Perform simple mathematical operations such as addition or subtraction.
  • Perform a simple operation like joining categorical data.

It’s important to understand two things: Excel formulas always begin with the equals «=» sign and they can return an error if not properly executed.

What Operators Are Used in Excel Formulas?

There are four different types of operators in Excel—arithmetic, comparison, text concatenation, and reference. But for most formulas, you’ll typically use these three:

Arithmetic operators

+

Addition

Subtraction

/

Division

*

Multiplication

^

Exponentiation

Comparison operators

=

Equal to

>

Greater than

<

Less than

>=

Greater than or equal to

<=

Less than or equal to

<>

Not equal to

Text concatenation

Here you have just the ampersand “&” sign for joining text.

How Can I Create an Excel Formula?

Let’s take a simple scenario using one of the arithmetic operators.

In math, to add up two numbers, let’s say 20 and 30, you will calculate this by writing: 20 + 30 =

And this will give you 50.

In Excel, here is how it goes:

  1. First, open a blank Excel worksheet.
  2. In cell A1, type 20.
  3. In cell A2, type 30.
  4. To add it up, type in = 20 + 30 in cell A3.

ahFv4-tCq-5p6B9wWJwrfv-0glehpnu9gMnAw34pwCUh9hUVyw3p5aOu5ejIAnCPBDtw6g_CTOOWaEtap1ph2XP5nL9TkxVb2E5iV80tp6Tm73968jE3kyCPKaMkrVYpw1Mn4rYBxXMSrU5CzEkSlxNhBp-KiZLfEtDAOagAzGHa6RWO5yLaZsyevQ

How can I create an Excel formula?

5.  Then, press ENTER on your keyboard. Excel will instantly calculate this and return 50.

XGXatK9hD_imhCrF3wQ-NuzlOzCgW0TCysQ0vwtk-Xz8Wu-W5ZxIKf65DBbc0i5H2_ubVC4rBoiyVauMcOWdapOwqGwhANyNKhwS_us0CTFMBP76q2wP3HGksmsWvb8ebB6cLG_3RzWSp2vie7woGbTZTuMmaPsnwa5oFoP8gFNf6RwbJa4O-hnVzQ

How can I create an Excel formula? Adding numbers in Excel

I mentioned earlier that every formula begins with the equal «=» sign. That’s what I meant. To write a formula, you type the equal to sign followed by the numeric values. This also applies to cases of subtraction, division, multiplication, and exponentiation.

Let’s take another simple scenario using one of the comparison operators. Assume we want to find out if 30 is greater than 40.

In Excel, here is how we would do it:

  1. Type in =30>40
  2. Press ENTER.

j7NqF7FlQbtnSWU_QiE2pHtmsadofCUgJHkXKTEEp2miFXV24QjJMMyZrP-sVibNuM__jgW1szMEQjuFtz4gb9ZbOm6n5UtWtGNktWd3iOEcnbTFH4_4GftYs_FLySTkeWhA51MujOKvZGAkdYN96hzyGb86Na_dKhawPQFXRNtP7jI87Azo1FZ1qA

How can I create an Excel formula? Comparison operators

3.  This will return a FALSE because 30 isn’t greater than 40. Excel uses TRUE and FALSE for logical statements, the same way we human says yes and no.

rmJNrTzMCS3Qg0nIk-1DqURQuqfO2qF-0eqiF4RyAsM9lPDGtVyDpzsJryzN-7BXrv3qGbIhRjw2NGNKHiMVaHlWwnqVWigvlu35dqTUgHaxGshud8n3bdsnwrJ9cXPMLASLQDMKoAJqRjivuqgA_WQpYZaUMDq4T41LMJzgivLeqd5LN2_zrsmTrA

How can I create an Excel formula? Comparison operators 

Lastly, let’s take another simple scenario using the text concatenation operator – the ampersand “&” sign. This works with your string data types and you use it to join text.

Assume we have «Welcome», «To», and «FreeCodeCamp» all in different cells—A1, A2, and A3—of your worksheet. We would type =A1&” “&A2&” “&A3 to join them.

The space in quotes “ “ represents that we want a space between our words.

_NuH8HoSTLRA4zTSGaCkcCwLKhjZVYy885wThXg_NgwYsyIDEk_6APoloy2wujJUNZUkXsBTFDr-dmO_x3B_4WU0XQUaBJGiNz6gTlPC3lqR2U5utRsK9S3R9yxoRi4U9N1zvH92LMW-F97cn5hx1_k09du0tYxFERxtg5w5Zl8M4Bw_HSyF8maq6w

How can I create an Excel formula using the ampersand “&” sign

Another tip: the formula bar shows the formula used to generate a value.

What Are Excel Functions?

Excel functions are predefined inbuilt formulas that perform mathematical, statistical, and logical calculations and operations using your values and arguments.

For Excel functions, you should know that:

  • They’re formulas, so yeah, they start with the equal «=» sign as well.
  • The order is very important.

There are over 500 functions available. You can find all available Excel functions on the Formulas tab on the Ribbon.

GL6J_F_ao0U-lmLQs8CCZHrjxGZz5l_zF9b7EAn6lirKVRx9YZ86PCw6UTrCFBFhPDaiEUBSpLA8fOZcj43CW7oDWYlcxjEHXMXe5cSphegI2HpdfjrJxoXaWcP8wCEK9gAV30rqE89Gd08y1pj5vI5JGSCfDgdUg8lxu2MT9S-KgnFahn5o-H2x7A

All available Excel formulas and functions

But why use a function when you can just write a formula?

Here are some benefits of Excel functions.

  • To improve productivity and effectiveness.
  • To simplify complex calculations.
  • To automate your work.
  • To quickly visualize data.

What Makes Up Excel Functions?

Unlike formulas, Excel functions are made up of a structure with arguments you need to pass.

Every function:

  • Starts with the equals «=» sign
  • Has a name. Some examples are VLOOKUP, SUM, UNIQUE, and XLOOKUP.
  • Requires arguments which are separated by commas. You should know that semicolons are used as separators in countries like Spain, France, Italy, Netherlands, and Germany. You can, however, change this via the Excel setting.
  • Argument with the square brackets [] are optional
  • Has an opening and closing parenthesis.
  • Has an argument tooltip which shows you what you should pass.

There are some exceptions. For example,

  • The DATEDIF doesn’t show in Excel because it is not a standard function and gives incorrect results in a few circumstances. However, here is the syntax:

DATEDIF(birthdate, TODAY(), "y")

  • Functions like PI(), RAND(), NOW(), TODAY() require no argument.

Let’s look at a few functions:

How to Use the SUM() Function in Excel

According to the documentation, the SUM function adds values. Here is the syntax:

image-315

Excel Sum Syntax

Let’s assume that we have a line of numbers from 1 to 10 and we want to add it up. To achieve this, we will just type =SUM(A1:A10). The A1:A10 simply returns an array of number that are situated on cell A1 to A10 which are A1, A2, and A3 up through A10.

oj-2CwOiYRuzMhsH6oyy8zMFUCw9EpTPQWtLhkUbsbigzk-U6RG_dDG_aVeazYkgIQmuil80wG0N6_t3yk9oqF3EKjdSoREj8c-PqACBgOkZX763fMyM4oLKnGVharikQAFt0SNEvkxO1bnN67LQs3LLfQ-LW2R37IFVJGXz7KvJ1Wu_S7imz-0YsA

How to use Sum in Excel

Since the second argument is optional, that means a sum(A10) will return a value. In our case, it will return just 10 since A10 has the value 10 in it. Give it a try.

If you were writing this using the addition operator, you would have written:

=1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10

or

=A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10

This doesn’t look very productive or efficient.

How to Use the TODAY() Function in Excel

According to the documentation, the TODAY function displays the current date on your worksheet. It also requires no argument. Here is the syntax:

o0zz_IZW5soeg7kcBLmaruiuCHlVhyR4C3_-D0lDhtXV0xDZU4JnapR9q_QbyXOdsSN_n8Ko0owSMITVXWbOjZml2GATMUBx4h9QcNpQsbz6B1BsDbxvoK2N-cuyw5I7OcwyyAJI8BbnPXiU2pVAYmQ26SnXHrWQt2DFsiWi5l6oo_U4dEo6cruImA

How to use Today() in Excel

Excel displays the current date automatically according to your computer’s date and time setting. The same goes for the NOW() function, which displays the current date and time.

How to Use the CONCATENATE() Function in Excel

Let’s look at a text function. You use CONCATENATE to join two or more text strings into one string together.

Here is the syntax:

image-316

Excel CONCATENATE() Syntax

Let’s assume we want to join “This is” with “freeCodeCamp” – but in your cell, you have just «freeCodeCamp.»

image-320

freeCodeCamp Excel

If you’re going to write a string inside a formula, you must write it inside quotes like this “ “.

Why?

This way, Excel wouldnt think you’re trying to write another function.

image-319

How to use Excel CONCATENATE function

This will return the phrase “This is freeCodeCamp”

image-321

How to use CONCATENATE() in Excel

How to Use the VLOOKUP() Function in Excel

This is one of Excel’s most interesting and commonly used formulas or functions. You use it to find a value in a table or range by row.

Here is a scenario:

We have a simple table that shows various films along with their genre, lead studio, audience score %, profitability, rotten tomatoes %, worldwide gross and year. I would use just the first 10 rows of the sample data from this GitHub Gist.

T12acvhR4WeGpmxjG8Ye9-nif_k8r-trYb3Zacz9PZjxRDZJOQd1weeIx06Soa-QRsriVCuaGrJ2B_-6klJcxyuRKh7cmoIPre-cbHecnxvooo6AEYd5pgc_Dz2keINjCm-yF3Vw1HtcQTfzMK938gUK5Ybks72moTZEGuPmnHVHS2-yHv38hRvArg

Flim dataset

I want that, whenever I type in a movie in the yellow cell, the year should get displayed in the green cell. Let’s use VLOOKUP to find it.

This is the VLOOKUP syntax:

image-317

Excel Vlookup Syntax

Besides writing your formulas in the cell, you can also write them using the Excel Insert Function (fx) button, which is close to the formula bar.

Let’s try this.

  1. Write =Vlookup( on the green cell.
  2. Click on fx. A dialogue box will pop up showing all the arguments this formula needs.
  3. Input the value for each argument.
  4. Lookup_value (required argument): This is what you want to find. In our case, that is the movie “Youth in Revolt” which is in cell B1.
  5. Table_array (required argument): This is just asking you for the table that contains the data. You give it the entire table, which in our case is A4:H13
  6. Col_index_num (required argument): This is asking you for the column number of the table you gave. In our case, we want the year. This is in column 8.
  7. Range_lookup (optional argument): Lastly, we pick if we want an approximate match (TRUE) or an exact match (FALSE).

— TRUE means approximate match, so it returns the closest or an estimate.

—  FALSE means exact match, so it returns an error if it’s not found.

8. We would go for the FALSE because we want the exact match.

T-VtgAKve9lXEP8VA5FATji23YJveuZJfqWEnde330eLDw0gJj2hn1Qol5R1fVqs9aFYPoxFZ9Y5XLwth6MHWgYH55i0Llz-gS8m2_r7aEViaDD_3_Gpow5rWATdGtCBVlPTolM-9zZ2hono6lsBiN-l_DM7pVjLzk7oOZ-GYO8unxTQF7unpzA5MA

How to use VLOOKUP() in Excel

9. Click on «OK.» Excel will return 2010.

However, you can write this in the cell by typing in =VLOOKUP(B1,A4:H13,8,FALSE) in your cell.

fhQrWy2DvFXRtscCz_H-DbZE73claukadh-KwtU5XGuxmZWDwtDlo60aM7cqBS3iPpayxfB3DH6NeFFH2j19l2M3QXM7RCUlYrGHRUlxcFAmEUylwj4g1b8k00lYx_8FWrEQl4cJyxmhoUPLlxJuALoUtO5F06SQl1_0nWusaza0nWFwZmO4T-3qGA

How to use VLOOKUP() in Excel

Tips and Rules When Writing Excel Functions

When writing our function, Excel provides some formula tips.

  1. The Argument tooltip doesn’t leave until you close the last parenthesis.
  2. The formula bar shows your formula.
  3. The argument you are currently writing is always dark. Take a look at the lookup_value in the image below.
  4. The square brackets [] tell you it is optional.
  5. Lastly, the colour code – our B1 is in blue, and cell B1 is in blue to guide us on what cell or table was picked. The same thing will happen to A4:H13 when we pick it as our table_array argument.

DVOp6zoa3z8cC01iE0iW01CcMv3ceE3WId7qu-2peocY8HkJf3ltmXHfAgHjj9Sj-7w-NS0DugruBR8FTCTRW77AFLRmdwM_UY83pXcFv3M6FHZBHFpWXy6B02ocko1NtC15GpHenEzBjU2w13i5SorlHU_6FdfA12iycyevjQhgnu6Mr78_CwkRSw

Vlookup and Excel formula bar

How to Work with Nested Functions in Excel

A nested function is when you write a function within another function. For example, finding the average of the sum of values.

The first tip when writing a nested function will be to treat every function individually. So address the first function before addressing the second. A pro tip would be to look at the argument tooltip when writing it.

Let’s take a simple scenario.

We have two arrays of numbers. Each has the scores of students in the class. I want to add the two arrays before I get the average.

Let’s get started.

  1. Type in your = followed by the average.
  2. The number one will be the sum of the scores from class one.
  3. The number two will be the sum of the scores from class two.

image-318

Nested Function: Excel AVERAGE and SUM syntax
SBV3QpbGiSsXkDoXBpRaRfbjVUjJckLV0crBJ2u5iptUb0C10poCJZIZltv0b13tTTXpABVQ9CvHoAC2S5gwCNMxhaTFX3Y1oyRgNehxFEHPRf_Sm9--HQmVh8ZsVWKsWs2EfQBAEdv6sSTqTP2tmr0JXPb44UmLOO82OzM3oERfntfhPyHQaf1b_w
Excel AVERAGE syntax

Finally, don’t forget the closing parenthesis.

Thus, the formula will be =AVERAGE(SUM(B3:B8),SUM(D3:D8)).

How to Work with Dynamic Array Functions in Excel

Dynamic array functions are formulas associated with spill array behaviour.

Before now, you wrote a function and it returned just a single input. We call these kinds of functions legacy array formulas.

Dynamic array functions, on the other hand, will return values that will enter the neighbouring cells. A few examples of dynamic array functions are:

  • UNIQUE
  • TEXTSPLIT
  • FILTER
  • SEQUENCE
  • SORT
  • SORTBY
  • RANDARRAY

Let’s look at the UNIQUE formula.

How to Use the UNIQUE() Formula in Excel

The unique formula works by returning the unique value from an array or list. Let’s use the movie sample data from this GitHub Gist. This table contains 77 rows of film excluding the heading.

cgULd4fUAfw1b4J5Q2utiNG_bPSaicGK6vEtuNKS6zCL2IFgoq8ivfZL_UMTTUcRUNc-nVDRxx8O6gQUCba1Eoko6U588n18CsiuBigsVS83V8W8bLZjtltBOqIkWUJRDhhamJzGzqz3FWn_sgVAB3oLJx5L7JOEike_iawhMd7fQHinqfSb_MoaxA

Flim data GitHub

Let’s try to get the unique years from our dataset – that is, years without duplicates.

To do this:

  1. Type =UNIQUE(
  2. Select the entire array of values from the year column: =UNIQUE(H2:H78)

mdX9zeClRBtGuzdHukis2gU-2RcH1K2rJvLrUHbSXN2ECokzYTn6SWSLuE2UOACXx3J2DrJQTauzLIb2u5Eqgq1LGvUJXVhpYAZD29CKZnWMBaId2O_6AFHtPJLFbz1FsG7dSIq8zMeRivRwG-qdpw74JG_Qglu4yrlgWIH-8ycQRMQ4cqp1ZNbSgQ

How to use Excel UNIQUE formula

3. Close the parenthesis and press Enter.

Though the formula was written in a single cell, the returned value got spilled into the cells below it. That’s the spilled array behaviour.

BM4eUSa5hvjSJF4Md2eizx-N97bc2dOdV0LwGYKLErjP4acTf0oCYnjYLhuxs3JHcF7YHyONMWTbXH24Epmc0AT6kvmyL_cg6d0shcKjEmvVL9wN_YQXMpTIGKoh-1dgmfyqUg102K67JsjUGycCMogiCzsIK7E53e7rZ5qd_buCQfylmIH4jHPtaQ

Excel dynamic array formula

How to Create Your Own Functions in Excel

Microsoft Excel released a bunch of new functions to make user more productive. One of these function was the LAMBDA function.

The LAMBDA function lets you create custom functions without macros, VBA or JavaScript, and reuse them throughout a workbook.

The best part? you can name it.

How to Use the LAMBDA() Function in Excel

This LAMBDA function will increase productivity by eliminating the need to copy and paste this formula, which can be error-prone.

Here is the LAMBDA syntax:

image-322

Excel LAMBDA function

Lets start with a simple use case using the movie sample data from this GitHub Gist.

image-323

The Movie dataset

We had a column called «Worldwide Gross», lets try to find the Naira value.

  1. Create a new column and call it «Worldwide Gross in Naira».
  2. Right below our column name, Cell I2, type =lAMBDA(
  3. LAMBDA requires a parameter and/or a calculation.

The parameter means the value you want to pass, in our use case we want to change the gross value. Lets call it gross.

The calculation means the formula or function you want to execute. For us, that will be to multiply it with te exchange rate. At the moment, that’s 670. so lets write gross * 670.

image-328

How to use LAMBDA function in Excel

4. Press Enter. This will return an error because, gross doesnt exist and you need to let excel know of these names.

image-329

Using Excel LAMBDA

5. To make use of the newly created function, you need to copy the syntax written.

image-330

Writing function with Excel LAMBDA

6. Go to the formula ribbon and open the name manager.

image-332

Excel name manger using the LAMBDA function

7. Define the name manger parameters:

  • The name is simply what you want to call this function. I am going with NairaConvert.
  • The scope should be workbook because you want to use this function in the workbook.
  • The comments explains what your function does. It is acts as a documentation.
  • In the refer to, you should paste the copied function syntax.

image-333

Excel name manager

8. Press Ok.

9. To use this new function, you call it with the name you defined it as—NairaConvert—and give it the gross which is our worldwise gross on G2.

image-334

Custom function with LAMBDA

10. Close the parenthesis and press Ok

image-336

Calculating with Excel LAMBDA

Where Can I Learn More about Excel?

There are a ton of resources for learning Microsoft Excel nowadays. So many that it is hard to figure out which ones are up-to-date and helpful.

The best thing you can do is find a helpful tutorial and follow it to completion, instead of attempting to take several at once. I would advise you to start with freeCodeCamp’s Microsoft Excel Tutorial for Beginners — Full Course, which is available on YouTube.

You should also join communities like the Microsoft Excel and Data Analysis Learning Community. However, if you’re looking for a compilation of resources, check out freeCodeCamp’s publication Excel tags.

If you enjoyed reading this article and/or have any questions and want to connect, you can find me on LinkedIn or Twitter.



Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Formulas and functions are the building blocks of working with numeric data in Excel. This article introduces you to formulas and functions.

In this article, we will cover the following topics.

  • What is Formulas in Excel?
  • Mistakes to avoid when working with formulas in Excel
  • What is Function in Excel?
  • The importance of functions
  • Common functions
  • Numeric Functions
  • String functions
  • Date Time functions
  • V Lookup function

Tutorials Data

For this tutorial, we will work with the following datasets.

Home supplies budget

S/N ITEM QTY PRICE SUBTOTAL Is it Affordable?
1 Mangoes 9 600
2 Oranges 3 1200
3 Tomatoes 1 2500
4 Cooking Oil 5 6500
5 Tonic Water 13 3900

House Building Project Schedule

S/N ITEM START DATE END DATE DURATION (DAYS)
1 Survey land 04/02/2015 07/02/2015
2 Lay Foundation 10/02/2015 15/02/2015
3 Roofing 27/02/2015 03/03/2015
4 Painting 09/03/2015 21/03/2015

What is Formulas in Excel?

FORMULAS IN EXCEL is an expression that operates on values in a range of cell addresses and operators. For example, =A1+A2+A3, which finds the sum of the range of values from cell A1 to cell A3. An example of a formula made up of discrete values like =6*3.

=A2 * D2 / 2

HERE,

  • "=" tells Excel that this is a formula, and it should evaluate it.
  • "A2" * D2" makes reference to cell addresses A2 and D2 then multiplies the values found in these cell addresses.
  • "/" is the division arithmetic operator
  • "2" is a discrete value

Formulas practical exercise

We will work with the sample data for the home budget to calculate the subtotal.

  • Create a new workbook in Excel
  • Enter the data shown in the home supplies budget above.
  • Your worksheet should look as follows.

Introduction to formulas and functions in Excel

We will now write the formula that calculates the subtotal

Set the focus to cell E4

Enter the following formula.

=C4*D4

HERE,

  • "C4*D4" uses the arithmetic operator multiplication (*) to multiply the value of the cell address C4 and D4.

Press enter key

You will get the following result

Introduction to formulas and functions in Excel

The following animated image shows you how to auto select cell address and apply the same formula to other rows.

Introduction to formulas and functions in Excel

Mistakes to avoid when working with formulas in Excel

  1. Remember the rules of Brackets of Division, Multiplication, Addition, & Subtraction (BODMAS). This means expressions are brackets are evaluated first. For arithmetic operators, the division is evaluated first followed by multiplication then addition and subtraction is the last one to be evaluated. Using this rule, we can rewrite the above formula as =(A2 * D2) / 2. This will ensure that A2 and D2 are first evaluated then divided by two.
  2. Excel spreadsheet formulas usually work with numeric data; you can take advantage of data validation to specify the type of data that should be accepted by a cell i.e. numbers only.
  3. To ensure that you are working with the correct cell addresses referenced in the formulas, you can press F2 on the keyboard. This will highlight the cell addresses used in the formula, and you can cross check to ensure they are the desired cell addresses.
  4. When you are working with many rows, you can use serial numbers for all the rows and have a record count at the bottom of the sheet. You should compare the serial number count with the record total to ensure that your formulas included all the rows.

Check Out
Top 10 Excel Spreadsheet Formulas

What is Function in Excel?

FUNCTION IN EXCEL is a predefined formula that is used for specific values in a particular order. Function is used for quick tasks like finding the sum, count, average, maximum value, and minimum values for a range of cells. For example, cell A3 below contains the SUM function which calculates the sum of the range A1:A2.

  • SUM for summation of a range of numbers
  • AVERAGE for calculating the average of a given range of numbers
  • COUNT for counting the number of items in a given range

The importance of functions

Functions increase user productivity when working with excel. Let’s say you would like to get the grand total for the above home supplies budget. To make it simpler, you can use a formula to get the grand total. Using a formula, you would have to reference the cells E4 through to E8 one by one. You would have to use the following formula.

= E4 + E5 + E6 + E7 + E8

With a function, you would write the above formula as

=SUM (E4:E8)

As you can see from the above function used to get the sum of a range of cells, it is much more efficient to use a function to get the sum than using the formula which will have to reference a lot of cells.

Common functions

Let’s look at some of the most commonly used functions in ms excel formulas. We will start with statistical functions.

S/N FUNCTION CATEGORY DESCRIPTION USAGE
01 SUM Math & Trig Adds all the values in a range of cells =SUM(E4:E8)
02 MIN Statistical Finds the minimum value in a range of cells =MIN(E4:E8)
03 MAX Statistical Finds the maximum value in a range of cells =MAX(E4:E8)
04 AVERAGE Statistical Calculates the average value in a range of cells =AVERAGE(E4:E8)
05 COUNT Statistical Counts the number of cells in a range of cells =COUNT(E4:E8)
06 LEN Text Returns the number of characters in a string text =LEN(B7)
07 SUMIF Math & Trig Adds all the values in a range of cells that meet a specified criteria.
=SUMIF(range,criteria,[sum_range])
=SUMIF(D4:D8,”>=1000″,C4:C8)
08 AVERAGEIF Statistical Calculates the average value in a range of cells that meet the specified criteria.
=AVERAGEIF(range,criteria,[average_range])
=AVERAGEIF(F4:F8,”Yes”,E4:E8)
09 DAYS Date & Time Returns the number of days between two dates =DAYS(D4,C4)
10 NOW Date & Time Returns the current system date and time =NOW()

Numeric Functions

As the name suggests, these functions operate on numeric data. The following table shows some of the common numeric functions.

S/N FUNCTION CATEGORY DESCRIPTION USAGE
1 ISNUMBER Information Returns True if the supplied value is numeric and False if it is not numeric =ISNUMBER(A3)
2 RAND Math & Trig Generates a random number between 0 and 1 =RAND()
3 ROUND Math & Trig Rounds off a decimal value to the specified number of decimal points =ROUND(3.14455,2)
4 MEDIAN Statistical Returns the number in the middle of the set of given numbers =MEDIAN(3,4,5,2,5)
5 PI Math & Trig Returns the value of Math Function PI(π) =PI()
6 POWER Math & Trig Returns the result of a number raised to a power.
POWER( number, power )
=POWER(2,4)
7 MOD Math & Trig Returns the Remainder when you divide two numbers =MOD(10,3)
8 ROMAN Math & Trig Converts a number to roman numerals =ROMAN(1984)

String functions

These basic excel functions are used to manipulate text data. The following table shows some of the common string functions.

S/N FUNCTION CATEGORY DESCRIPTION USAGE COMMENT
1 LEFT Text Returns a number of specified characters from the start (left-hand side) of a string =LEFT(“GURU99”,4) Left 4 Characters of “GURU99”
2 RIGHT Text Returns a number of specified characters from the end (right-hand side) of a string =RIGHT(“GURU99”,2) Right 2 Characters of “GURU99”
3 MID Text Retrieves a number of characters from the middle of a string from a specified start position and length.
=MID (text, start_num, num_chars)
=MID(“GURU99”,2,3) Retrieving Characters 2 to 5
4 ISTEXT Information Returns True if the supplied parameter is Text =ISTEXT(value) value – The value to check.
5 FIND Text Returns the starting position of a text string within another text string. This function is case-sensitive.
=FIND(find_text, within_text, [start_num])
=FIND(“oo”,”Roofing”,1) Find oo in “Roofing”, Result is 2
6 REPLACE Text Replaces part of a string with another specified string.
=REPLACE (old_text, start_num, num_chars, new_text)
=REPLACE(“Roofing”,2,2,”xx”) Replace “oo” with “xx”

Date Time Functions

These functions are used to manipulate date values. The following table shows some of the common date functions

S/N FUNCTION CATEGORY DESCRIPTION USAGE
1 DATE Date & Time Returns the number that represents the date in excel code =DATE(2015,2,4)
2 DAYS Date & Time Find the number of days between two dates =DAYS(D6,C6)
3 MONTH Date & Time Returns the month from a date value =MONTH(“4/2/2015”)
4 MINUTE Date & Time Returns the minutes from a time value =MINUTE(“12:31”)
5 YEAR Date & Time Returns the year from a date value =YEAR(“04/02/2015”)

VLOOKUP function

The VLOOKUP function is used to perform a vertical look up in the left most column and return a value in the same row from a column that you specify. Let’s explain this in a layman’s language. The home supplies budget has a serial number column that uniquely identifies each item in the budget. Suppose you have the item serial number, and you would like to know the item description, you can use the VLOOKUP function. Here is how the VLOOKUP function would work.

Introduction to formulas and functions in Excel

=VLOOKUP (C12, A4:B8, 2, FALSE)

HERE,

  • "=VLOOKUP" calls the vertical lookup function
  • "C12" specifies the value to be looked up in the left most column
  • "A4:B8" specifies the table array with the data
  • "2" specifies the column number with the row value to be returned by the VLOOKUP function
  • "FALSE," tells the VLOOKUP function that we are looking for an exact match of the supplied look up value

The animated image below shows this in action

Introduction to formulas and functions in Excel

Download the above Excel Code

Summary

Excel allows you to manipulate the data using formulas and/or functions. Functions are generally more productive compared to writing formulas. Functions are also more accurate compared to formulas because the margin of making mistakes is very minimum.

Here is a list of important Excel Formula and Function

  • SUM function = =SUM(E4:E8)
  • MIN function = =MIN(E4:E8)
  • MAX function = =MAX(E4:E8)
  • AVERAGE function = =AVERAGE(E4:E8)
  • COUNT function = =COUNT(E4:E8)
  • DAYS function = =DAYS(D4,C4)
  • VLOOKUP function = =VLOOKUP (C12, A4:B8, 2, FALSE)
  • DATE function = =DATE(2020,2,4)

Понравилась статья? Поделить с друзьями:
  • Worksheet vba excel описание
  • Working with excel powershell
  • Worksheet selectionchange vba excel
  • Working with excel in python
  • Worksheet save as excel