What are excel formulas and functions

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.

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)

Data comes to use only when you can actually work on it and Excel is one tool that provides a great amount of convenience both when you have to formulate equations of your own or make use of the built-in ones. In this article, you will be learning how you can actually work with these Excel Formulas ad Functions.

Here is a quick look at the topics that are discussed over here:

  • What is a Formula?
  • Writing Excel Formulas
  • Editing a Formula
  • Copy/ Paste a Formula
  • Hide Formulas in Excel
  • Operator Precedence Excel Formulas
  • What are Functions in Excel?
  • Most Important Functions 

What is a Formula?

In general, a formula is a condensed way of representing some information in terms of symbols. In Excel, formulas are expressions that can be entered into the cells of an Excel sheet and their outputs are displayed as a result. 

Excel formulas can be of the following types:

Type

Example

Description

Mathematical operators( +, -, *, etc)

Example: =A1+B1

Adds the values of A1 and B1

Values or text

Example: 100*0.5 multiples 100 times 0.5

Takes the values and returns the output

Cell reference

EXAMPLE: =A1=B1

Returns TRUE or FALSE by comparing A1 and B1

Worksheet functions

EXAMPLE: =SUM(A1: B1)

Returns the output by adding values present in A1 and B1

Writing Excel Formulas:

In order to write a formula to an Excel sheet cell, you can do as follows:

  • Select the cell where you want the result to be displayed
  • Type a “=” sign initially to let Excel know that you are going to enter a formula in that cell
  • After that, you can either type the cell addresses or specify the values that you intend to calculate
  • For example, if you want to add the values of two cells, you can type in the cell address as follows:

enter formula-Excel Formulas-Edureka

  • You can also select the cells whose sum you want to calculate by selecting all the required cells while pressing down the Ctrl key:

enter formula-Excel Formulas-Edureka

Editing a Formula:

In case you want to edit some previously entered formula, simply select the cell that contains the target formula and in the formula bar you can make the desired changes. In the previous example, I have calculated the Sum of A1 and A2. Now, I will edit the same and change the formula to calculate the product of the values present in these two cells:

Editing Formula in Excel-Edureka

Once this is done, press Enter to see the desired output.

Copy or Paste a Formula:

Excel comes in really handy when you have to copy/ paste formulas. Whenever you copy a formula, Excel automatically takes care of the cell references that are required at that position. This is done through a system called as Relative Cell Addresses.

To copy a formula, select the cell that holds the original formula and then drag it till that cell which requires a copy of that formula as follows:

Copy formula1 Exel-Edureka

Copy formula2 Exel-Edureka

As you can see in the image, the formula is written originally in A3 and then I have dragged it down along B3 and C3 to calculate the sum of B1, B2 and C1, C2 without exclusively writing down the cell addresses.

In case I change the values of any of the cells, the output will be updated automatically by Excel in accordance with the Relative Cell Addresses, Absolute Cell Addresses or Mixed Cell Addresses.

Hide Formulas in Excel:

In case you want to hide some formula from an excel sheet, you can do it as follows:

  • Select the cells whose formula you intend to hide
  • Open the Font window and select the Protection pane
  • Check the Hidden option and click on OK
  • Then, from the ribbon tab, select Review
  • Click on Protect sheet (Formulas will not work if you do not do this)
  • Excel will ask you to enter a password in order to unhide the formulas for future use

Operator Precedence of Excel Formulas:

Excel formulas follow the BODMAS (Brackets Order Division Multiplication Addition Subtraction) rules. If you have a formula that contains brackets, the expression within the brackets will be solved before any other part of the complete formula. Take a look at the image below:

Operator Precedence Excel-Edureka

As you can see in the above example, I have a formula that consists of a bracket. So in accordance with the BODMAS rules, Excel will first find the difference between A2 and B1 and then it adds the result with A1.

What are ‘Functions’ in Excel?

In general, a function defines a formula that is executed in some given order. Excel provides a huge number of built-in functions that can be used in order to calculate the result of various formulas.

Formulas in Excel are divided into the following categories:

Catagory Important Formulas

Date & Time

DATE, DAY, MONTH, HOUR, etc

Financial

ACCINT, ACCINTM, DOLLARDE, INTRAATE, etc

Math & Trig

SUM, SUMIF, PRODUCT, SIN, COS, etc

Statistical

AVERAGE, COUNT, COUNTIF, MAX, MIN, etc

Lookup & Reference

COLUMN, HLOOKUP, ROW, VLOOKUP, CHOOSE, etc

