Command functions in excel

Содержание

  1. Команды, функции и состояния Excel
  2. Команды
  3. Функции
  4. Функции листа
  5. Функции листа макросов
  6. Состояния Excel
  7. Excel Commands, Functions, and States
  8. Commands
  9. Functions
  10. Worksheet Functions
  11. Macro-Sheet Functions
  12. Excel States
  13. Excel Commands
  14. List of Top 10 Commands in Excel
  15. #1 VLOOKUP Function to Fetch Data
  16. #2 IF Condition to Do Logical Test
  17. #3 CONCATENATE Function to Combine Two or More Values
  18. #4 Count Only Numerical Values
  19. #5 Count All Values
  20. #6 Count Based on Condition
  21. #7 Count Number of Characters in the Cell
  22. #8 Convert Negative Value to Positive Value
  23. #9 Convert All Characters to UPPERCASE Values
  24. #10 Find Maximum and Minimum Values
  25. Things to Remember
  26. Recommended Articles

Команды, функции и состояния Excel

Относится к: Excel 2013 | Office 2013 | Visual Studio

Microsoft Excel распознает два очень разные типа дополнительных функциональных возможностей: команды и функции.

Команды

В Excel команды имеют следующие свойства:

Выполняют действия так же, как и пользователи.

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

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

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

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

Они никогда не вызываются программой Excel во время пересчета.

Они не вызываются функциями во время пересчета.

Функции

В Excel функции имеют следующие свойства:

Как правило, принимают аргументы и всегда возвращают результат.

Могут вводиться в одну или несколько ячеек в составе формулы Excel.

Могут использоваться в определениях определенных имен.

Могут использоваться в выражениях лимитов и порогов условного форматирования.

Могут вызываться командами.

Не могут вызывать команды.

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

Функции листа

В Excel функции листа имеют следующие свойства:

Не имеют доступа к информационным функциям листа макросов.

Не могут получать значения невычисленных ячеек.

Могут записываться и регистрироваться как потокобезопасные, начиная с Excel 2007.

Функции листа макросов

В Excel функции листа макросов имеют следующие свойства:

Имеют доступ к информационным функциям листа макросов.

Могут получать значения невычисленных ячеек, в том числе значения вызывающих ячеек.

Не считаются потокобезопасными, начиная с Excel 2007.

Excel обрабатывает функции UDF Microsoft Visual Basic для приложений как функции листа макросов, в том плане, что они имеют доступ к информации рабочей области и значению невычисленных ячеек, и не считаются потокобезопасными, начиная с Excel 2007.

Состояния Excel

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

Ниже описаны возможные состояния.

Состояние готовности: Команды или макросы не выполняются. Диалоговые окна не отображаются. Ячейки не редактируются, пользователь не выполняет операцию вырезания, копирования или вставки. Внедренные объекты не активированы.

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

Режим вырезания/копирования и вставки: пользователя вырезал или скопировал ячейку или ряд ячеек и еще не вставил их или вставил с помощью диалогового окна «Специальная вставка», позволяющего выполнять несколько операций вставки.

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

Пользователь открывает встроенное диалоговое окно.

Пользователь инициирует пересчет.

Пользователь выполняет команду.

Excel выполняет операцию Автосохранение.

Источник

Excel Commands, Functions, and States

Applies to: Excel 2013 | Office 2013 | Visual Studio

Microsoft Excel recognizes two very different types of added functionality: commands and functions.

Commands

In Excel, commands have the following characteristics:

They perform actions in the same way that users do.

They can do anything a user can do (subject to the limits of the interface used), such as altering Excel settings, opening, closing, and editing documents, initiating recalculations, and so on.

They can be set up to be called when certain trapped events occur.

They can display dialog boxes and interact with the user.

They can be linked to control objects so that they are called when some action is taken on that object, such as left-clicking.

They are never called by Excel during a recalculation.

They cannot be called by functions during a recalculation.

Functions

Functions in Excel do the following:

They usually take arguments and always return a result.

They can be entered into one or more cells as part of an Excel formula.

They can be used in defined name definitions.

They can be used in conditional formatting limit and threshold expressions.

They can be called by commands.

They cannot call commands.

Excel makes a further distinction between user-defined worksheet functions and user-defined functions that are designed to work on macro sheets. Excel does not limit user-defined macro sheet functions only to being used on macro sheets: these functions can be used anywhere a normal worksheet function can be used.

Worksheet Functions

The following is true of Excel worksheet functions:

They cannot access macro sheet information functions.

They cannot obtain the values of uncalculated cells.

They can be written and registered as thread-safe starting in Excel 2007.

Macro-Sheet Functions

The following is true of Excel macro-sheet functions:

They can access macro sheet information functions.

They can obtain the values of uncalculated cells including the values of the calling cells.

