Excel Training
Mathematical Functions
In Excel, the SUM function is used to calculate the numbers of a range. It adds up all the numbers provided as arguments and returns the total.
A range, is a group of cells that you will be referring to.
Here is how you would construct a SUM function:
SUM(number1, [number2], ...)
- number1, number2, and so on are the numerical values or cell references that you want to include in the sum. You can include up to 255 arguments.
Here's an example to illustrate how to use the SUM function in Excel:
Suppose you have a set of numbers in cells A1 to A5: 10, 15, 20, 25, and 30. You can use the SUM function to find their sum. In cell B1, you would enter the following formula:
=SUM(A1:A5)
After pressing Enter, cell B1 would display the result: 100, which is the sum of the numbers 10, 15, 20, 25, and 30.
You can also use the SUM function with non-contiguous ranges and mix cell references with numerical values as arguments. The function will ignore any text values in the range and only add up the numerical values.
If you need to exclude certain values from the sum based on specific conditions, you can use the SUMIF or SUMIFS functions, which allow you to specify criteria for including or excluding values in the sum calculation.
The SUM function is a versatile and commonly used function in Excel for calculating totals, subtotals, and aggregating data in spreadsheets.
In Excel, the AVERAGE function is used to calculate the arithmetic mean of a range of values. It returns the average of the numbers provided as arguments.
Here is how you would construct the AVERAGE function:
=AVERAGE(number1, [number2], ...)
- number1, number2, and so on are the numerical values or cell references that you want to include in the average calculation. You can include up to 255 arguments.
Here's an example to illustrate how to use the AVERAGE function in Excel:
Let's say you have a set of numbers in cells A1 to A5: 10, 15, 20, 25, and 30. You can use the AVERAGE function to find their average. In cell B1, you would enter the following formula:
=AVERAGE(A1:A5)
After pressing Enter, cell B1 would display the result: 20, which is the average of the numbers 10, 15, 20, 25, and 30.
You can also use the AVERAGE function with non-contiguous ranges and mix cell references with numerical values as arguments. The function will ignore any text values or empty cells in the range when calculating the average. However if there is a 0 in the cell this will be included as it is a numeric value.
Remember to use commas (,) as separators between arguments and enclose cell references in parentheses if necessary.
The AVERAGE function is one of the many statistical functions available in Excel and is useful for analysis data and calculating averages in spreadsheets.
In Excel, the RAND function is used to generate a random decimal number between 0 and 1. Each time the worksheet is recalculated, a new random number is generated.
Here's an example to illustrate how to use the RAND function in Excel:
Suppose you want to generate a random number between 0 and 1 in cell A1. You would enter the following formula in cell A1:
=RAND()
After pressing Enter, cell A1 will display a random decimal number between 0 and 1. If you recalculate the worksheet, a new random number will be generated.
You can use the RAND function in various ways in Excel. For example, you can use it to generate random numbers within a specific range by multiplying the result of the RAND function by the range size and adding the minimum value.
To generate random whole numbers within a specific range, you can combine the RAND function with other functions like ROUND, INT, and RANDBETWEEN.
This is how those formula would look.
It's important to note that the RAND function is a volatile function, meaning it recalculates each time the worksheet recalculates, even if other cells haven't changed. If you want to generate a random number once and keep it static, you can copy the formula and paste it as a value using the Paste Special feature.
The RAND function is commonly used in Excel for simulations, random sampling, and generating test data.
In Excel, the MIN function is used to find the smallest value within a range of numbers. It returns the minimum value from the specified arguments.
Here is how you would construct the MIN function
MIN(number1, [number2], ...)
- number1, number2, and so on are the numerical values or cell references from which you want to find the minimum. You can include up to 255 arguments.
Here's an example to illustrate how to use the MIN function in Excel:
Let's say you have a set of numbers in cells A1 to A5: 10, 15, 20, 25, and 30. You can use the MIN function to find the smallest value. In cell B1, you would enter the following formula:
=MIN(A1:A5)
After pressing Enter, cell B1 would display the result: 10, which is the smallest value in the range.
You can also use the MIN function with non-contiguous ranges and mix cell references with numerical values as arguments. The function will ignore any text values in the range and only consider the numerical values when finding the minimum.
If you need to find the minimum value based on certain criteria or conditions, you can use the MINIFS function. It allows you to specify criteria and evaluate multiple ranges or arrays.
The MIN function is commonly used in Excel for identifying the lowest value in a set of data or determining the minimum value among a range of values.
In Excel, the MAX function is used to find the largest value within a range of numbers. It returns the maximum value from the specified arguments.
Here is how you would construct the MAX function
MAX(number1, [number2], ...)
- number1, number2, and so on are the numerical values or cell references from which you want to find the maximum. You can include up to 255 arguments.
Here's an example to illustrate how to use the MAX function in Excel:
Let's say you have a set of numbers in cells A1 to A5: 10, 15, 20, 25, and 30. You can use the MAX function to find the largest value. In cell B1, you would enter the following formula:
=MAX(A1:A5)
After pressing Enter, cell B1 would display the result: 30, which is the largest value in the range.
You can also use the MAX function with non-contiguous ranges and mix cell references with numerical values as arguments. The function will ignore any text values in the range and only consider the numerical values when finding the maximum.
If you need to find the maximum value based on certain criteria or conditions, you can use the MAXIFS function. It allows you to specify criteria and evaluate multiple ranges or arrays.
The MAX function is commonly used in Excel for identifying the highest value in a set of data or determining the maximum value among a range of values.
In Excel, the SUMPRODUCT function is used to calculate the sum of the products of corresponding values in multiple arrays or ranges. It multiplies corresponding values in the arrays and then adds up the products.
Here is how you would construct a SUMPRODUCT function.
SUMPRODUCT(array1, [array2], ...)
- array1, array2, and so on are the arrays or ranges that you want to multiply and then sum.
Here's an example to illustrate how to use the SUMPRODUCT function in Excel:
Let's say you have two sets of numbers in cells A1 to A5 and B1 to B5: 1, 2, 3, 4, and 5 in A1:A5, and 10, 20, 30, 40, and 50 in B1:B5. You can use the SUMPRODUCT function to find the sum of the products of these two arrays. In cell C1, you would enter the following formula:
=SUMPRODUCT(A1:A5,B1:B5)
After pressing Enter, cell C1 would display the result: 550, which is the sum of the products: (1 * 10) + (2 * 20) + (3 * 30) + (4 * 40) + (5 * 50).
You can use the SUMPRODUCT function with more than two arrays or ranges. It will multiply the corresponding values in each array or range and then sum the products.
The SUMPRODUCT function is commonly used in Excel for various calculations, such as weighted averages, calculating totals based on multiple criteria, and performing array operations. It provides flexibility for performing calculations involving multiple sets of data.
Textual Formulas
In Excel, the TRIM function is used to remove extra spaces from text strings, specifically leading and trailing spaces. It allows you to clean up and normalise text by eliminating unnecessary spaces.
Here is how you would construct a TRIM function.
TRIM(text)
- text is the text string or cell reference containing the text you want to trim.
Here's an example to illustrate how to use the TRIM function in Excel:
Let's say you have a text string in cell A1 with extra spaces before and after the text: " Example Text ". You can use the TRIM function to remove those extra spaces. In cell B1, you would enter the following formula:
=TRIM(A1)
After pressing Enter, cell B1 would display the result: "Example Text" without the leading and trailing spaces. As shown by the length count under the text.
The TRIM function only removes extra spaces within the text, not spaces between words or within words. It removes all leading spaces (spaces before the first non-space character) and trailing spaces (spaces after the last non-space character) from the text.
You can use the TRIM function to clean up text in various scenarios, such as when working with imported or copied data that contains unnecessary spaces, or when dealing with text data that needs to be processed or analyses.
In Excel, the CONCATENATE function is used to combine multiple text strings into one single text string. It allows you to concatenate, or join, different text values or cell references together.
Here is how you would construct a TRIM function.
CONCATENATE(text1, [text2], ...)
- text1, text2, and so on are the text strings or cell references that you want to concatenate. You can include up to 255 arguments.
Here's an example to illustrate how to use the CONCATENATE function in Excel:
Let's say you have the first name in cell A1 and the last name in cell B1. You want to combine these names into a single full name. In cell C1, you would enter the following formula:
=CONCATENATE(A1," ",B1)
After pressing Enter, cell C1 would display the result: the full name formed by combining the first name and last name with a space in between.
Alternatively, you can use the ampersand (&) operator as a shorthand for the CONCATENATE function. The previous example can be written as:
=A1 & " " & B1
Both formulas produce the same result.
You can concatenate not only text strings but also include additional text, numbers, or other characters by enclosing them in double quotation marks (""). The CONCATENATE function preserves the formatting of the original text values.
The CONCATENATE function is useful for combining text values or constructing dynamic text strings in Excel, such as creating personal greetings, constructing file paths, or merging data from multiple cells into one cell.
In Excel, the SUBSTITUTE function is used to replace specific instances of text within a text string. It allows you to substitute one or more occurrences of a particular text with another text.
Here is how you would construct a SUBSTITUTE function.
SUBSTITUTE(text, old_text, new_text, [instance_num])
- text is the text string or cell reference that contains the text you want to modify.
- old_text is the specific text you want to replace within the text string.
- new_text is the text you want to replace old_text with.
- [instance_num] is an optional argument that specifies which occurrence of old_text you want to replace. If omitted, all occurrences of old_text within text will be replaced.
Here is how you would construct a SUBSTITUTE function.
Here's an example to illustrate how to use the SUBSTITUTE function in Excel:
Let's say you have a text string in cell A1: "Hello World! Hello World!". You want to replace all occurrences of "World" with "Universe". In cell B1, you would enter the following formula:
=SUBSTITUTE(A1, "World", "Universe")
After pressing Enter, cell B1 would display the result: "Hello Universe! Hello Universe!".
If you want to replace a specific occurrence of old_text, you can provide the instance_num argument. For example, if you only want to replace the second occurrence of "World", you can modify the formula as follows:
=SUBSTITUTE(A1, "World", "Universe", 2)
After pressing Enter, cell B1 would display the result: "Hello World! Hello Universe!".
The SUBSTITUTE function is commonly used in Excel for modifying text strings, replacing characters or specific words, and performing find-and-replace operations within cell contents.
In Excel, the UPPER function is used to convert a text string to uppercase. It converts all lowercase letters in the text to their corresponding uppercase counterparts.
Here is how you would construct a UPPER function.
UPPER(text)
- text is the text string or cell reference that you want to convert to uppercase.
Here's an example to illustrate how to use the UPPER function in Excel:
Let's say you have a text string in cell A1: "hello world". You want to convert it to uppercase. In cell B1, you would enter the following formula:
=UPPER(A1)
After pressing Enter, cell B1 would display the result: "HELLO WORLD".
The UPPER function converts all lowercase letters in the text to uppercase, leaving any uppercase letters or non-alphabetic characters unchanged. It does not modify numbers, symbols, or special characters.
You can use the UPPER function to convert text to uppercase for various purposes, such as standard text formatting, comparing text strings in a case-insensitive manner, or generating consistent output for reports or labels.
In Excel, the LOWER function is used to convert a text string to lowercase. It converts all uppercase letters in the text to their corresponding lowercase counterparts.
Here is how you would construct a LOWER function
LOWER(text)
- text is the text string or cell reference that you want to convert to lowercase.
Here's an example to illustrate how to use the LOWER function in Excel:
Let's say you have a text string in cell A1: "HELLO WORLD". You want to convert it to lowercase. In cell B1, you would enter the following formula:
=LOWER(A1)
After pressing Enter, cell B1 would display the result: "hello world".
The LOWER function converts all uppercase letters in the text to lowercase, leaving any lowercase letters or non-alphabetic characters unchanged. It does not modify numbers, symbols, or special characters.
You can use the LOWER function to convert text to lowercase for various purposes, such as standard text formatting, comparing text strings in a case-insensitive manner, or generating consistent output for reports or data analysis.
In Excel, the PROPER function is used to convert a text string to proper case, where the first letter of each word is capital, and the remaining letters are lowercase. It helps in standard the capitulation of text.
Here is how you would construct a PROPER function
PROPER(text)
- text is the text string or cell reference that you want to convert to proper case.
Here's an example to illustrate how to use the PROPER function in Excel:
Let's say you have a text string in cell A1: "hello world". You want to convert it to proper case. In cell B1, you would enter the following formula:
=PROPER(A1)
After pressing Enter, cell B1 would display the result: "Hello World".
The PROPER function capitals the first letter of each word in the text string and converts all other letters to lowercase. It recognises word boundaries based on spaces or other non-alphabetic characters.
You can use the PROPER function to convert text to proper case for various purposes, such as correcting the capital of names or titles, improving the appearance of text in reports or presentations, or ensuring consistent formatting of text data.
In Excel, the LEN function is used to calculate the length, or the number of characters, in a text string. It returns the total count of characters, including spaces, in the specified text.
Here is how you would construct a LEN function
LEN(text)
- text is the text string or cell reference for which you want to determine the length.
Here's an example to illustrate how to use the LEN function in Excel:
Let's say you have a text string in cell A1: "Hello, World!". You want to determine its length. In cell B1, you would enter the following formula:
=LEN(A1)
After pressing Enter, cell B1 would display the result: 13, which is the number of characters in the text string "Hello, World!".
The LEN function counts all characters, including letters, numbers, symbols, spaces, and punctuation marks. It does not distinguish between uppercase and lowercase letters.
You can use the LEN function in various scenarios, such as checking the length of text inputs to ensure they meet certain criteria or calculating the length of text strings for data analysis or formatting purposes.
In Excel, the LEFT function is used to extract a specified number of characters from the beginning (leftmost side) of a text string. It allows you to retrieve a substring containing the leftmost characters of a text value.
Here is how you would construct a LEFT function
- LEFT(text, num_chars)
- text is the text string or cell reference from which you want to extract characters.
- num_chars is the number of characters you want to extract from the left side of the text string.
Here's an example to illustrate how to use the LEFT function in Excel:
Let's say you have a text string in cell A1: "Hello, World!". You want to extract the first 5 characters from the left. In cell B1, you would enter the following formula:
=LEFT(A1, 5)
After pressing Enter, cell B1 would display the result: "Hello".
The LEFT function retrieves the specified number of characters from the left side of the text string. It returns a substring containing the leftmost characters.
You can use the LEFT function in various scenarios, such as extracting specific prefixes or codes from text values, working with fixed-length data, or splitting text strings based on a certain number of characters from the left side.
In Excel, the RIGHT function is used to extract a specified number of characters from the end (rightmost side) of a text string. It allows you to retrieve a substring containing the rightmost characters of a text value.
Here is how you would construct a RIGHT function
RIGHT(text, num_chars)
- text is the text string or cell reference from which you want to extract characters.
- num_chars is the number of characters you want to extract from the right side of the text string.
Here's an example to illustrate how to use the RIGHT function in Excel:
Let's say you have a text string in cell A1: "Hello, World!". You want to extract the last 6 characters from the right. In cell B1, you would enter the following formula:
=RIGHT(A1, 6)
After pressing Enter, cell B1 would display the result: "World!".
The RIGHT function retrieves the specified number of characters from the right side of the text string. It returns a substring containing the rightmost characters.
You can use the RIGHT function in various scenarios, such as extracting specific suffixes or codes from text values, working with fixed-length data, or splitting text strings based on a certain number of characters from the right side.
In Excel, the MID function is used to extract a specific number of characters from a text string, starting from a specified position. It allows you to retrieve a substring from within a larger text value.
Here is how you would construct a MID function.
MID(text, start_num, num_chars)
- text is the text string or cell reference from which you want to extract characters.
- start_num is the position within the text string where you want to begin extraction.
- num_chars is the number of characters you want to extract from the text string.
Here's an example to illustrate how to use the MID function in Excel:
Let's say you have a text string in cell A1: "Hello, World!". You want to extract a substring starting from the 8th position, with a length of 5 characters. In cell B1, you would enter the following formula:
=MID(A1, 8, 5)
After pressing Enter, cell B1 would display the result: "World".
The MID function extracts the specified number of characters from the text string, starting from the specified position. It returns a substring based on the starting position and length provided.
You can use the MID function in various scenarios, such as extracting specific portions of text from larger strings, retrieving substrings based on certain positions or lengths, or parsing text values based on fixed patterns or delimiters.
Logical Formulas
In Excel, the AND function is a logical function that checks if all of the specified conditions or arguments are TRUE. It returns TRUE if all conditions are met and FALSE if any of the conditions are not met.
Here is how you would construct a AND function.
AND(logical1, logical2, ...)
- logical1, logical2, and so on are the conditions or logical expressions that you want to evaluate.
Here's an example to illustrate how to use the AND function in Excel:
Let's say you have a logical value in cells A1. You want to check if value is TRUE. In cell B1, you would enter the following formula:
=AND (A1> Greater than 0, A1< Less than 10)
=AND(A1>0,A1<10)
After pressing Enter, cell B1 would display the result: TRUE A1, or FALSE if any of them are FALSE.
The AND function can take multiple arguments, allowing you to check the truthfulness of multiple conditions at once. It requires all arguments to evaluate to TRUE for the function to return TRUE. If any of the arguments is FALSE, the function returns FALSE.
The AND function is often used in combination with other functions or logical operators to create complex logical expressions and perform conditional calculations or evaluations in Excel.
In Excel, the OR function is a logical function that checks if at least one of the specified conditions or arguments is TRUE. It returns TRUE if any of the conditions are met, and FALSE if none of the conditions are met.
Here is how you would construct a OR function.
OR(logical1, logical2, ...)
- logical1, logical2, and so on are the conditions or logical expressions that you want to evaluate.
Here's an example to illustrate how to use the OR function in Excel:
Let's say you have two logical values in cells A1 and B1. You want to check if either of the values is TRUE. In cell C1, you would enter the following formula:
=OR(A1> Greater than 75, B1> Greater than 75)
=OR(A1>75,B1>75)
After pressing Enter, cell C1 would display the result: TRUE if either A1 or B2 is TRUE, or FALSE if both of them are FALSE.
The OR function can take multiple arguments, allowing you to check the truthfulness of multiple conditions at once. It returns TRUE if any of the arguments evaluate to TRUE. If all of the arguments are FALSE, the function returns FALSE.
The OR function is often used in combination with other functions or logical operators to create complex logical expressions and perform conditional calculations or evaluations in Excel. It is particularly useful when you want to evaluate multiple conditions and determine if any one of them is met.
In Excel, the IF function is a logical function that allows you to perform different actions based on a specified condition. It evaluates a given condition and returns one value if the condition is true, and another value if the condition is false.
Here is how you would construct a OR function.
IF(logical_test, value_if_true, value_if_false)
- logical_test is the condition or logical expression that you want to evaluate.
- value_if_true is the value that will be returned if the logical_test is true.
- value_if_false is the value that will be returned if the logical_test is false.
Here's an example to illustrate how to use the IF function in Excel:
Let's say you have a numeric value in cell A1. You want to check if it is greater than 10. If it is, you want to display "Greater than 10", otherwise, you want to display "Less than or equal to 10". In cell B1, you would enter the following formula:
=IF(A1>10, "Greater than 10", "Less than or equal to 10")
=IF(A1>10, "Greater than 10", "Less than or equal to 10")
After pressing Enter, cell B1 would display the result based on the condition. If the value in A1 is greater than 10, it will display "Greater than 10". Otherwise, it will display "Less than or equal to 10".
The IF function allows you to create conditional statements in Excel and perform different actions based on the result of a logical test. It is widely used for data analysis, calculations, and decision-making based on specific conditions.
In Excel, the COUNTIF function is used to count the number of cells within a range that meet a specific condition or criteria. It allows you to count cells based on a single criterion.
Here is how you would construct a COUNTIF function.
COUNTIF(range, criteria)
- range is the range of cells you want to evaluate.
- criteria is the condition or criteria in the form of a text, number, or logical expression that you want to apply to the cells in the range.
Here's an example to illustrate how to use the COUNTIF function in Excel:
Let's say you have a range of values in cells A1 to A5, and you want to count how many of them are greater than 10. In cell B1, you would enter the following formula:
=COUTIF(A1:A5, "> Greater than 10")
=COUNTIF(A1:A5, ">10")
After pressing Enter, cell B1 would display the count of cells in the range A1 to A5 that are greater than 10.
The COUNTIF function evaluates each cell in the specified range and counts only those cells that meet the specified criterion. The criterion can be based on numerical values, text values, logical expressions, or wildcards.
You can use the COUNTIF function for various purposes, such as data analysis, creating reports, filtering data based on specific criteria, or identifying patterns within a dataset.
In Excel, the SUMIF function is used to calculate the sum of cells within a range that meet a specific condition or criteria. It allows you to add up values based on a single criterion.
Here is how you would construct a SUMIF function.
SUMIF(range, criteria, [sum_range])
- range is the range of cells you want to evaluate.
- criteria is the condition or criteria in the form of a text, number, or logical expression that you want to apply to the cells in the range.
- sum_range (optional) is the range of cells that you want to sum if the corresponding cells in the range meet the specified criteria. If this argument is omitted, the function will sum the cells in the range that meet the criteria.
Here's an example to illustrate how to use the SUMIF function in Excel:
Let's say you have a range of values in cells A1 to A5, and you want to calculate the sum of values that are greater than 10. In cell B1, you would enter the following formula:
=SUMIF(A1:A5, "> Great than 10")
=SUMIF(A1:A5, ">10")
After pressing Enter, cell B1 would display the sum of cells in the range A1 to A5 that are greater than 10.
The SUMIF function evaluates each cell in the specified range and includes in the sum only those cells that meet the specified criterion. The criterion can be based on numerical values, text values, logical expressions, or wildcards.
You can use the SUMIF function for various purposes, such as calculating totals based on specific conditions, summarising data, creating conditional calculations, or filtering and data analysis based on criteria.
Date-time (Temporal) Formulas
In Excel, the TODAY function is a date function that returns the current date as a serial number. It does not require any arguments.
When you enter "=TODAY()" in a cell, it will display the current date as a serial number. Excel stores dates as sequential serial numbers, where January 1, 1900, is represented by the serial number 1, January 2, 1900, by 2, and so on. The TODAY function automatically updates the result to the current date whenever you open or recalculate the worksheet
Here's an example to illustrate the usage of the TODAY function:
=TODAY()
After pressing Enter in cell A1, it will display the current date in the desired date format. For example, if today's date is 27th June, 2023, the cell will display "27/6/2023".
You can use the TODAY function in various scenarios, such as tracking deadlines, calculating durations, determining the age of a person or an item based on the current date, or generating dynamic reports that rely on the current date.
To enter the current date as a static value, press CTRL + ; (semicolon).
In Excel, the NOW function is a date and time function that returns the current date and time as a serial number. It does not require any arguments.
When you enter "=NOW()" in a cell, it will display the current date and time as a serial number. The serial number represents the number of days since January 1, 1900, and the time as a fraction of a day.
Here's an example to illustrate the usage of the NOW function:
=NOW()
After pressing Enter in cell A1, it will display the current date and time. For example, if the current date is 27th June, 2023, and the current time is 15:37, the cell will display "27/6/2023 15:37".
The NOW function updates the displayed value to the current date and time whenever you open or recalculate the worksheet. This makes it useful for capturing real-time data or tracking the current date and time in various calculations and scenarios.
Note that the displayed value of the NOW function is based on your computer's system clock. If you need to freeze the value at a specific point in time, you can use paste special or copy and paste values to convert the formula result to a static value.
To enter the current time as a static value, press CTRL + SHIFT + ; (semicolon).
In Excel, the DAY function is used to extract the day value from a date. It takes a date as an argument and returns the day as a number from 1 to 31.
Here is how you would construct a DAY function.
DAY(date)
- date is the date from which you want to extract the day value.
Here's an example to illustrate how to use the DAY function in Excel:
Let's say you have a date value in cell A1, such as "28/06/2023". If you want to extract the day value from this date, you would enter the following formula in cell B1:
=DAY(A1)
After pressing Enter, cell B1 would display the day value from the date in cell A1, which in this case is 26.
The DAY function extracts the day component from a date and returns it as a number. It is particularly useful when you need to perform calculations or analysis based on the day value within a date.
You can use the DAY function in various scenarios, such as determining the day of the month for a given date, extracting specific date components for further calculations, or performing conditional formatting based on the day value of dates.
In Excel, the MONTH function is used to extract the month value from a date. It takes a date as an argument and returns the month as a number from 1 to 12.
Here is how you would construct a MONTH function.
MONTH(date)
- date is the date from which you want to extract the month value.
Here's an example to illustrate how to use the MONTH function in Excel:
Let's say you have a date value in cell A1, such as "28/06/2023". If you want to extract the month value from this date, you would enter the following formula in cell B1:
=MONTH(A1)
After pressing Enter, cell B1 would display the month value from the date in cell A1, which in this case is 6.
The MONTH function extracts the month component from a date and returns it as a number. It is particularly useful when you need to perform calculations or analysis based on the month value within a date.
You can use the MONTH function in various scenarios, such as determining the month of a given date, extracting specific date components for further calculations, or performing conditional formatting based on the month value of dates.
In Excel, the YEAR function is used to extract the year value from a date. It takes a date as an argument and returns the year as a four-digit number.
Here is how you would construct a YEAR function.
YEAR(date)
- date is the date from which you want to extract the year value.
Here's an example to illustrate how to use the YEAR function in Excel:
Let's say you have a date value in cell A1, such as "6/26/2023". If you want to extract the year value from this date, you would enter the following formula in cell B1:
=YEAR(A1)
After pressing Enter, cell B1 would display the year value from the date in cell A1, which in this case is 2023.
The YEAR function extracts the year component from a date and returns it as a four-digit number. It is particularly useful when you need to perform calculations or analysis based on the year value within a date.
You can use the YEAR function in various scenarios, such as determining the year of a given date, extracting specific date components for further calculations, or performing conditional formatting based on the year value of dates.
In Excel, the DATEDIF function does exist in Excel, despite not being documented in the official Excel help files. It is a hidden function that can still be used to calculate the difference between two dates in terms of years, months, or days.
Here is how you would construct a DATEIF function.
DATEDIF(start_date, end_date, unit)
- start_date is the starting date.
- end_date is the ending date.
- unit specifies the unit of measurement for the difference, such as "y" for years, "m" for months, or "d" for days.
Here's an example to illustrate how to use the DATEDIF function in Excel:
Let's say you have a start date in cell A1 and an end date in cell B1. If you want to calculate the difference in years between these two dates, you would enter the following formula in cell C1:
=DATEDIF(A1, B1, "y")
After pressing Enter, cell C1 would display the number of years between the start date and end date.
The DATEDIF function can be used to calculate the difference between two dates in various units, including years, months, and days. However, please note that the DATEDIF function has some known limitations and quirks, such as inconsistent behaviour for certain date combinations. If you encounter any issues or inconsistencies with the DATEDIF function, you may consider alternative approaches to calculate date differences using other Excel functions or formulas.
In Excel, the DAYS function is used to calculate the number of days between two dates. It takes two arguments: the start date and the end date.
Here is how you would construct a DAYS function.
DAYS(end_date, start_date)
- end_date is the end date.
- start_date is the start date.
Here's an example to illustrate how to use the DAYS function in Excel:
Let's say you have a start date in cell A1 and an end date in cell B1. If you want to calculate the number of days between these two dates, you would enter the following formula in cell C1:
=DAYS(B1, A1)
After pressing Enter, cell C1 would display the number of days between the start date and end date.
The DAYS function calculates the difference in days between two dates. The result is a positive number if the end date is greater than the start date. If the start date is greater than the end date, the result will be a negative number.
You can use the DAYS function to perform various calculations involving date differences, such as determining the duration between two events, calculating project timelines, or tracking the number of days elapsed between specific dates.
Lookup Formulas
In Excel, the VLOOKUP function is a powerful tool for searching and retrieving data from a table. It allows you to find a value in the leftmost column of a table and return a corresponding value from a specified column in the same row.
Here is how you would construct a VLOOKUP function.
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value is the value you want to search for in the leftmost column of the table.
- table_array is the range of cells that represents the table you want to search in. It should include both the lookup column and the column from which you want to retrieve the result.
- col_index_num is the column number in the table_array from which you want to retrieve the result. It is relative to the leftmost column of the table_array.
- range_lookup (optional) is a logical value that indicates whether you want an exact match or an approximate match. If omitted or set to TRUE (or 1), an approximate match is performed. If set to FALSE (or 0), an exact match is required.
Here's an example to illustrate how to use the VLOOKUP function in Excel:
Suppose you have a table in cells A1 to B5, where column A contains employee names and column B contains their respective salaries. In cell D1, you want to find the salary of a specific employee, whose name is entered in cell C1. You can use the following formula:
=VLOOKUP(C1, A1:B5, 2, FALSE)
After pressing Enter, cell D1 would display the salary of the employee whose name is specified in cell C1.
The VLOOKUP function is commonly used for tasks like looking up values from a table, retrieving associated data, or performing data analysis. It is particularly useful when working with large datasets or when you need to retrieve information based on a specific criterion.
In Excel, the HLOOKUP function is similar to the VLOOKUP function, but it searches for a value horizontally across the top row of a table and returns a corresponding value from a specified row.
Here is how you would construct a HLOOKUP function.
HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
- lookup_value is the value you want to search for in the top row of the table.
- table_array is the range of cells that represents the table you want to search in. It should include both the lookup row and the row from which you want to retrieve the result.
- row_index_num is the row number in the table_array from which you want to retrieve the result. It is relative to the top row of the table_array.
- range_lookup (optional) is a logical value that indicates whether you want an exact match or an approximate match. If omitted or set to TRUE (or 1), an approximate match is performed. If set to FALSE (or 0), an exact match is required.
Here's an example to illustrate how to use the HLOOKUP function in Excel:
Suppose you have a table in cells A1 to E2, where row 1 contains product names and row 2 contains their respective prices. In cell F1, you want to find the price of a specific product, whose name is entered in cell F2. You can use the following formula:
=HLOOKUP(F2, A1:E2, 2, FALSE)
After pressing Enter, cell F1 would display the price of the product whose name is specified in cell F2.
The HLOOKUP function is commonly used when you have data arranged horizontally and need to retrieve values based on a specific criterion. It is particularly useful when working with tables that have row headers or when you need to search for data across multiple columns in a row.
In Excel, the XLOOKUP function is a powerful lookup function introduced in recent versions (beginning with Excel 365). It allows you to search for a value in a column or row and retrieve a corresponding value from another column or row, with more flexibility and advanced features compared to traditional lookup functions like VLOOKUP and HLOOKUP.
Here is how you would construct a XLOOKUP function.
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
- lookup_value is the value you want to search for.
- lookup_array is the range of cells that contains the values you want to search in.
- return_array is the range of cells that contains the values you want to retrieve the result from.
- if_not_found (optional) is the value to return if the lookup value is not found. It can be an actual value or an error value.
- match_mode (optional) determines how the function handles approximate matches. It can be set to 0 (exact match) or 1 (approximate match). By default, if omitted, an exact match is performed.
- search_mode (optional) specifies the search direction. It can be set to 1 (search from top to bottom) or -1 (search from bottom to top). By default, if omitted, the search is performed from top to bottom.
Here's an example to illustrate how to use the XLOOKUP function in Excel:
Suppose you have a list of product names in column A and their respective prices in column B. In cell D1, you want to find the price of a specific product, whose name is entered in cell C1. You can use the following formula:
=XLOOKUP(C1, A:A, B:B, "Not Found")
After pressing Enter, cell D1 would display the price of the product whose name is specified in cell C1. If the product name is not found, it would display "Not Found" as specified in the if_not_found parameter.
The XLOOKUP function provides more flexibility compared to traditional lookup functions. It supports both horizontal and vertical lookups, approximate or exact matches, and can handle both left-to-right and right-to-left lookups. Additionally, it supports wildcard characters for more advanced matching.
Note: The XLOOKUP function is available in the newer versions of Excel, starting from Excel 365 and Excel 2021 for Windows. It may not be available in older versions of Excel.
In Excel, the INDEX function is a versatile function that allows you to retrieve a value or a range of values from a specific position within a range or array.
Here is how you would construct a INDEX function.
INDEX(array, row_num, [column_num])
- array is the range or array from which you want to retrieve the value(s).
- row_num specifies the row number within the array from which you want to retrieve the value(s).
- column_num (optional) specifies the column number within the array from which you want to retrieve the value(s). If omitted, the function will return the entire row specified by row_num.
Here are a few examples to illustrate how to use the INDEX function in Excel:
1. Retrieve a single value:
Suppose you have a range of values in cells A1 to C3. If you want to retrieve the value in the second row and third column, you can use the following formula:
=INDEX(A1:C3, 2, 3)
This formula would return the value in cell C2.
2. Retrieve a range of values:
If you want to retrieve a range of values from a specific row, you can omit the column_num parameter. For example, to retrieve the values in the second row of the range A1:C3, you can use the following formula:
=INDEX(A1:C3, 2,)
This formula would return the range of values A2:C2.
The INDEX function is powerful and can be used in various scenarios, such as retrieving values based on specific row and column references, dynamically selecting values from a range, or creating more complex lookup formulas. It provides flexibility when working with data in Excel.
In Excel, the MATCH function is used to find the relative position of a specified value within a range or array. It returns the position of the first occurrence of the value in the range.
MATCH(lookup_value, lookup_array, [match_type])
- lookup_value is the value you want to find within the range.
- lookup_array is the range or array where you want to search for the value.
- match_type (optional) specifies the type of match you want to perform. It can be set to 1 (or omitted) for an approximate match, -1 for a reverse exact match, or 0 for an exact match.
Here's an example to illustrate how to use the MATCH function in Excel:
Suppose you have a list of product names in column A. In cell B1, you want to find the position of a specific product name, which is entered in cell A1. You can use the following formula:
=MATCH(A1, A:A, 0)
After pressing Enter, cell B1 would display the relative position of the specified product name within the range A:A.
The MATCH function is commonly used in conjunction with other functions, such as INDEX or VLOOKUP, to perform more advanced lookup and retrieval operations. It can be used to locate values within a range, find the position of an item in a sorted list, or perform approximate matches based on specific criteria.
Note that if the MATCH function doesn't find a match, it returns the #N/A error.
Data Tools
In Excel, data sorting refers to the process of arranging data in a specific order based on one or more criteria. Sorting can help Organise and analyse data more effectively.
To sort data in Excel, you can follow these steps:
Select the range of cells that you want to sort. This can be a single column, multiple columns, or the entire data range.
Go to the "Data" tab in the Excel ribbon and click on the "Sort" button.
Alternatively, you can right-click within the selected range and choose "Sort" from the context menu.
The "Sort" dialog box will appear. In this dialog box, you can specify the sorting options:
- Sort by: Select the column or columns that you want to sort by. You can choose a single column or add multiple levels of sorting by selecting additional columns.
- Sort on: Specify the type of data in the selected column(s), such as values, cell colour, font colour, or cell icon.
- Order: Choose the sorting order, either ascending (smallest to largest or A to Z) or descending (largest to smallest or Z to A).
- Once you have specified the sorting options, click the "OK" button to apply the sorting to the selected data
Excel will rearrange the data based on the sorting criteria you specified. The sorted data will be displayed in the selected range.
It's important to note that when sorting data, make sure to select the entire data range, including any headers or labels, to avoid misalignment of data. Also, be cautious when sorting data that is part of a larger table or contains formulas, as sorting may affect the integrity of the table or formulas.
Sorting data in Excel is a useful feature for organising and analysing information. It allows you to arrange data in a desired order and make it easier to find specific values, identify patterns, or perform calculations based on sorted data.
In Excel, filtering refers to the process of selectively displaying or hiding data based on specific criteria. Filtering allows you to focus on a subset of data that meets certain conditions, making it easier to analyse and work with large datasets.
To filter data in Excel, you can follow these steps:
Select the range of cells that you want to filter. This can be a single column, multiple columns, or the entire data range.
Go to the "Data" tab in the Excel ribbon and click on the "Filter" button.
Alternatively, you can right-click within the selected range and choose "Filter" from the context menu.
Excel will add filter arrows to the header row of the selected range. Click on the filter arrow for the column you want to filter.
A dropdown menu will appear with various filtering options. You can choose from options such as text filters, number filters, date filters, and more, depending on the data type in the selected column.
Select the desired filtering criteria from the dropdown menu. You can choose to display only specific values, filter by a range of values, sort the values in ascending or descending order, and more.
Once you have selected the filtering criteria, Excel will automatically update the displayed data to show only the rows that meet the specified conditions. The filtered rows will be visible, while the rows that do not meet the criteria will be temporarily hidden.
You can apply multiple filters to different columns in the same dataset to further refine your data. Simply repeat the above steps for each column you want to filter.
To remove the filters and display all the data again, you can either click on the "Filter" button in the Excel ribbon or right-click within the filtered range and choose "Filter" from the context menu to toggle off the filtering.
Filtering is a powerful feature in Excel that allows you to analyse and manipulate data based on specific criteria. It helps you quickly identify trends, outliers, or specific subsets of data without permanently modifying the dataset.
In Excel, data validation is a feature that allows you to control and restrict the type and format of data that can be entered into a cell or range of cells. It helps ensure data accuracy and consistency by defining certain rules or criteria that must be met before data can be accepted.
To apply data validation in Excel, you can follow these steps:
Select the cell or range of cells where you want to apply data validation.
Go to the "Data" tab in the Excel ribbon and click on the "Data Validation" button.
The "Data Validation" dialog box will appear. In this dialog box, you can define the validation rules and criteria for the selected cells.
In the "Settings" tab, you can specify the type of data validation you want to apply, such as whole numbers, decimals, dates, times, text length, custom formulas, and more.
Based on the selected data validation type, you can enter specific criteria or values in the input fields provided. For example, if you choose "Whole Number," you can specify the minimum and maximum allowed values.
You can also customise error alerts to display a message when invalid data is entered. This can include a title, error message, and an error style (such as a warning symbol or stop sign).
Once you have defined the data validation criteria, click the "OK" button to apply the validation to the selected cells.
Now, when a user enters data into the validated cells, Excel will check if the entered data meets the specified criteria. If the entered data does not meet the criteria, an error alert will be displayed, and the user will be prompted to correct the data before it can be accepted.
Data validation helps prevent data entry errors and ensures that data conforms to the desired format or range. It is particularly useful when designing input forms, creating templates, or sharing workbooks with others to maintain data integrity and consistency.
The below video shows an example of data validation.
In Excel, removing duplicates is a feature that allows you to identify and remove duplicate values from a range or column of data. This can be useful when you want to streamline your data and eliminate redundant information.
To remove duplicates in Excel, you can follow these steps:
Select the range of cells or columns from which you want to remove duplicates.
Go to the "Data" tab in the Excel ribbon and click on the "Remove Duplicates" button.
The "Remove Duplicates" dialog box will appear. In this dialog box, you can select the columns that you want Excel to use when identifying duplicates. By default, all columns in the selected range are considered.
After selecting the columns, click the "OK" button to start the duplicate removal process.
Excel will analyse the selected range and identify duplicate values based on the specified columns. It will then remove the duplicate values and keep only the unique values in the original range. The remaining data will be adjusted accordingly, and the duplicates will be permanently deleted.
Excel also provides the option to highlight duplicates instead of removing them. To do this, in the "Remove Duplicates" dialog box, you can check the "Duplicate" checkbox and click the "OK" button. Excel will highlight the duplicate values in the selected range, making them easy to identify without deleting them.
Removing duplicates helps clean up data and avoid errors that can occur when working with redundant or repeated information. It is especially useful when working with large datasets or merging data from different sources, ensuring that you have accurate and unique records.
In Excel, conditional formatting is a feature that allows you to apply formatting to cells based on specific conditions or criteria. It helps visually highlight and emphasize certain values or patterns in your data, making it easier to interpret and analyse.
To apply conditional formatting in Excel, you can follow these steps:
Select the range of cells to which you want to apply conditional formatting. This can be a single cell, a column, a row, or a larger data range.
Go to the "Home" tab in the Excel ribbon and click on the "Conditional Formatting" button.
From the dropdown menu, you can choose from various conditional formatting options, such as highlighting cells rules, top/bottom rules, data bars, colour scales, and more.
Select the specific conditional formatting rule that suits your needs. For example, if you choose "Highlight Cells Rules" and then "Greater Than," you can specify a value, and Excel will highlight all cells in the selected range that are greater than that value.
Customise the formatting options for the selected rule. This can include choosing font colour, cell fill colour, borders, number formats, and other formatting styles. You can also preview the changes to see how they will be applied to your data.
Click the "OK" button to apply the conditional formatting to the selected range. Excel will immediately apply the formatting based on the specified conditions.
Conditional formatting rules can be combined, modified, or removed as needed. You can also manage the conditional formatting rules by using the "Manage Rules" option within the conditional formatting menu. This allows you to edit, delete, or re-order the existing rules.
Conditional formatting is a powerful tool in Excel that helps you visually analyse and highlight important aspects of your data. It enables you to identify trends, outliers, specific values, or data patterns by applying formatting that draws attention to them. This feature enhances the visual representation of your data and facilitates better decision-making.
In Excel, the "Text to Columns" feature allows you to split the contents of a single cell or a column into multiple columns based on a specified delimiter or fixed width. This is particularly useful when you have data that is separated by commas, tabs, spaces, or any other character, and you want to separate that data into individual columns.
To use the "Text to Columns" feature in Excel, you can follow these steps:
Select the range of cells or the column that contains the data you want to split.
Go to the "Data" tab in the Excel ribbon and click on the "Text to Columns" button. This will open the "Convert Text to Columns" wizard.
In the first step of the wizard, you need to choose the data type that best represents the format of your data. You can choose between "Delimited" or "Fixed Width."
Delimited: If your data is separated by a specific character, such as commas, tabs, or semicolons, choose this option. You can then select the delimiter character you want to use for splitting the data.
Fixed Width: If your data is arranged in columns of fixed widths, choose this option. You can manually specify the column widths by dragging the lines in the preview window.
After selecting the appropriate option, click the "Next" button.
In the next step, you can further customise the column data format and adjust the column data destination. You can choose to format the columns as General, Text, Date, or choose a specific format. You can also specify the destination cells where you want the split data to be placed.
Once you have made the necessary selections, click the "Finish" button.
Excel will apply the "Text to Columns" operation based on your chosen settings and split the data into separate columns. Each data element will be placed in its respective column, and any leading or trailing spaces will be removed.
The "Text to Columns" feature is helpful when you need to separate data that is combined in a single cell or column into individual columns for better analysis, sorting, or further processing.
Graphics
In Excel, you can create various types of charts to visually represent and analyse your data. Charts help you understand patterns, trends, and relationships in your data more easily. Here's a general guide on how to create a chart in Excel:
Prepare your data: Organise your data in columns or rows with appropriate labels and values. Ensure that the data you want to visualise is selected.
Select the data: Click and drag over the range of cells that you want to include in your chart. Include column or row labels if necessary.
Go to the "Insert" tab in the Excel ribbon and choose the type of chart you want to create. Excel offers various chart types such as column charts, bar charts, line charts, pie charts, and more. Select the specific chart type that best suits your data.
Excel will generate a basic chart based on your selected data. The chart will appear on the worksheet as an object that you can resize and move.
Customise the chart: Excel provides a range of customisation options to enhance the appearance and functionality of your chart. You can modify chart elements such as titles, axis labels, legend, data labels, colours, styles, and more. Right-click on any chart element to access customisation options or use the "Chart Tools" tab in the Excel ribbon.
Analyse and refine: Once your chart is created, you can analyse the visual representation of your data. You can resize and reposition the chart as needed. You can also modify the chart data range or update the data to automatically reflect changes in the chart.
Save and share: Save your Excel file to preserve your chart. You can copy and paste the chart into other documents or presentations. You can also export the chart as an image file or embed it in other applications.
Remember, the specific steps and options may vary slightly depending on the version of Excel you are using. Excel provides extensive charting capabilities, allowing you to create dynamic and visually appealing charts to enhance your data analysis and presentations.
Pivot Tables
In Excel, a pivot table is a powerful data analysis tool that allows you to summarise and analyse large datasets. It enables you to quickly and dynamically re-organise and summaries data based on different dimensions and calculations.
Here's a general guide on how to create a pivot table in Excel:
Prepare your data: Ensure that your data is organised in a tabular format, with column headers and consistent data types. Each column should represent a specific attribute or dimension, and each row should contain the corresponding data.
Select your data: Click and drag over the range of cells that you want to include in your pivot table. Include column headers if applicable.
Go to the "Insert" tab in the Excel ribbon and click on the "PivotTable" button. This will open the "Create PivotTable" dialog box.
In the dialog box, verify that the correct range is selected for your data. If necessary, adjust the range accordingly. You can also choose to place the pivot table in a new worksheet or an existing worksheet.
Click the "OK" button to create the pivot table.
Excel will generate an empty pivot table along with a "PivotTable Field List" pane on the right side of the Excel window. The field list will display the column headers of your original data.
Drag and drop fields: In the "PivotTable Field List" pane, drag and drop the desired fields from the field list into the areas provided, namely "Rows," "Columns," "Values," and "Filters." This will define how your data will be summarised and organised in the pivot table.
Rows: Place fields in this area to group and categorise data along the vertical axis of the pivot table.
Columns: Place fields in this area to group and categorise data along the horizontal axis of the pivot table.
Values: Place numeric or summarised fields in this area to calculate and display aggregated values (e.g., sum, average, count) based on the data.
Filters: Place fields in this area to apply filters to the entire pivot table.
Customise the pivot table: Excel provides numerous options to customise and format your pivot table. You can apply different summary calculations, change number formats, sort and filter data, apply styles and themes, and more.
Refresh and update: If your data changes, you can refresh the pivot table to update the calculations and presentation. Right-click anywhere in the pivot table and choose "Refresh" or use the "Refresh" button in the "PivotTable Analyse" or "PivotTable Design" tab.
Pivot tables allow you to explore and analyse data from different angles, enabling you to gain insights, identify trends, and summarise information in a concise and interactive format. It is a valuable tool for data analysis and reporting in Excel.