Database

DAVERAGE, DCOUNT, DMIN, DMAX, etc

Text

BAHTTEXT, DOLLAR, LOWER, UPPER, etc

Logical

AND, OR, NOT, IF, TRUE, FALSE, etc

Information

INFO, ERROR.TYPE, TYPE, ISERROR, etc

Engineering

COMPLEX, CONVERT, DELTA, OCT2BIN, etc

Cube

CUBESET, CUBENUMBER, CUBEVALUE, etc

Compatibility

PERCENTILE, RANK, VAR, MODE, etc

Web

ENCODEURL, FILTERXML, WEBSERVICE

Now, let us check out how to make use of some of the most important and commonly used Excel Formulas.

Most Important Excel Functions:

Here are some of the most important Excel functions along with their descriptions and examples.

 DATE:

One of the most important and widely used Date function in Excel is the DATE function. The syntax of it is as follows:

DATE(year, month, day)

This function returns a number that represents the given date in the MS Excel date-time format. The DATE function can be used as follows:

EXAMPLE:

  1. =DATE(2019,11,7)
  2. =DATE(2019,11,7)-7 (returns the current date – seven days)

Date example-Edureka

Date excel-Edureka

DAY:

This function returns the day value of the month (1-31). The syntax of it is as follows:

DAY(serial_number)

Here, serial_number is the date whose day you want to retrieve. It can be given in any manner such as the result of some other function, supplied by the DATE function, or a cell reference.

EXAMPLE:

  1. =DAY(A7)
  2. =DAY(TODAY())
  3. =DAY(DATE(2019, 11,8))

Day1-Excel Formulas-Edureka

Day2-Excel formulas-Edureka

day3-edureka

MONTH:

Just like the DAY function, Excel provides another function i.e the MONTH function to retrieve the month from a specific date. The syntax is as follows:

MONTH(serial_number)

EXAMPLE:

  1. =MONTH(TODAY())
  2. =MONTH(DATE(2019, 11,8))

Month function Excel-Excel functions-Edureka

Month function2 Excel-Excel functions-Edureka

Percentage:

As we all know, Percentage is the ratio calculated as a fraction of 100. It can be denoted as follows:

Percentage = (Part/ Whole) x 100

In Excel, you can calculate the percentage of any desired values. For example, if you have the part and whole values present in A1 and A2 and you want to calculate the percentage, you can do it as follows:

  • Select the cell where you want to display the result
  • Type “=” sign
  • Then, type in the formula as A1/ A2 and hit Enter
  • From the home tab numbers group, select the “%” symbol

Percentage Excel Formulas-Edureka

IF:

The IF statement is a conditional statement that returns True when the specified condition is satisfied and Flase when the condition is not. Excel provides a built-in “IF” function that serves this purpose. Its syntax is as follows:

IF(logical_test, value_if_true, value_if_false)

Here, logical_test is the condition that is to be checked

EXAMPLE:

  • Enter the values to be compared
  • Select the cell that will display the output
  • Type in the Formula Bar “=IF(A1=A2, “Yes”, “No”)” and hit enter

IF Excel_edureka

VLOOKUP:

This function is used in order to look up and fetch some particular data from a column from an Excel sheet. The “V” in VLOOKUP stands for vertical lookup. It is one of the most important and widely used formulas in Excel and in order to use this function, the table must be sorted in ascending order. The syntax of this function is as follows:

VLOOKUP(lookup_value, table_array, col_index, num_range, lookup)  

where,

lookup_value is the value to be searched

table_array is the table that is to be searched

col_index is the column from which the value is to be retrieved

range_lookup (optional) returns TRUE for approx. match and FALSE for an exact match

EXAMPLE:

VLOOKUP excel-Edureka

As you can see in the image, the value that I have specified is 2 and the table range is between A1 and D4. I want to fetch the name of the employee, therefore I have given the column value as 2 and since I want it to be an exact match, I used False for range lookup.

Income Tax:

Suppose you want to calculate the income tax of a person whose total salary is $300. You will need to calculate the income tax as follows:

  • List down the Total Salary, Salary Deductions, Taxable Income and the percentage of Tax on Income
  • Specify the values of Total Salary, Salary Deductions
  • Then calculate the Taxable Income by finding the difference between Total Salary and Salary Deductions
  • Finally, calculate the Tax Amount

Income tax formula excel-Edureka

Income tax-Edureka

SUM:

The SUM function in Excel calculates the result by adding all the specified values in Excel. The syntax of this function is as follows:

SUM(number1, number2, …)

Adds all the numbers that are specified as a parameter to it.

EXAMPLE:

In case you want to calculate the sum of the amount you spent in purchasing vegetables, list down all the prices and then use the SUM formula as follows:

SUM -Edureka

Compound Interest:

To calculate compound interest, you can make use of one of the Excel Formulas called FV. This function will return the future value of an investment on the basis of periodic, constant interest rate and payments. The syntax of this function is as follows:

FV(rate, nper, pmt, pv, type)

In order to calculate the rate, you will need to divide the annual rate by the number of periods i.e annual rate/ periods. No. of periods or nper is calculated by multiplying the term (no. of years) with the periods i.e term * periods. pmt stands for periodic payment and can be any value including zero.

Consider the following example:

compund interest excel-edureka

In the above example, I have calculated the Compound Interest for $500 at a rate of 10% for 5 years and assuming that the periodic payment value is 0. Please note that I have used -B1 meaning, $500 has been taken from me.

Average:

The average, as we all know, depicts the median value of a number of values. In Excel, the average can be easily calculated using the built-in function called “AVERAGE”. The syntax of this function is as follows:

AVERAGE(number1, number2, …)

EXAMPLE:

In case you want to calculate the average marks attained by students in all the exams, you can simply create a table and then use the AVERAGE formula to calculate the average marks attained by each student.

Average Excel-Edureka

In the above example, I have calculated the average marks for two students in two exams. In case you have more than two values whose average needs to be determined, you just have to specify the range of cells wherein the values are present. For example:

Average excel 2-edureka

COUNT:

The count function in Excel will count the number of cells containing numbers in a given range. The syntax of this function is as follows:

COUNT(value1, value2, …)

EXAMPLE:

In case I want to calculate the number of cells holding numbers from the table I created in the previous example, I will simply have to select the cell wherein I want to display the result and then make use of the COUNT function as follows:

Count excel formulas-edureka

ROUND:

In order to round off values to some specific decimal places, you can make use of the ROUND function. This function will return a number by rounding it off to the specified number of decimal places. The syntax of this function is as follows:

ROUND(number, num_digits)

EXAMPLE:

ROUND-Excel Formulas-Edureka

Finding Grade:

In order to find grades, you will have to make use of nested IF statements in Excel. For example, in the Average example, I had calculated the average marks scored by students in the tests. Now, to find the Grades attained by these students, I will have to create a nested IF function as follows:

Grade-Excel Formulas-Edureka

As you can see, the average marks are present in column G. To calculate the grade, I have used a nested IF formula. The code is as follows:

=IF(G19>90,”A”,(IF(G19>75,”B”,IF(G19>60,”C”,IF(G19>40,”D”,”F”)))))

After doing this, you will just have to copy the formula to all the cells where you want to display the grades.

RANK:

In case you want to determine the Rank attained by the students of a class, you can make use of one of the built-in Excel Formulas i.e RANK. This function will return the Rank for a specified range by comparing a given range in the ascending or in the descending order. The syntax of this function is as follows:

RANK(ref, number, order)

EXAMPLE:

Rank-Edureka

As you can see, in the above example, I have calculated the Rank of the students using the Rank function. Here, the first parameter is the average marks attained by each student and the array is the average attained by all other students of the class. I have not specified any order, therefore, the output will be determined in the descending order. For ascending order ranks, you will have to specify any nonzero value.

COUNTIF:

In order to count the cells based on some given condition, you can use one of the built-in Excel Formulas called “COUNTIF”. This function will return the number of cells that satisfy some condition in a given range. The syntax of this function is as follows:

COUNTIF(range, criteria)

EXAMPLE:

countif excel formulas-Edureka

As you can see, in the above example, I have found the number of cells having values that are greater than 80. You can also give some text value to the criteria parameter.

INDEX:

The INDEX function returns a value or cell reference at some particular position in a specified range. The syntax of this function is as follows:

INDEX(array, row_num, column_num) or

INDEX(reference, row_num, column_num, area_num)

The index function works as follows for the Array form:

  • If both row number and column number are supplied, it returns the value that is present at the intersection cell
  • If the row value is set to zero, it will return the values present in the entire column in the specified range
  • If the column value is set to zero, it will return the values present in the entire row in the specified range

The index function works as follows for the Reference form:

  • Returns the reference of the cell where the row and the column values intersect
  • The area_num will indicate which range is to be used in case multiple ranges have been supplied