They are not considered thread safe starting in Excel 2007.

How Excel treats a user-defined function (UDF), what it permits the function to do, and how it recalculates the function are all determined when you register the function. If a function is registered as a worksheet function but tries to do something that only a macro-sheet function can do, the operation fails. Starting in Excel 2007, if a worksheet function registered as thread safe tries to call a macro sheet function, again, the operation fails.

Excel treats Microsoft Visual Basic for Applications (VBA) UDFs as macro sheet-equivalent functions, in that they can access workspace information and the value of uncalculated cells, and they are not considered as thread safe starting in Excel 2007.

Excel States

Excel can be in one of a number of states at any given time depending on the actions of the user, an external process, a trapped event running a macro, or a timed Excel housekeeping event such as Autosave.

The states that the user experiences are as follows:

Ready state: No commands or macros are being run. No dialog boxes are being displayed. No cells are being edited and the user is not in the middle of a cut/copy and paste operation. No embedded object has focus.

Edit mode: The user has started to type valid input characters into an unlocked or unprotected cell, or has pressed F2 on one or more unlocked or unprotected cells.

Cut/copy and paste mode: The user has cut or copied a cell or range of cells and has not yet pasted them, or has pasted them using the paste-special dialog box, which enables multiple paste operations.

Point mode: The user is editing a formula and is selecting cells whose addresses are added to the formula being edited.

The user can clear the edit, point, and cut/copy modes by pressing the ESC key, which returns Excel to its ready state. Other events can clear these states, such as the following:

The user opens a built-in dialog box.

The user initiates a recalculation.

The user runs a command.

Excel performs an Autosave operation.

A timer event is trapped.

The last example is of importance to add-in developers. You should consider the impact of the normal usability of Excel where frequent timer event traps are being set and executed. When this is an important part of your add-in’s functionality, you should provide users with an easily accessible way of suspending it, so that they can cut/copy and paste normally when they need to.

Источник

Excel Commands

List of Top 10 Commands in Excel

Whether in engineering, medicine, chemistry, or any field, an Excel spreadsheet is the common tool for data maintenance. Some of them use it to maintain their database and others use this tool as a weapon to turn fortune for the respective companies they are working on. So, you, too, can turn things around for yourself by learning some of the most useful Excel commands.

Table of contents

#1 VLOOKUP Function to Fetch Data

The data in multiple sheets are common in many offices, but fetching the data from one worksheet to another and from one workbook to another is a challenge for beginners in Excel.

In table 1, we have the subject list and their respective scores, and in table 2, we have some subject names, but we do not have scores for them. So, using these subject names in table 2, we need to fetch the data from table 1.

    First, let us open the VLOOKUP function in the E2 cell.

Then, select the LOOKUP value as a D3 cell.

Next, we must select the table array as A3 to B8 and press the F4 key to make them an absolute reference.

Column Index Number is from the selected table array from which column you need to fetch the data. So, in this case, from the second column, we need to bring the data.

For the last argument range, LOOKUP, we must select FALSE as the option, or else we can enter.

Close the bracket and press the Enter key to get the score of Sub 4. Also, copy the formula and paste it to the below cell.


You have learned a formula to fetch values from different tables based on a LOOKUP value.

#2 IF Condition to Do Logical Test

The Excel IF condition can be your friend in many situations because of its ability to conduct logical tests. For example, assume you want to test the scores of students and give the result. Below is the data for your reference.

In the above table, we have students’ scores from the examination. So we need to arrive at the result as either “PASS” or “FAIL” based on these scores. So to reach these results criteria, if the score is >=35, the result should be “PASS” or else “FAIL.”

  • We must first open the IF condition in the C2 cell.

  • The first argument is logical to test.So, in this example, we need to do the logical test of whether the score is >=35, select the score cell B2, and apply the logical test as B2 >= 35.

  • The next argument is value if true. If the applied logical test is “TRUE,” what is the value we need? If the logical test is “TRUE,” we need the result as “Pass.”

  • So, the final part is value if false.If the applied logical test is “FALSE,” then we need the result as “Fail.”

  • Now, close the bracket, and we also need to fill the formula to the remaining cells.

So, students A and F scored less than 35. Therefore, the result has arrived as “FAIL.”

#3 CONCATENATE Function to Combine Two or More Values

  • First, we need to open the CONCATENATE function in the C2 cell.

  • For the first argument, “Text 1, select the “First Name” cell, and for “Text 2, choose the “Last Name” cell.

  • Then, we need to apply the formula to all the cells to get the full name.

  • If you want space as the “First Name” and “Last Name” separator, we can use the space character in double-quotes after selecting the first name.

#4 Count Only Numerical Values

If we want to count only numerical values from the range, you need to use the COUNT function in Excel. Take a look at the below data.

From the above table, we need to count only numerical values. For this, we can use the COUNT function.

The result of the COUNT function is 6. The total count of cells is 8, but we have got the count of numerical values as 6. In cells A4 and A6, we have text values, but in cell A8, we have date values. The Excel COUNT function treats the date also as a numerical value only.

Note: “Date” and “Time” values are numerical values if the formatting is correct. Otherwise, they will be treated as “text” values.

#5 Count All Values

We got the count as 8 because the COUNTA function has counted all the cell values.

Note: Both the COUNT and COUNTA functions ignore blank cells.

#6 Count Based on Condition

From this “City List,” if we want to count how many times “Bangalore” city is mentioned, we must open the COUNTIF function.

The first argument is “RANGE,” so we need to select the range of values from A2 to B9.

The second argument is “Criteria,” i.e., what you want to count, i.e., “Bangalore.

Bangalore has appeared three times in the range A2 to B9, so the COUNTIF function returns 3 as the count.

#7 Count Number of Characters in the Cell

“Excel” has 5 characters, so the result is 5.

Note: Space is also considered as one character.

#8 Convert Negative Value to Positive Value

#9 Convert All Characters to UPPERCASE Values

And if we want to convert all the text values to LOWERCASE values, then use the LOWER formula.

#10 Find Maximum and Minimum Values

Things to Remember

  • These are some of the important formulas/commands in excel which are used regularly.
  • We can also use these functions at the advanced level.
  • There are more advanced formulas in Excel which come under advanced level courses.
  • Space is considered one character.

Recommended Articles

This article is a guide to Excel Commands. Here, we discuss the top 10 commands in Excel, examples, and a downloadable template. You may learn more about Excel from the following articles: –

Источник

List of Top 10 Commands in Excel

Whether in engineering, medicine, chemistry, or any field, an Excel spreadsheet is the common tool for data maintenance. Some of them use it to maintain their database and others use this tool as a weapon to turn fortune for the respective companies they are working on. So, you, too, can turn things around for yourself by learning some of the most useful Excel commands.

Table of contents
  • List of Top 10 Commands in Excel
    • #1 VLOOKUP Function to Fetch Data
    • #2 IF Condition to Do Logical Test
    • #3 CONCATENATE Function to Combine Two or More Values
    • #4 Count Only Numerical Values
    • #5 Count All Values
    • #6 Count Based on Condition
    • #7 Count Number of Characters in the Cell
    • #8 Convert Negative Value to Positive Value
    • #9 Convert All Characters to UPPERCASE Values
    • #10 Find Maximum and Minimum Values
    • Things to Remember
    • Recommended Articles

You can download this Commands in Excel Template here – Commands in Excel Template

#1 VLOOKUP Function to Fetch Data

The data in multiple sheets are common in many offices, but fetching the data from one worksheet to another and from one workbook to another is a challenge for beginners in Excel.

If you have struggled to fetch the data, VLOOKUPThe VLOOKUP excel function searches for a particular value and returns a corresponding match based on a unique identifier. A unique identifier is uniquely associated with all the records of the database. For instance, employee ID, student roll number, customer contact number, seller email address, etc., are unique identifiers.
read more
will help you bring the data. For example, assume you have two tables below.

Excel Commands Example 1

In table 1, we have the subject list and their respective scores, and in table 2, we have some subject names, but we do not have scores for them. So, using these subject names in table 2, we need to fetch the data from table 1.

  1. First, let us open the VLOOKUP function in the E2 cell.

    Excel Commands Example 1-1

  2. Then, select the LOOKUP value as a D3 cell.

    Excel Commands Example 1-2

  3. Next, we must select the table array as A3 to B8 and press the F4 key to make them an absolute reference.

    Excel Commands Example 1-3

  4. Column Index Number is from the selected table array from which column you need to fetch the data. So, in this case, from the second column, we need to bring the data.

    Excel Commands Example 1-4

  5. For the last argument range, LOOKUP, we must select FALSE as the option, or else we can enter.

    Excel Commands Example 1-5

  6. Close the bracket and press the Enter key to get the score of Sub 4. Also, copy the formula and paste it to the below cell.

    Excel Commands Example 1-6
    You have learned a formula to fetch values from different tables based on a LOOKUP value.

#2 IF Condition to Do Logical Test

The Excel IF condition can be your friend in many situations because of its ability to conduct logical tests. For example, assume you want to test the scores of students and give the result. Below is the data for your reference.

Excel Commands Example 2

In the above table, we have students’ scores from the examination. So we need to arrive at the result as either “PASS” or “FAIL” based on these scores. So to reach these results criteria, if the score is >=35, the result should be “PASS” or else “FAIL.”

  • We must first open the IF condition in the C2 cell.