EXAMPLE:

Index array-Excel formulas-Edureka

As you can see, in the above example, I have used the INDEX function to determine the value present in the 2nd row and 4th column for the range of cells between A18 to G20.

Similarly, you can also use the INDEX function by specifying multiple references as follows:

Index reference- Edureka

This brings us to the end of this article on Excel Formulas and Functions. I hope you are clear with all that has been shared with you. Make sure you practice as much as possible and revert your experience.  

Got a question for us? Please mention it in the comments section of this “Excel Formulas and Functions” blog and we will get back to you as soon as possible.

To get in-depth knowledge on any trending technologies along with its various applications, you can enroll for live Edureka MS Excel Online training with 24/7 support and lifetime access.

Excel formulas allow you to identify relationships between values in your spreadsheet’s cells, perform mathematical calculations with those values, and return the resulting value in the cell of your choice. Sum, subtraction, percentage, division, average, and even dates/times are among the formulas that can be performed automatically. For example, =A1+A2+A3+A4+A5, which finds the sum of the range of values from cell A1 to cell A5.

Excel Functions: A formula is a mathematical expression that computes the value of a cell. Functions are predefined formulas that are already in Excel. Functions carry out specific calculations in a specific order based on the values specified as arguments or parameters. For example, =SUM (A1:A10). This function adds up all the values in cells A1 through A10.

How to Insert Formulas in Excel?

This horizontal menu, shown below, in more recent versions of Excel allows you to find and insert Excel formulas into specific cells of your spreadsheet. On the Formulas tab, you can find all available Excel functions in the Function Library:

The more you use Excel formulas, the easier it will be to remember and perform them manually. Excel has over 400 functions, and the number is increasing from version to version. The formulas can be inserted into Excel using the following method:

1. Simple insertion of the formula(Typing a formula in the cell):

Typing a formula into a cell or the formula bar is the simplest way to insert basic Excel formulas. Typically, the process begins with typing an equal sign followed by the name of an Excel function. Excel is quite intelligent in that it displays a pop-up function hint when you begin typing the name of the function.

2. Using the Insert Function option on the Formulas Tab:

If you want complete control over your function insertion, use the Excel Insert Function dialogue box. To do so, go to the Formulas tab and select the first menu, Insert Function. All the functions will be available in the dialogue box.

3. Choosing a Formula from One of the Formula Groups in the Formula Tab:

This option is for those who want to quickly dive into their favorite functions. Navigate to the Formulas tab and select your preferred group to access this menu. Click to reveal a sub-menu containing a list of functions. You can then choose your preference. If your preferred group isn’t on the tab, click the More Functions option — it’s most likely hidden there.

4. Use Recently Used Tabs for Quick Insertion:

If retyping your most recent formula becomes tedious, use the Recently Used menu. It’s on the Formulas tab, the third menu option after AutoSum.

Basic Excel Formulas and Functions:

1. SUM:

The SUM formula in Excel is one of the most fundamental formulas you can use in a spreadsheet, allowing you to calculate the sum (or total) of two or more values. To use the SUM formula, enter the values you want to add together in the following format: =SUM(value 1, value 2,…..).

Example: In the below example to calculate the sum of price of all the fruits, in B9 cell type =SUM(B3:B8). this will calculate the sum of B3, B4, B5, B6, B7, B8 Press “Enter,” and the cell will produce the sum: 430. 

2. SUBTRACTION:

To use the subtraction formula in Excel, enter the cells you want to subtract in the format =SUM (A1, -B1). This will subtract a cell from the SUM formula by appending a negative sign before the cell being subtracted.

For example, if A3 was 300 and B3 was 225, =SUM(A1, -B1) would perform 300 + -225, returning a value of 75 in D3 cell.

3. MULTIPLICATION:

In Excel, enter the cells to be multiplied in the format =A3*B3 to perform the multiplication formula. An asterisk is used in this formula to multiply cell A3 by cell B3.

For example, if A3 was 300 and B3 was 225, =A1*B1 would return a value of 67500.

Highlight an empty cell in an Excel spreadsheet to multiply two or more values. Then, in the format =A1*B1…, enter the values or cells you want to multiply together. The asterisk effectively multiplies each value in the formula.

To return your desired product, press Enter. Take a look at the screenshot above to see how this looks.

4. DIVISION:

To use the division formula in Excel, enter the dividing cells in the format =A3/B3. This formula divides cell A3 by cell B3 with a forward slash, “/.”