Excel Commands Example 2-1

  • The first argument is logical to test.So, in this example, we need to do the logical test of whether the score is >=35, select the score cell B2, and apply the logical test as B2 >= 35.

Excel Commands Example 2-2

  • The next argument is value if true. If the applied logical test is “TRUE,” what is the value we need? If the logical test is “TRUE,” we need the result as “Pass.”

Excel Commands Example 2-3

  • So, the final part is value if false.If the applied logical test is “FALSE,” then we need the result as “Fail.”

Excel Commands Example 2-4

  • Now, close the bracket, and we also need to fill the formula to the remaining cells.

Excel Commands Example 2-5

So, students A and F scored less than 35. Therefore, the result has arrived as “FAIL.”

#3 CONCATENATE Function to Combine Two or More Values

If we want to combine two or more values from different cells, we can use the CONCATENATE function in excelThe CONCATENATE function in Excel helps the user concatenate or join two or more cell values which may be in the form of characters, strings or numbers.read more. For example, below is the “First Name” list and “Last Name.”

CONCATENATE Function Example 3

  • First, we need to open the CONCATENATE function in the C2 cell.

CONCATENATE Function Example 3-1

  • For the first argument, “Text 1, select the “First Name” cell, and for “Text 2,choose the “Last Name” cell.

CONCATENATE Function Example 3-2

  • Then,  we need to apply the formula to all the cells to get the full name.

CONCATENATE Function Example 3-3

  • If you want space as the “First Name” and “Last Name” separator, we can use the space character in double-quotes after selecting the first name.

CONCATENATE Function Example 3-4

#4 Count Only Numerical Values

If we want to count only numerical values from the range, you need to use the COUNT function in Excel. Take a look at the below data.

Count Function Example 4

From the above table, we need to count only numerical values. For this, we can use the COUNT function.

Count Function Example 4-1

The result of the COUNT function is 6. The total count of cells is 8, but we have got the count of numerical values as 6. In cells A4 and A6, we have text values, but in cell A8, we have date values. The Excel COUNT function treats the date also as a numerical value only.

Note: “Date” and “Time” values are numerical values if the formatting is correct. Otherwise, they will be treated as “text” values.

#5 Count All Values

If we want to count all the values in the range, we need to use the COUNTA functionThe COUNTA function is an inbuilt statistical excel function that counts the number of non-blank cells (not empty) in a cell range or the cell reference. For example, cells A1 and A3 contain values but, cell A2 is empty. The formula “=COUNTA(A1,A2,A3)” returns 2.
read more
. We will apply the COUNTA function for the same data and see the count.

Count All Values Example 5

We got the count as 8 because the COUNTA function has counted all the cell values.

Count All Values Example 5-1

Note: Both the COUNT and COUNTA functions ignore blank cells.

#6 Count Based on Condition

If we want to count based on condition, we can use the COUNTIF functionThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump”
read more
. For example, look at the below data.

Excel Commands Example 6

From this “City List,” if we want to count how many times “Bangalore” city is mentioned, we must open the COUNTIF function.

Excel Commands Example 6-1

The first argument is “RANGE,” so we need to select the range of values from A2 to B9.

Excel Commands Example 6-2

The second argument is “Criteria,” i.e., what you want to count, i.e., “Bangalore.

Excel Commands Example 6-3

Bangalore has appeared three times in the range A2 to B9, so the COUNTIF function returns 3 as the count.

#7 Count Number of Characters in the Cell

If we want to count the number of characters in the cell, we need to use the LEN function in excelThe Len function returns the length of a given string. It calculates the number of characters in a given string as input. It is a text function in Excel as well as an inbuilt function that can be accessed by typing =LEN( and entering a string as input.read moreel. The LEN function returns the number of characters from the selected cell.

Excel Commands Example 7

“Excel” has 5 characters, so the result is 5.

Excel Commands Example 7-1

Note: Space is also considered as one character.

#8 Convert Negative Value to Positive Value

If we have negative values and want to convert them to positive ones, the ABS functionABS Excel function or Absolute function is used to calculate the absolute value of a given number. The negative numbers given as input are changed to positive numbers and if the argument provided to this function is positive, it remains unchanged.read more can do it for us.

Excel Commands Example 8

#9 Convert All Characters to UPPERCASE Values

If we want to convert all the text values to UPPERCASE, we can use the UPPER formula in excelUppercase function in Excel is used to convert lowercase text to uppercase.read more.

Excel Commands Example 9

And if we want to convert all the text values to LOWERCASE values, then use the LOWER formula.

Excel Commands Example 9-1

#10 Find Maximum and Minimum Values

If we want to find maximum and minimum values, we may use MAX and MIN functions in excelIn Excel, the MIN function is categorized as a statistical function. It finds and returns the minimum value from a given set of data/array.read more, respectively.

Find Max & Min Example 10

Things to Remember

  • These are some of the important formulas/commands in excel which are used regularly.
  • We can also use these functions at the advanced level.
  • There are more advanced formulas in Excel which come under advanced level courses.
  • Space is considered one character.

Recommended Articles

This article is a guide to Excel Commands. Here, we discuss the top 10 commands in Excel, examples, and a downloadable template. You may learn more about Excel from the following articles: –

  • Break-Even Point in Excel
  • Basic Excel Formulas List
  • Create Custom Functions in Excel
  • Write Formula in Excel

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 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.

Skip to content

15 Most Common Excel Functions You Must Know + How to Use Them

15 Most Common Excel Functions You Must Know + How to Use Them

Microsoft Excel is one of the most well-known computer applications. It has changed the way people and companies work with data.

Thus, learning Excel can help with both your career and your personal needs.

Excel runs using functions and there are roughly 500 of them! These range from basic arithmetic to complex statistics.

Most Excel users will only ever use about 100 of these functions

If you’re a new Excel user, this sheer quantity can be quite daunting.

So we are here to help you! 🤝

We have rounded up 15 of the most common and useful Excel functions that you need to learn. We also prepared a practice workbook for you to follow along with the examples. Download it here.

Let’s get started!

What are Excel functions?

Excel is used to calculate and manipulate numbers and text. To do this, you use formulas!

Formulas are expressions that tell Excel what you want to do with the data. They begin with the equal symbol (=) followed by a combination of operators and functions.

What are operators?

These are symbols that specify the type of calculation you want to perform on the elements of a formula.

For example, to add two numbers, you can type “=1+1” into a cell. Once you hit Enter, Excel will run the formula and return the result which is 2.

Here are some examples of common operators:

An arithmetic calculation return a number, comparisons return a Boolean or logical value i.e. TRUE or FALSE

Excel automatically treats cell contents that start with (=) as formulas. This also applies when you begin a cell with the plus (+) or minus (-) symbols.

You can bypass this by adding a leading apostrophe (‘). This is how you can show formulas as text like in the table above.

Order of operation and using parentheses in Excel formulas

Generally, Excel follows PEMDAS when calculating formulas. PEMDAS means parentheses first, then exponents, then multiplication and division, then addition and subtraction.

Adding parentheses changes how a formula calculates

What are functions?

These are predefined processes in Excel. Each function in Excel has a unique name and specific input(s). The function takes these inputs and performs the corresponding calculation.

The inputs or arguments of an Excel function are always enclosed in parentheses.

For example, this is the syntax for the MAX function:

=MAX(number1, [number2], …)

The list of numbers where you want to find the maximum value is placed inside the parentheses.

MAX returns the maximum value from a group of numbers, the function MIN does the same for the minimum value

Using a cell or a range as input

As you learn more about Excel, you’ll find that Excel formulas rarely consist of individual numbers only like in the formula “=1+1”.

Often, you need to reference a cell or a range(group of cells) as the input of your Excel function

Thus, referencing cells is important in Excel and you can learn more by clicking here.

Alright! You’ve just learned how a function in Excel works.

Let’s dive right into the list! 🤿

We will start with basic Excel functions and then move on to more advanced functions.

Basic Math Functions (Beginner Level ★☆☆)

1. SUM

This is the first function in Excel that most new users need. As the name implies, the SUM function adds up all the values in a specified group of cells or range.

Syntax: =SUM(number1, [number2], …)

Try it out in the practice workbook.

If you want to get the total quiz score for each student, you can use the SUM function. In this case, the input range will be all four quiz scores for each student.

1. Type this formula into cell F2:

=SUM(B2:E2)

You can also type “=SUM(B2,C2,D2,E2)” but “=SUM(B2:E2)” is much simpler.

You can also drag the input selection(blue box) over to your desired range

2. Press Enter. Excel then evaluates the formula and the cell returns the number for the total which is 360.

3. Copy this for the rest of the students or drag down the fill handle.

The fill handle is the small green square at bottom right of the cell

Notice that the SUM function ignores the cells containing text. (“X” meaning the student was unable to take the quiz)

Most of the basic math functions in Excel ignore non-numeric values such as text, date, and time.

2. COUNT

Next up is the COUNT function. It returns the number of cells containing numeric values within the input range.

Syntax: =COUNT(value1, [value2], …)

1. To get the number of quizzes taken by each student, use this formula in cell G2:

=COUNT(B2:E2)

2. Hit Enter and fill in the rows below.

If you would like to include non-numeric values in the count, you can use the COUNTA function. To count the number of blank cells, you can use the COUNTBLANK function.

Learn more about the COUNT function and its variants here.

3. AVERAGE

The average of a list of numbers is just the total divided by how many numbers there are in that list.

This is easy enough to calculate the quiz scores. You already have the SUM and the COUNT of quizzes for each student.

But, it gets even easier using the AVERAGE function in Excel.

Syntax: =AVERAGE (value1, [value2], …)

1. Type this into cell H2:

=AVERAGE(B2:E2)

2. Hit Enter and fill in the rows below.

Use Cell Formatting to change the number of decimals displayed
You can double-check the results using the SUM and COUNT functions earlier.

Logical Functions (Intermediate Level – ★★☆)

Let’s raise the difficulty level a little bit.

A logical function in Excel allows you to make comparisons and use the results to change how a formula calculates.

4. IF

The IF function is a very popular function in Excel and it is actually quite easy to learn.

Syntax: =IF(logical_test, value_if_true, [value_if_false])

This function checks if a logical test is either TRUE or FALSE. It then returns the specified value based on the result.

Using the average score of each student, try to assign PASS or FAIL grades. Assume that the passing score for this class is 60.

1. Begin the formula in cell C2 with “=IF(“

The logical_test is to check if the average score in Column B is greater than or equal to (>=) the passing score of 60.

2. So, the formula becomes:

=IF(B2>=60,

If the comparison returns TRUE, then the formula should return the text “PASS”. Thus, the value_if_true argument should be “PASS”.

And if it returns FALSE, then the value_if_false argument should be “FAIL”.

3. Thus, the formula becomes:

=IF(B2>=60,”PASS”,”FAIL”)

4. Hit Enter and fill in the rows below.

Luckily everyone in this class has passed

What if you needed to assign grades according to a scale instead of just “PASS” and “FAIL”?

For that, you have to use multiple criteria or logical tests. While this is possible using nested IF functions, it can get messy very quickly. Instead, you can use the IFS function.

5. IFS function

The IFS function was introduced in Excel 2016 to replace nested IF functions.

This function works by evaluating the first logical test or criteria. It returns the corresponding value if it is TRUE. But if it is FALSE, the function proceeds to evaluate the second criteria, and so on.

📖 In other words, the IFS function outputs the value that corresponds to the first specified criteria that is true.

Syntax: =IFS(logical_test1, value_if_true1, [logical_test2], [value_if_true2],..)

Use the grading table on the right as reference

1. First, the formula should check if the average score (column B) is above or equal to 90. If yes, it should return “A”.

=IFS(B2>=90,”A”,

2. If not, it should then check if the average score is greater than or equal to 80. If yes, it should return “B”. If you do this up to grade D, the formula becomes:

=IFS(B2>=90,”A”,B2>=80,”B”,B2>=70,”C”,B2>=60,”D”,

3. For the last grade “F”, put “TRUE” for the logical test.

The IFS function will only evaluate the last specified criteria if all of the previous logical values were FALSE. Thus, you can set the last criteria to always be TRUE thus making it a “catch all” statement.

The final formula is then:

=IFS(B2>=90,”A”,B2>=80,”B”,B2>=70,”C”,B2>=60,”D”,TRUE,”F”)

PRO-TIP:

You can use absolute cell references and a reference table when working with long formulas.

That way, you don’t have to revisit all of the arguments in the formula if you need to change some values.

For example, using the table and formula shown below, you can easily change the grading scale in use.

=IFS(B2>=$H$2,$F$2,B2>=$H$3,$F$3,B2>
=$H$4,$F$4,B2>=$H$5,$F$5,TRUE,$F$6)

The dollar sign ($) in a formula denotes an absolute cell reference, ex: $F$2

Text Functions (Intermediate Level – ★★☆)

In this next section, you will see how Excel can also be used to manipulate text.

In the “Class List” worksheet of the practice workbook, the full name of each student is listed in Column A. Your goal is to rearrange these from “first name last name” to “last name_first name” in Column F.

The finished table will let users sort using both first and last name

To do this, you first have to extract the first name and the last name from Column A.

6. FIND

The names are separated by a space character ” “. So, you have to identify the position of the space within each text string in Column A.

The FIND function in Excel returns the number or position of a specified character or substring within another text string.

Syntax: =FIND(find_text, within_text, [start_num])

To get the position of the space ” “, type this formula:

=FIND(” “,A2)

You will use these results to extract the first name later

Next, take a look at the LEN function.

7. LEN

This function returns the number of characters in a text string.

Syntax: =LEN(text)

To get the number of characters in each student’s name:

=LEN(A2)

You will use the LEN results to extract the last name later

Now you can move on to extracting the first and last name using the MID function in Excel.

8. MID

This function extracts a given number of characters from the middle of a text string.

Syntax: = MID(text, start_num, num_chars)

It is one of three text functions that are used to extract text. The other two are LEFT and RIGHT which extract text from the start and end of a text string respectively.

The first name starts at the very first character of the text string. So, you extract starting from position 1. Then the length of the first name is given by the position of the space character minus 1.

So, the formula to extract the first name or first word from a text string is:

=MID(A2,1,B2-1)

Or, you can express it directly using the FIND formula earlier.

=MID(A2,1,FIND(” “,A2)-1)

This formula works for any text string you need to grab the first word from

For the last name, you can extract it starting from the position of the space character plus 1. Its length is just the length of the entire text string minus the position of the space character.

=MID(A2,B2+1,C2-B2)

Or, using the FIND and LEN formulas earlier:

=MID(A2,FIND(” “,A2)+1,LEN(A2)-FIND(” “,A2))

The space character's position number raised by 1 gives the starting position of the last name

Now you can combine the last name and the first name in the desired order using the CONCAT function.

9. CONCAT

Like IFS, CONCAT is another newly introduced function in Excel 2016. It replaced the old CONCATENATE function.

Syntax: =CONCAT(text1, [text2],…)

Combine the last name and the first name with a comma and space character “, ” in between.

=CONCAT(E2,”, “,D2)

CONCAT also converts input numbers to text

PRO-TIP:

In the above example, you used helper columns for FIND, LEN, and MID to help build the final formula and visualize how it works.

In real-world applications, you can use a single long formula to get the results like this:

=CONCAT(MID(A2,FIND(” “,A2)+1,LEN(A2)
-FIND(” “,A2)),”, “,MID(A2,1,FIND(” “,A2)-1))

Helper columns are useful in building and testing long formulas

Lookup and Reference Functions (Advanced Level – ★★★)

In this final section, we will focus on functions that allow you to look for specific data points and refer to them.

Take a look at the “Schedule” worksheet.

You will find the schedule and seating plan for the next four quizzes

10. COLUMN

The COLUMN function in Excel returns the column number of a given cell.

Syntax: =COLUMN([reference])

Let’s try to assign specific dates for each quiz. For example, you may want the quizzes to be held every Monday. This means that the first quiz date should be offset by 1 week or 7 days for each succeeding quiz date.

You can use the column number to multiply the 7 days offset for each week like this:

=$B$2+(COLUMN()-2)*7

The start date, Oct 3, is highlighted in green and its column number, 2, is subtracted from the formula

Two (2) is subtracted from the column number so that the sequence starts at 1.

You can also get this result using the much simpler “=B2+7” since you are only adding a fixed number of days to each date. 🤔

But, using the COLUMN function, you can create complex patterns.

Take this pattern for example:

The quizzes are still held every Monday. But every third week, they are held on Wednesday instead.

Here is the formula for this pattern:

=$B$2+(COLUMN()-2)*7+IF(MOD(COLUMN()-1,3)=0,2,0)

The formula is a bit long so here is a breakdown of how it works
With this formula, you can extend the pattern for as long as you like

The MOD function in Excel returns the remainder after a number is divided by a given divisor. It’s part of the Math & Trig group of functions.

This group includes other fun functions such as ABS which returns the absolute value of a number and ROUND which rounds a number to a specified number of digits.

Learn more about the function groups towards the end of this article!

Kasper Langmann, Microsoft Office Specialist

11. ROW

Next, take a look at the ROW function. It works exactly like COLUMN but it returns the row number instead.

Syntax: =ROW([reference])

In this next example, you will assign the seating plans. You can try different seating arrangements using the ROW function.

Assume R1C1 is the seat closest to the teacher’s desk.

1. You can have the students seated one seat after another and in two columns:

=CONCAT(“R”,MOD(ROW()-6,3)*2+1,”C”,INT((ROW()-6)/3)*2+1)

The INT function in Excel rounds a number down to the nearest integer

2. Or they can sit in rows of 3 and columns of 2

=CONCAT(“R”,MOD(ROW()-6,2)*2+1,”C”,INT((ROW()-6)/2)*2+1)

You can modify the values in the formula to change the seating pattern

3. You can also sit them in the farthest rows:

=CONCAT(“R”,MOD(ROW()-6,2)*4+1,”C”,INT((ROW()-6)/2)*2+1)

In this seating plan, students have the most distance from the front and back

4. Or in the farthest columns:

=CONCAT(“R”,MOD(ROW()-6,3)*2+1,”C”,INT((ROW()-6)/3)*4+1)

In this seating plan, students have the most distance from the sides

Manually creating seating patterns for small sets like this one is easy. But a formula like those shown above definitely helps especially for larger sets like 50, 100, or even more.

The COLUMN and ROW functions are rarely used on their own. Like IF and IFS, you use them with other functions to change how the formula is calculated.

12. MATCH

Now, open up the “Lookup” worksheet.

In the next few examples, you will create a search feature that allows students to look up their names. They can then see their scores from past quizzes and their assigned seats for the next quizzes.

To start, you will use the MATCH function. It searches for a specified item within a given range of cells. It then returns the relative position of the first match.

Syntax: =MATCH(lookup_value, lookup_array, [match_type])

  1. The lookup_value is the item you want to search for. So, set this to cell B2.
  2. The lookup_array is the range or table array where you want to search. Use F2:F7 from the “Class List” worksheet.
  3. For the match_type, set this to zero so that the function searches for an exact match. (Learn more about MATCH and the different match types in this article)

The formula then becomes:

=MATCH(B2,’Class List’!F2:F7,0)

Students can now search for their names and the function returns the relative position in the Class List table

However, it only works correctly if the name is entered exactly as it is written in Column F of the Class List.

To fix this, you can use the asterisk “*” wildcard character so that searching for either first or last name works.

You can also enclose the formula in an IFNA function. This way, if the formula cannot find the given name in the table, it will return a phrase like “No result found”.

You will later use the resulting Row to retrieve the first and last name

13. INDEX

The INDEX function retrieves a value from a given table array based on the provided row and column numbers.

Syntax: =INDEX (array, row_num, [col_num])

Similar to the MATCH example, you need to specify where the range or array lookup is.

Use D2:E7 from Class List as the table array

For row_num, you can use the earlier MATCH result at Cell B5. Then for col_num, use 1 for the First Name:

=INDEX(‘Class List’!D2:E7,B5,1)

The First Name result

And set col_num to 2 for the Last Name.

=INDEX(‘Class List’!D2:E7,B5,2)

The Last Name result

Just like that, you have a working search 🔍 formula!

This is just a small example of the countless possibilities using the INDEX and MATCH combination. Click here for more examples!

14. VLOOKUP

The VLOOKUP function in Excel works similarly to the INDEX and MATCH combination. It is faster to set up but it is less versatile. VLOOKUP also only works if your lookup array is at the leftmost of the reference table.

Syntax: =VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

This time, you will use the First Name result (cell B6) as the lookup_value. Use this and VLOOKUP to retrieve the given student’s scores from the “Quiz Scores” worksheet.

=VLOOKUP($B$6,’Quiz Scores’!$A$2:$E$7,COLUMN(),FALSE)

INDEX MATCH multiple criteria lookup

For the seat assignment, use the Last Name result followed by the asterisk wild character.

=VLOOKUP($B$7&”*”,Schedule!$A$6:$E$11,COLUMN(),FALSE)

15. INDIRECT

The last function that you will be learning about today is also one of the most powerful in Excel.

INDIRECT allows you to specify cell references using text strings.

SYNTAX: =INDIRECT(ref_text, [a1])

For example, instead of typing “=A1”, you can type “=INDIRECT(“A”&1). This means you can dynamically change references.

Let’s take the INDEX & MATCH formula you used to retrieve the Last Name. You can get the same result using this formula:

=INDIRECT(“‘Class List’!”&”E”&(B5+1))

This is a simple example and definitely doesn't do justice to how powerful INDIRECT really is

The INDIRECT function opens up so many possibilities with dynamic references in Excel. I highly this article for an in-depth tutorial on INDIRECT.

That’s it – Now what?

As you have just learned, Excel offers so many different functions to choose from. Luckily, Excel has brought them all together in the Formulas tab.

The functions are categorized into groups such as Math & Trigonometry, Text, & Date and Time

You can look for an Excel function using search keywords or you can also select from the categorical dropdowns.

For example, click on the Financial group to find functions that can help you calculate items like net present value, future value, cumulative interest paid, cumulative principal paid, etc.

NOMINAL returns the annual nominal interest rate

You can also click on More Functions which opens up even more possibilities for advanced Excel formulas.

For example, the Statistical group is useful if you need to calculate a statistical value. This includes functions for maximum value, minimum value, forecast value, gamma function value, etc. You can insert a cumulative distribution function and other useful tools for data analysis.

NORM.DIST can be used either as a cumulative distribution function or as a probability density function

Learn how to use these formulas and more by signing up for my free online Excel course.

We will help you make the most out of your Excel experience! 📈

Other relevant resources

If you enjoyed this article, you can visit my YouTube channel for more in-depth tutorials and other fun stuff!

Did you know that the Flash Fill feature can help speed up your work by automatically filling a repetitive pattern Excel detects from your data? Learn more here.

Thanks for reading! 😄

Kasper Langmann2023-02-23T11:47:15+00:00

Page load link

Понравилась статья? Поделить с друзьями:
  • Command for microsoft excel
  • Command for bold in word
  • Command buttons on excel
  • Command button in word
  • Comma use after the word but