For example, if A3 was 300 and B3 was 225, =A3/B3 would return a decimal value of 1.333333333.

Division in Excel is one of the most basic functions available. To do so, highlight an empty cell, enter an equals sign, “=,” and then the two (or more) values you want to divide, separated by a forward slash, “/.” The output should look like this: =A3/B3, as shown in the screenshot above.

5. AVERAGE:

The AVERAGE function finds an average or arithmetic mean of numbers. to find the average of the numbers type = AVERAGE(A3.B3,C3….) and press ‘Enter’ it will produce average of the numbers in the cell.

For example, if A3 was 300, B3 was 225, C3 was 180, D3 was 350, E3 is 400 then =AVERAGE(A3,B3,C3,D3,E3) will produce 291.

6. IF formula:

In Excel, the IF formula is denoted as =IF(logical test, value if true, value if false). This lets you enter a text value into a cell “if” something else in your spreadsheet is true or false.

For example, You may need to know which values in column A are greater than three. Using the =IF formula, you can quickly have Excel auto-populate a “yes” for each cell with a value greater than 3 and a “no” for each cell with a value less than 3.

7. PERCENTAGE:

To use the percentage formula in Excel, enter the cells you want to calculate the percentage for in the format =A1/B1. To convert the decimal value to a percentage, select the cell, click the Home tab, and then select “Percentage” from the numbers dropdown.

There isn’t a specific Excel “formula” for percentages, but Excel makes it simple to convert the value of any cell into a percentage so you don’t have to calculate and reenter the numbers yourself.

The basic setting for converting a cell’s value to a percentage is found on the Home tab of Excel. Select this tab, highlight the cell(s) you want to convert to a percentage, and then select Conditional Formatting from the dropdown menu (this menu button might say “General” at first). Then, from the list of options that appears, choose “Percentage.” This will convert the value of each highlighted cell into a percentage. This feature can be found further down.

8. CONCATENATE:

CONCATENATE is a useful formula that combines values from multiple cells into the same cell.

For example , =CONCATENATE(A3,B3) will combine Red and Apple to produce RedApple. 

9. DATE:

DATE is the Excel DATE formula =DATE(year, month, day). This formula will return a date corresponding to the values entered in the parentheses, including values referred to from other cells.. For example, if A2 was 2019, B2 was 8, and C1 was 15, =DATE(A1,B1,C1) would return 15-08-2019.

10. TRIM:

The TRIM formula in Excel is denoted =TRIM(text). This formula will remove any spaces that have been entered before and after the text in the cell. For example, if A2 includes the name ” Virat Kohli” with unwanted spaces before the first name, =TRIM(A2) would return “Virat Kohli” with no spaces in a new cell.

11. LEN:

LEN is the function to count the number of characters in a specific cell when you want to know the number of characters in that cell. =LEN(text) is the formula for this. Please keep in mind that the LEN function in Excel counts all characters, including spaces:

For example,=LEN(A2), returns the total length of the character in cell A2 including spaces.

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

Create a formula | Edit a formula | Copy a formula | Insert a function

This post will guide you how to create new function or formulas in excel. How to edit a formula in excel? How to copy or paste a formula in excel 2013?

What is Excel Formulas?

A formula always starts with an equal sign (=), which can be followed by numbers, math operators (like a + or – sign for addition or subtraction), and built-in Excel functions, which can really expand the power of a formula.

In short, excel formulas is an expression consist of the following elements:  Math operators (+,-,*,/)Cell references (row or column name or range: A2:A5), worksheet functions(such as: date, time, count).

Excel formulas example:

=B1+B2

The above formulas example will add the value of cell B1 to the value of cell B2.

Create a Formula

If you want to create a formula, you just need to type it in formula bar under excel ribbon.

For example, enter values in A2 and A3 cells, while you clicking A4 cell, you will noticed that the excel formula bar is blank… now enter one formula for the current cell A4, like as: =A2+A3, then the calculated result will be shown in the Cell A4.

1# Input values in A2 and A3 cells

input values in A2 and A3

2# clicking A4 cell, checking the excel formula bar

3# enter one formula in the formula bar: =A2+A3

enter formula 1

4# let’s see the results in the cell A4, it will add the summing value A2 and A3 to A4 cell.

enter formula result

Edit a Formula

If you want to modify excel formula for a special excel cell, you just need to click that cell , then edit its formula in the formula bar. Let’s see the below steps:

1#  click one cell that you want to edit its formula

2# modify the formula as: =A2*A3

edit a formula1

3# then press “enter” , let’s see the current result.

edit a formula result

Copy a Formula

If you want to copy one cell formula(A4) to another cell(B4), just following the below steps:

1# clicking the cell A4, right click it and then click “copy” or just press key “CTRL” + “C”

copy a formula 1

2# clicking the cell B4, then right click it , click “Paste Formula” under “Paste Options:

copy a formula 1

3# Let’s see the result:

copy a formula 1

Insert a Function/using Excel built-in function

If you want to insert a function in excel formula bar for one cell, you can just type “=” sign, and then type any alphabet you will see that the searched functions. Or just click “Insert Function” button next to formula bar. Let’s see the below steps:

1# select one cell, such as: C4

2# type “=” sign, then input “S” character, you will see that all functions starting with “S” will show.

excel insert function

Or you can just only click “Insert Function” button to select functions.

excel insert function

excel insert function

Let’s see the results:

excel insert function

Enter a Formula | Edit a Formula | Operator Precedence | Copy/Paste a Formula | Insert Function

A formula is an expression which calculates the value of a cell. Functions are predefined formulas and are already available in Excel.

Cell A3 below contains a formula which adds the value of cell A2 to the value of cell A1.

Formula in Excel

Cell A3 below contains the SUM function which calculates the sum of the range A1:A2.

Function in Excel

Enter a Formula

To enter a formula, execute the following steps.

1. Select a cell.

2. To let Excel know that you want to enter a formula, type an equal sign (=).

3. For example, type the formula A1+A2.

Enter a Formula

Tip: instead of typing A1 and A2, simply select cell A1 and cell A2.

4. Change the value of cell A1 to 3.

Recalculation

Excel automatically recalculates the value of cell A3. This is one of Excel’s most powerful features!

Edit a Formula

When you select a cell, Excel shows the value or formula of the cell in the formula bar.

Formula Bar

1. To edit a formula, click in the formula bar and change the formula.

Edit a Formula in Excel

2. Press Enter.

Edited Formula

Operator Precedence

Excel uses a default order in which calculations occur. If a part of the formula is in parentheses, that part will be calculated first. It then performs multiplication or division calculations. Once this is complete, Excel will add and subtract the remainder of your formula. See the example below.

Operator Precedence

First, Excel performs multiplication (A1 * A2). Next, Excel adds the value of cell A3 to this result.

Another example,

Parentheses

First, Excel calculates the part in parentheses (A2+A3). Next, it multiplies this result by the value of cell A1.

Copy/Paste a Formula

When you copy a formula, Excel automatically adjusts the cell references for each new cell the formula is copied to. To understand this, execute the following steps.

1. Enter the formula shown below into cell A4.

Copy a Formula Example

2a. Select cell A4, right click, and then click Copy (or press CTRL + c)…

Click on Copy

…next, select cell B4, right click, and then click Paste under ‘Paste Options:’ (or press CTRL + v).

Click on Paste

2b. You can also drag the formula to cell B4. Select cell A4, click on the lower right corner of cell A4 and drag it across to cell B4. This is much easier and gives the exact same result!

Drag an Excel Formula

Result. The formula in cell B4 references the values in column B.

Copy a Formula Result

Insert Function

Every function has the same structure. For example, SUM(A1:A4). The name of this function is SUM. The part between the brackets (arguments) means we give Excel the range A1:A4 as input. This function adds the values in cells A1, A2, A3 and A4. It’s not easy to remember which function and which arguments to use for each task. Fortunately, the Insert Function feature in Excel helps you with this.

To insert a function, execute the following steps.

1. Select a cell.

2. Click the Insert Function button.

Insert a Function

The ‘Insert Function’ dialog box appears.

3. Search for a function or select a function from a category. For example, choose COUNTIF from the Statistical category.

Insert Function Dialog Box

4. Click OK.

The ‘Function Arguments’ dialog box appears.

5. Click in the Range box and select the range A1:C2.

6. Click in the Criteria box and type >5.

7. Click OK.

Function Arguments Dialog Box

Result. The COUNTIF function counts the number of cells that are greater than 5.

COUNTIF Result

Note: instead of using the Insert Function feature, simply type =COUNTIF(A1:C2,»>5″). When you arrive at: =COUNTIF( instead of typing A1:C2, simply select the range A1:C2.

Понравилась статья? Поделить с друзьями:
  • What are excel file types
  • What are excel data tables created from
  • What are excel add ins
  • What are error bars in excel
  • What are elephant word