Advance Excel Full Notes
Advance Excel Full Notes
LOOKUP Functions
This article describes the formula syntax and usage of the LOOKUP function in Microsoft Excel.
Description
The LOOKUP function returns a value either from a one-row or one-column range or from an
array. The LOOKUP function has two syntax forms: the vector form and the array form.
Syntax
VLOOKUP Functions
This article describes the formula syntax and usage of the VLOOKUP function in Microsoft Excel.
Description
You can use the VLOOKUP function to search the first column of a range of cells, and then return
a value from any cell on the same row of the range. For example, suppose that you have a list of
employees contained in the range A2:C10. The employees' ID numbers are stored in the first
column of the range, as shown in the following illustration.
If you know the employee's ID number, you can use the VLOOKUP function to return either the
department or the name of that employee. To obtain the name of employee number 38, you can
use the formula =VLOOKUP(38, A2:C10, 3, FALSE). This formula searches for the value 38 in the
first column of the range A2:C10, and then returns the value that is contained in the third column of
the range and on the same row as the lookup value ("Axel Delgado").
The V in VLOOKUP stands for vertical. Use VLOOKUP instead of HLOOKUP when your
comparison values are located in a column to the left of the data that you want to find.
Syntax
lookup_value Required. The value to search in the first column of the table or range. The
lookup_value argument can be a value or a reference. If the value you supply for the
lookup_value argument is smaller than the smallest value in the first column of the
table_array argument, VLOOKUP returns the #N/A error value.
table_array Required. The range of cells that contains the data. You can use a reference
to a range (for example, A2:D8), or a range name. The values in the first column of
table_array are the values searched by lookup_value. These values can be text, numbers,
or logical values. Uppercase and lowercase text is equivalent.
range_lookup Optional. A logical value that specifies whether you want VLOOKUP to
find an exact match or an approximate match:
If range_lookup is FALSE, the values in the first column of table_array do not need
to be sorted.
If the range_lookup argument is FALSE, VLOOKUP will find only an exact match. If
there are two or more values in the first column of table_array that match the
lookup_value, the first value found is used. If an exact match is not found, the error
value #N/A is returned.
HLOOKUP Function
This article describes the formula syntax and usage of the HLOOKUP function in Microsoft Excel.
Description
Searches for a value in the top row of a table or an array of values, and then returns a value in the
same column from a row you specify in the table or array. Use HLOOKUP when your comparison
values are located in a row across the top of a table of data, and you want to look down a specified
number of rows. Use VLOOKUP when your comparison values are located in a column to the left
of the data you want to find.
Lookup_value Required. The value to be found in the first row of the table. Lookup_value
can be a value, a reference, or a text string.
Table_array Required. A table of information in which data is looked up. Use a reference
to a range or a range name.
The values in the first row of table_array can be text, numbers, or logical values.
If range_lookup is TRUE, the values in the first row of table_array must be placed in
ascending order: ...-2, -1, 0, 1, 2,... , A-Z, FALSE, TRUE; otherwise, HLOOKUP may
not give the correct value. If range_lookup is FALSE, table_array does not need to be
sorted.
Uppercase and lowercase text are equivalent.
Sort the values in ascending order, left to right. For more information, see Sort data in
a range or table.
Row_index_num Required. The row number in table_array from which the matching
value will be returned. A row_index_num of 1 returns the first row value in table_array, a
row_index_num of 2 returns the second row value in table_array, and so on. If
row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if
row_index_num is greater than the number of rows on table_array, HLOOKUP returns the
#REF! error value.
Range_lookup Optional. A logical value that specifies whether you want HLOOKUP to
find an exact match or an approximate match. If TRUE or omitted, an approximate match is
returned. In other words, if an exact match is not found, the next largest value that is less
than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not
found, the error value #N/A is returned.
By filtering information in a worksheet, you can find values quickly. You can filter on one or more
columns of data. With filtering, you can control not only what you want to see, but what you want to
exclude. You can filter based on choices you make from a list, or you can create specific filters to
focus on exactly the data that you want to see.
You can search for text and numbers when you filter by using the Search box in the filter interface.
When you filter data, entire rows are hidden if values in one or more columns don't meet the
filtering criteria. You can filter on numeric or text values, or filter by color for cells that have color
formatting applied to their background or text.
How
1. On the Data tab, in the Sort & Filter group, click Filter.
2. Click the arrow in the column header to display a list in which you can
make filter choices.
Note: Depending on the type of data in the column, Microsoft Excel displays either
Number Filters or Text Filters in the list.
Filter by selecting values or searching
Selecting values from a list and searching are the quickest ways to filter. When you click the arrow
in a column that has filtering enabled, all values in that column appear in a list.
2. Select and clear the check boxes to show values that are found in the column of data.
To select by values, in the list, clear the (Select All) check box. This removes the check
marks from all the check boxes. Then, select only the values you want to see, and click OK
to see the results.
To search on text in the column, enter text or numbers in the Search box. Optionally, you
can use wildcard characters, such as the asterisk (*) or the question mark (?). Press
ENTER to see the results.
By specifying conditions, you can create custom filters that narrow down the data in the exact way
that you want. You do this by building a filter. If you've ever queried data in a database, this will
look familiar to you.
1. Point to either Number Filters or Text Filters in the list. A menu appears that allows you to
filter on various conditions.
2. Choose a condition and then select or enter criteria. Click the And button to combine
criteria (that is, two or more criteria that must both be met), and the Or button to require
only one of multiple conditions to be met.
3. Click OK to apply the filter and get the results you expect.
This graphic shows temperature data with conditional formatting that uses a color scale to
differentiate high, medium, and low values. The following procedure uses that data.
On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Color Scales
However over the color scale icons to see a preview of the data with conditional formatting applied.
In a three-color scale, the top color represents higher values, the middle color represents medium values,
and the bottom color represents lower values. This example uses the Red-Yellow-Green color scale.
Data Validation
Use data validation in Excel to make sure that users enter certain values into a cell.
Data Validation Example
In this example, we restrict users to enter a whole number between 0 and 10.
2. On the Data tab, in the Data Tools group, click Data Validation.
Input Message
Input messages appear when the user selects the cell and tell the user what to enter.
2. Enter a title.
2. Enter a title.
4. Click OK.
Data Validation Result
1. Select cell C2.
Result:
Note: to remove data validation from a cell, select the cell, on the Data tab, in the Data Tools
group, click Data Validation, and then click Clear All. You can use Excel's Go To Special feature to
quickly select all cells with data validation.
This example teaches you how to use data validation to reject invalid dates.
1. Select the range A2:A4.
2. On the Data tab, in the Data Tools group, click Data Validation.
5. Enter the Start date and End date shown below and click OK.
Explanation: all dates between 5/20/2016 and today's date + 5 days are allowed. All dates outside
this date range are rejected.
Note: to enter an input message and error alert message, go to the Input Message and Error Alert
tab.
4. In the Formula box, enter the formula shown below and click OK.
Explanation: the WEEKDAY function returns a number from 1 (Sunday) to 7 (Saturday) representing
the day of the week of a date. If a date's weekday is not equal to 1 (Sunday) AND not equal to 7
(Saturday), the date is allowed (<> means not equal to). In other words, Mondays, Tuesdays,
Wednesdays, Thursdays and Fridays are allowed. Sundays and Saturdays are rejected. Because we
selected the range A2:A4 before we clicked on Data Validation, Excel automatically copies the
formula to the other cells.
5. To check this, select cell A3 and click Data Validation.
As you can see, this cell also contains the correct formula.
Note: to enter an input message and error alert message, go to the Input Message and Error Alert
tab.
Budget Limit
This example teaches you how to use data validation to prevent users from exceeding a budget
limit.
1. Select the range B2:B8.
Note: cell B10 contains a SUM function that calculates the sum of the range B2:B8.
2. On the Data tab, in the Data Tools group, click Data Validation.
4. In the Formula box, enter the formula shown below and click OK.
Explanation: the sum of the range B2:B8 may not exceed the budget limit of $100. Therefore, we
apply data validation to the range B2:B8 (not cell B10!) because this is where the values are
entered. Because we selected the range B2:B8 before we clicked on Data
Validation, Excel automatically copies the formula to the other cells. Notice how we created
an absolute reference ($B$2:$B$8) to fix this reference.
5. To check this, select cell B3 and click Data Validation.
As you can see, this cell also contains the correct formula.
Result. Excel shows an error alert. You cannot exceed your budget limit of $100.
Data Consolidation
Do you need to view and compare lots of data in a single spreadsheet? There is a quick and easy
way to do this – using the Data Consolidation tool. In this blog, Edmund, one of our Excel experts,
shares his top tips.
Data Consolidation allows you to gather together your data from separate worksheets into a
master worksheet. In other words, the Data Consolidation function takes data from a series of
worksheets or workbooks and summaries it into a single worksheet that you can update easily.
The trouble is, working with Data Consolidation can be tricky! Don‟t be put off. Data Consolidation
is an incredibly useful tool that help you understand and present your data quickly and easily. The
screen may look daunting but like all great things, good planning is the key.
This example contains some tips from Edmund, one of our Excel experts, and will help you decide
how to organise your data before you start summarising it to get easily understandable results.
1. Consolidating data from multiple worksheets to one summary within the same workbook.
2. Consolidating data from multiple workbooks to one summary in a new workbook.
NOTE: The following processes will work in Excel versions: 2007, 2010, 2013 and 2016. If you are
using an older version (Excel 2003 or older), this tip may not work for you.
Year 2 worksheet
Year 3 worksheet
As you can see, Years 1, 2 and 3 each have different arrangements of columns and rows. There is
no tea in Year 2; in Year 3 the first quarter appears at the end of the table, there is no Quarter 2
and the Quarters are not in order. The ranges you consolidate do not have to be of the same size
in each worksheet, the number of rows or columns might be different from sheet to sheet. And yet,
you can still consolidate the data into a summary sheet. How incredible is that!
Select the upper-left cell of the area where you want the consolidated data to appear.
On the Ribbon, Choose Data > Consolidate to view the Consolidate dialog:
In the Function box, click the summary function that you want Excel to use to consolidate the data.
As you will see from the drop-down, there are 11 functions to choose from. For our data we want to
add up the values so we‟ll set the Function to Sum.
Click in the Reference area and select the first data range to consolidate – to do this you will need
to click the Sheet tab i.e. “Year 1” and then drag over the data (including row and column
headings) and then click the Add button to add this first set of data to the consolidation dialog.
Continue in the same way by clicking on the next sheet, highlighting the data, and clicking on
the Add button until all your data and worksheets appear in the References section of the dialog
e.g. “Year 2” and “Year 3”.
Top Tip: You can name your ranges before you start the Consolidation process. If you name each
range then, when you create the consolidation, place your cursor in the Reference field, press F3
and then choose the range from the list in the Paste Name dialog.
To indicate where the labels are located in the source ranges, select the check boxes under Use
labels in: either the Top row, the Left column, or both. In this example, Top row is the name of the
quarters, i.e. Quarter 1, Quarter 2, etc. and the Left Column are the list of items, i.e. Coffee, Tea
and Milk.
Automatic vs. Manual updates: If you want Excel to update your consolidation table automatically
when the source data changes, select the Create links to source data check box. If unchecked,
you can still update the consolidation manually.
When you click OK, Excel summarises all the data into your new sheet as your master worksheet
(Consolidated Summary).
You‟ll immediately notice a change to the Excel worksheet that you may never have seen before.
You will see grouping tools down the left of the screen which you can use to display and hide the
data. Next to rows 7, 10 and 14, there are plus signs. This signifies that cells are part of a group
that is currently collapsed. Clicking on the plus sign will expand the group and there is a line
connecting these rows to the left:
When you look at your Consolidated Summary, you will see that there are some entries which are
not helpful. For instance, range C4:C6 shows only the name of the workbook, so we cannot
immediately see where the figures in the range D4:G6 come from.
If you wish to show the location of the source data on the summary sheet, I strongly advise you to
separate all worksheets to individual workbooks before you apply the data consolidation. Let‟s look
at how to do this.
We‟re going to copy the selected worksheet into a new workbook, so select (new book) from the
To book drop-down list. Select the Create a copy check box. Because we‟re creating a new
workbook, there are no worksheets in the Before sheet list before which we can insert the copied
worksheet. It will be the only worksheet in the new workbook.
Click OK. A new workbook is created and the worksheet is copied into it. If you chose to move the
worksheet, it will no longer be in the original workbook. Save the current workbook by the name of
the worksheet that you copied to i.e. “Year 1.xls”.
Continue creating new workbooks for each year e.g. “Year 2” and “Year 3” to “Year 2.xls” and
“Year 3.xls” respectively. Yes, this is tedious, especially if you have a lot of worksheets, but you‟ll
thank me in the end!
Open a new, blank workbook as your master worksheet or add a new one if necessary. The
worksheet is renamed as “Consolidate Summary” and save this workbook with a name e.g.
Summary.xls.
Select the upper-left cell of the area where you want the consolidated data to appear.
On the Ribbon, Choose Data > Consolidate to view the Consolidate dialog
We now simply proceed as we did in the first example, the only difference being we are selecting
data ranges from different workbooks instead of different worksheets.
When you click OK, Excel summarises all the data into your new master worksheet (Consolidated
Summary).
Here you will see the same data as in the first example, except displayed in a much more helpful
way – Column C now shows the name of the workbook that contains the data.
Excel is mostly about the numerical data, but at times you can come across the data which has too
much text and that is the time when Text Functions in Excel will help you to simplify the things
easily.
1.Left()
You can use the Left function when you want to extract the leftmost characters from a string.
Syntax =left(text, num_char)
Similarly, you can also use the Right function to extract the rightmost characters from a string.
2. Len ()
Len function in Excel helps you to know the length of a string that is number of characters in a
string. Syntax = LEN(text)
3. Mid ()
Mid function in Excel is used to extract the characters from the middle of a string. Syntax =
MID(text, start_char, num_chars)
4. Find ()
Find function in Excel is used when you want to know the position of certain characters in a
particular string. Syntax =FIND(find_text, within_text,[start_num])
Proper function in Excel capitalizes each word in the string that is, it converts the case into proper
case. Syntax =PROPER(Text)
6. Rept ()
Rept function in Excel is used when you want a certain text to be repeated certain number of
times. Syntax =REPT(Text, number_times)
7. Trim()
Trim function in Excel removes the unnecessary spaces from a particular string.
Syntax =TRIM(Text )
8. Upper()
Upper function in Excel converts the text into Upper case from lower case. Syntax =UPPER(Text )
9. Substitute ()
Substitute function in Excel helps to replace existing text with a new text in a particular string.
Syntax =SUBSTITUTE(text, old_text, new_text, instance number)
10. Concatenate ()
Concatenate function in Excel helps to join the text of two or more cells.
Syntax =CONCATENATE(text1, text2….)
If you have any doubts or suggestions for us, then do let us know in the comments section below
and we shall get back to you at the earliest.
To enter a date in Excel, use the "/" or "-" characters. To enter a time, use the ":" (colon). You can
also enter a date and a time in one cell.
Note: Dates are in US Format. Months first, Days second. This type of format depends on your
windows regional settings. Learn more about Date and Time formats.
Note: use the MONTH and DAY function to get the month and day of a date.
Date Function
1. To add a number of days to a date, use the following simple formula.
2. To add a number of years, months and/or days, use the DATE function.
Note: the DATE function accepts three arguments: year, month and day. Excel knows that 6 + 2 =
8 = August has 31 days and rolls over to the next month (23 August + 9 days = 1 September).
Note: use the MINUTE and SECOND function to return the minute and second.
Time Function
To add a number of hours, minutes and/or seconds, use the TIME function.
To get the number of days, weeks or years between two dates in Excel, use the DATEDIF function.
The DATEDIF function has three arguments.
1. Fill in "d" for the third argument to get the number of days between two dates.
2. Fill in "m" for the third argument to get the number of months between two dates.
3. Fill in "y" for the third argument to get the number of years between two dates.
4. Fill in "yd" for the third argument to ignore years and get the number of days between two dates.
5. Fill in "md" for the third argument to ignore months and get the number of days between two
dates.
6. Fill in "ym" for the third argument to ignore years and get the number of months between two
dates.
Important note: the DATEDIF function returns the number of complete days, months or years. This
may give unexpected results when the day/month number of the second date is lower than the
day/month number of the first date. See the example below.
Today's Date
To enter today's date in Excel, use the TODAY function. To enter the current date and time, use
the NOW function. To enter the current date and time as a static value, use keyboard shortcuts.
Today and Now
1. To enter today's date in Excel, use the TODAY function.
Note: the TODAY function takes no arguments. This date will update automatically when you open
the workbook on another date.
2. To enter the current date and time, use the NOW function.
Note: the NOW function takes no arguments. This time will update automatically whenever the
sheet is recalculated. This happens when you make a change to any cell or when you open the
workbook. Press F9 to manually recalculate the workbook.
3. To enter the current time only, use NOW()-TODAY() and apply a time format.
Note: dates are stored as numbers in Excel and count the number of days since January 0, 1900.
Times are handled internally as numbers between 0 and 1. Visit our page about date and time
formats for more information.
Static Date and Time
1. To enter the current date as a static value, press CTRL + ; (semicolon).
Note: this date will not change when you open the workbook on another date.
2. To enter the current time as a static value, press CTRL + SHIFT + ; (semicolon).
Note: this time will not change when you make a change to a cell or when you open the workbook.
3. To enter the current date and time as a static value, simply press CTRL + ; (semicolon), enter a
space and press CTRL + SHIFT + ; (semicolon).
Calculate Age
To calculate the age of a person in Excel, use the DATEDIF function and the TODAY function. The
DATEDIF function has three arguments.
Note: fill in "y" for the third argument to get the number of complete years between the date of birth
and today's date.
Note: the DATE function accepts three arguments: year, month and day.
Note: fill in "ym" for the third argument to ignore years and get the number of months between two
dates. Fill in "md" for the third argument to ignore months and get the number of days between two
dates. Use the & operator to join strings.
Time Difference
Calculating the difference between two times in Excel can be tricky. Times are handled internally
as numbers between 0 and 1.
Simple Formula
Let's start with a simple formula that calculates the difference between two times in the same day.
Note: AM is used for times in the night and morning. PM is used for times in the afternoon and
evening. Change the Time format to display a time with or without AM/PM.
2. Change the number format of the values in cell A2, B2 and C2 to General.
Note: times are handled internally as numbers between 0 and 1. For example, 6:00 AM is
represented as 0.25 (quarter through the day).
Time Difference Formula
The simple formula shown above doesn't work if the start time is before midnight and the end time
is after midnight.
2. To clearly see this, change the number format of the values in cell A2, B2 and C2 to General.
Explanation: if the end time is greater than or equal to the start time, simply subtract the start time
from the end time. If not, add 1 (full day) to the end time to represent a time on the next day and
subtract the start time.
Weekdays
Learn how to get the day of the week of a date in Excel and how to get the number of weekdays or
workdays days between two dates.
Weekday function
1. The WEEKDAY function in Excel returns a number from 1 (Sunday) to 7 (Saturday) representing
the day of the week of a date. Apparently, 12/18/2017 falls on a Monday.
2. You can also use the TEXT function to display the day of the week.
3. Or create a custom date format (dddd) to display the day of the week.
1. The NETWORKDAYS function returns the number of weekdays (weekends excluded) between
two dates.
2. If you supply a list of holidays, the NETWORKDAYS function returns the number of workdays
(weekends and holidays excluded) between two dates.
3. Dates are stored as numbers in Excel and count the number of days since January 0, 1900.
Instead of supplying a list, supply an array constant of the numbers that represent these dates. To
achieve this, select E1:E2 in the formula and press F9.
The WORKDAY function is (almost) the opposite of the NETWORKDAYS function. It returns the
date before or after a specified number of weekdays (weekends excluded).
Note: the WORKDAY function returns the serial number of the date. Apply a Date format to display
the date.
The calendar below helps you understand the WORKDAY function.
Again, if you supply a list of holidays, the WORKDAY function returns the date before or after a
specified number of workdays (weekends and holidays excluded).
Financial Functions
To illustrate Excel's most popular financial functions, we consider a loan with monthly payments,
an annual interest rate of 6%, a 20-year duration, a present value of $150,000 (amount borrowed)
and a future value of 0 (that's what you hope to achieve when you pay off a loan).
We make monthly payments, so we use 6%/12 = 0.5% for Rate and 20*12 = 240 for Nper (total
number of periods). If we make annual payments on the same loan, we use 6% for Rate and 20 for
Nper.
PMT
Select cell A2 and insert the PMT function.
Note: the last two arguments are optional. For loans, Fv can be omitted (the future value of a loan
equals 0, however, it's included here for clarification). If Type is omitted, it is assumed that
payments are due at the end of the period.
Tip: when working with financial functions in Excel, always ask yourself the question, am I making
a payment (negative) or am I receiving money (positive)? We pay off a loan of $150,000 (positive,
we received that amount) and we make monthly payments of $1,074.65 (negative, we pay). Visit
our page about the PMT function for many more examples.
RATE
If Rate is the only unknown variable, we can use the RATE function to calculate the interest rate.
NPER
Or the NPER function. If we make monthly payments of $1,074.65 on a 20-year loan, with an
annual interest rate of 6%, it takes 240 months to pay off this loan.
We already knew this, but we can change the monthly payment now to see how this affects the
total number of periods.
Conclusion: if we make monthly payments of $2,074.65, it takes less than 90 months to pay off this
loan.
Or the PV (Present Value) function. If we make monthly payments of $1,074.65 on a 20-year loan,
with an annual interest rate of 6%, how much can we borrow? You already know the answer.
FV
And we finish this chapter with the FV (Future Value) function. If we make monthly payments of
$1,074.65 on a 20-year loan, with an annual interest rate of 6%, do we pay off this loan? Yes.
But, if we make monthly payments of only $1,000.00, we still have debt after 20 years.
The PMT function in Excel calculates the payment for a loan based on constant payments and a
constant interest rate. This page contains many easy to follow PMT examples.
PMT examples
Consider a loan with an annual interest rate of 6%, a 20-year duration, a present value of $150,000
(amount borrowed) and a future value of 0 (that's what you hope to achieve when you pay off a
loan).
Note: if the fifth argument is omitted, it is assumed that payments are due at the end of the period.
We pay off a loan of $150,000 (positive, we received that amount) and we make annual payments
of $13,077.68 (negative, we pay).
Note: we make quarterly payments, so we use 6%/4 = 1.5% for Rate and 20*4 = 80 for Nper (total
number of periods).
Consider an investment with an annual interest rate of 8% and a present value of 0. How much
money should you deposit at the end of each year to have $1,448.66 in the account in 10 years?
4. The PMT function below calculates the annual deposit.
Explanation: in 10 years time, you pay 10 * $100 (negative) = $1000, and you'll receive $1,448.66
(positive) after 10 years. The higher the interest, the faster your money grows.
Consider an annuity with an annual interest rate of 6% and a present value of $83,748.46
(purchase value). How much money can you withdraw at the end of each month for the next 20
years?
5. The PMT function below calculates the monthly withdrawal.
Explanation: you need a one-time payment of $83,748.46 (negative) to pay this annuity. You'll
receive 240 * $600 (positive) = $144,000 in the future. This is another example that money grows
over time.
Consider a loan with an annual interest rate of 5%, a 2-year duration and a present value (amount
borrowed) of $20,000.
Note: we make monthly payments, so we use 5%/12 for Rate and 2*12 for Nper (total number of
periods).
2. The PPMT function in Excel calculates the principal part of the payment. The second argument
specifies the payment number.
Explanation: the PPMT function above calculates the principal part of the 5th payment.
3. The IPMT function in Excel calculates the interest part of the payment. The second argument
specifies the payment number.
Explanation: the IPMT function above calculates the interest part of the 5th payment.
4. It takes 24 months to pay off this loan. Create a loan amortization schedule (see picture below)
to clearly see how the principal part increases and the interest part decreases with each payment.
Note: the principal part and the interest part always add up to the payment amount.
Learn how to use Excel's logical functions, such as IF, AND, OR and NOT.
If
The IF function checks whether a condition is met, and returns one value if true and another value
if false.
Explanation: if the score is greater than or equal to 60, the IF function returns Pass, else it returns
Fail. Visit our page about the IF function for many more examples.
And
The AND Function returns TRUE if all conditions are true and returns FALSE if any of the
conditions are false.
Explanation: the AND function returns TRUE if the first score is greater than or equal to 60 and the
second score is greater than or equal to 90, else it returns FALSE.
Or
The OR function returns TRUE if any of the conditions are TRUE and returns FALSE if all
conditions are false.
Explanation: the OR function returns TRUE if at least one score is greater than or equal to 60, else
it returns FALSE. Visit our page about the OR function for many more examples.
Not
The NOT function changes TRUE to FALSE, and FALSE to TRUE.
Explanation: in this example, the NOT function reverses the result of the OR function (see previous
example).
This article describes the formula syntax and usage of the PRODUCT function in Microsoft Excel.
Description
The PRODUCT function multiplies all the numbers given as arguments and returns the product.
For example, if cells A1 and A2 contain numbers, you can use the formula =PRODUCT(A1, A2) to
multiply those two numbers together. You can also perform the same operation by using the
multiply (*) mathematical operator; for example, =A1 * A2.
The PRODUCT function is useful when you need to multiply many cells together. For example, the
formula =PRODUCT(A1:A3, C1:C3) is equivalent to =A1 * A2 * A3 * C1 * C2 * C3.
Syntax
number1 Required. The first number or range that you want to multiply.
number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a
maximum of 255 arguments.
NOTE If an argument is an array or reference, only numbers in the array or reference are
multiplied. Empty cells, logical values, and text in the array or reference are ignored.
Example
2. Press CTRL+C.
5. To switch between viewing the results and viewing the formulas that return the results,
press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group,
click the Show Formulas button.
A B C
1 Data
2 5
3 15
4 30
SUMPRODUCT function
Description
Multiplies corresponding components in the given arrays, and returns the sum of those products.
Syntax
Array1 Required. The first array argument whose components you want to multiply and
then add.
Array2, array3,... Optional. Array arguments 2 to 255 whose components you want to
multiply and then add.
Remarks
The array arguments must have the same dimensions. If they do not, SUMPRODUCT
returns the #VALUE! error value.
SUMPRODUCT treats array entries that are not numeric as if they were zeros.
Example
2. Press CTRL+C.
5. To switch between viewing the results and viewing the formulas that return the results,
press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group,
click the Show Formulas button.
A B C D
2 3 4 2 7
3 8 6 6 7
4 1 9 5 3
NOTE The preceding example returns the same result as the formula SUM(A2:B4*C2:D4)
entered as an array. Using arrays provides a more general solution for doing operations similar to
SUMPRODUCT. For example, you can calculate the sum of the squares of the elements in A2:B4
by using the formula =SUM(A2:B4^2) and pressing CTRL+SHIFT+ENTER.
Statistical Functions
This chapter gives an overview of some very useful statistical functions in Excel.
Average
To calculate the average of a group of numbers, use the AVERAGE function.
Note: visit our page about the AVERAGE function for many more examples.
Averageif
To average cells based on one criteria, use the AVERAGEIF function. For example, to calculate
the average excluding zeros.
Note: visit our page about the AVERAGEIF function for many more examples.
Median
To find the median (or middle number), use the MEDIAN function.
Check:
Mode
To find the most frequently occurring number, use the MODE function.
Standard Deviation
To calculate the standard deviation, use the STEDV function.
Note: standard deviation is a number that tells you how far numbers are from their mean. Learn
more about this topic on our page about standard deviation.
Min
To find the minimum value, use the MIN function.
Max
To find the maximum value, use the MAX function.
Large
To find the third largest number, use the following LARGE function.
Check:
Small
To find the second smallest number, use the following SMALL function.
Tip: Excel can generate most of these results with the click of a button. Our Descriptive
Statistics example shows you how.
Pivot Tables
Pivot tables are one of Excel's most powerful features. A pivot table allows you to extract the
significance from a large, detailed data set.
Our data set consists of 213 records and 6 fields. Order ID, Product, Category, Amount, Date and
Country.
3. Click OK.
Drag fields
The PivotTable Fields pane appears. To get the total amount exported of each product, drag the
following fields to the different areas.
Below you can find the pivot table. Bananas are our main export product. That's how easy pivot
tables can be!
Sort
To get Banana at the top of the list, sort the pivot table.
Result.
Filter
Because we added the Country field to the Filters area, we can filter this pivot table by Country.
For example, which products do we export the most to France?
Note: you can use the standard filter (triangle next to Row Labels) to only show the amounts of
specific products.
By default, Excel summarizes your data by either summing or counting the items. To change the
type of calculation that you want to use, execute the following steps.
3. Choose the type of calculation you want to use. For example, click Count.
4. Click OK.
If you drag a field to the Rows area and Columns area, you can create a two-dimensional pivot
table. First, insert a pivot table. Next, to get the total amount exported to each country, of
each product, drag the following fields to the different areas.
1. Country field to the Rows area.
Pivot Chart
A pivot chart is the visual representation of a pivot table in Excel. Pivot charts and pivot tables are
connected with each other.
Below you can find a two-dimensional pivot table. Go back to Pivot Tables to learn how to create
this pivot table.
3. Click OK.
Below you can find the pivot chart. This pivot chart will amaze and impress your boss.
Note: any changes you make to the pivot chart are immediately reflected in the pivot table and vice
versa.
1. Use the standard filters (triangles next to Product and Country). For example, use the Country
filter to only show the total amount of each product exported to the United States.
3. Because we added the Category field to the Filters area, we can filter this pivot chart (and pivot
table) by Category. For example, use the Category filter to only show the vegetables exported to
each country.
2. On the Design tab, in the Type group, click Change Chart Type.
3. Choose Pie.
4. Click OK.
Result:
Note: pie charts always use one data series (in this case, Beans). To get a pivot chart of a country,
swap the data over the axis. First, select the chart. Next, on the Design tab, in the Data group, click
Switch Row/Column.
In Microsoft Excel, you can pivot data in a PivotTable or PivotChart report by changing the field
layout of the data. By using the PivotTable Field List, you can add, rearrange, or remove fields to
show data in a PivotTable or PivotChart exactly the way that you want.
By default, changes you make in the PivotTable Field List are automatically updated in the report
layout. To improve performance when you are accessing a large amount of external data, you can
temporarily switch to manual updating.
A field section at the top for adding fields to and removing fields from the PivotTable
You can dock the PivotTable Field List to either side of the Excel window and horizontally resize it.
You can also undock the PivotTable Field List, in which case, you can resize it both vertically and
horizontally.
If you don't see the PivotTable Field List, make sure that you click anywhere in the PivotTable.
If you close the PivotTable Field List, you can display it again. Right-click the PivotTable, and then
click Show Field List. You can also click Field List on the Ribbon (PivotTable Tools, Options tab,
Show group for a PivotTable; PivotChart Tools, Analyze tab, Show/Hide group for a PivotChart).
1. An external data source contains structured data organized as one or more fields (also
called columns) that are displayed in the Field List.
2. Move a field to the Report Filter area in the Field List, which simultaneously moves the field
to the Report Filter area in the PivotTable report.
3. Move a field to the Column Label area in the Field List, which simultaneously moves the
field to the Column Label area in the PivotTable report.
4. Move a field to the Row Label area in the Field List, which simultaneously moves the field to
the Row Label area in the PivotTable report.
5. Move a field to the Values area in the Field List, which simultaneously moves the field to the
Values area in the PivotTable report.
To create a field layout, use the following guidelines for moving Value, Name, and Dimension fields
from the field section to the four report areas in the layout section.
Value fields If you select a check box only for a numeric field, by default, it is moved to the Values
area.
Measures In an Online Analytical Processing (OLAP) (OLAP: A database technology that has
been optimized for querying and reporting, instead of processing transactions. OLAP data is
organized hierarchically and stored in cubes instead of tables.) data source, there are often many
fields (or measures) organized in a hierarchy of different dimensions, hierarchies, and levels. Click
the expand and collapse buttons until you find the fields that you want.
You can move only hierarchies, attributes, and named sets to the Row Labels, Column Labels, and
Report Filters areas.
You can move only measures, calculated measures, and Key Performance Indicators (KPIs) to the
Values area.
To change the view, click the Field List views button at the top of the PivotTable Field List.
Fields Section and Areas Section Stacked This is the default view, and it is designed for
a small number of fields.
Fields Section and Areas Section Side-By-Side This view is designed for adding and
removing fields when you have more than
four fields in each area.
Fields Section Only This view is designed for just adding and
removing many fields.
Tip In the Fields Section and Areas Section Stacked and Fields Section and Areas Section Side-
By-Side views, you can adjust the width and height of each section by resting the pointer on the
section divider until the pointer changes to a vertical double arrow or horizontal double arrow
, by dragging the double arrow up or down or left or right to where you want it, and then either
clicking the double arrow or pressing ENTER.
If the PivotTable report is connected to an external data source that contains a lot of data, you can
filter one or more fields before you add fields to the report, which can help reduce the time it takes
to update the report.
To place a field in a designated area of the layout section, in the Choose fields to add to report
box, select the check box of the field that you want. You can then rearrange fields later if you want.
Note By default, nonnumeric fields are added to the Row Labels area, numeric fields are added to
the Values area, and Online Analytical Processing (OLAP) (OLAP: A database technology that has
been optimized for querying and reporting, instead of processing transactions. OLAP data is
organized hierarchically and stored in cubes instead of tables.) date and time hierarchies are
added to the Column Labels area.
To place a field in a specific area of the layout section, in the Choose fields to add to report box,
right-click the field name, and then click Add to Report Filter, Add to Column Label, Add to Row
Label, or Add to Values.
To drag a field to an area in the layout section, in the Choose fields to add to report box, click and
hold a field, and then drag it from the field section to the layout section that you want.
In the PivotTable Field List, in the Choose fields to add to report box, click and hold a field, and
then drag it to the Values area in the layout section.
Repeat step 1 to create as many copies of that field that you want to display in the Value area.
In the PivotTable, change the summary function or custom calculation the way you want in each
copy of the field.
Tip In the PivotTable, you can also change the name of the copied fields as needed.
Notes
When you add two or more fields to the Values area, whether they are copies of the same field or
different fields, the Field List automatically adds a Values Column label to the Values area. You
can use this field to move the field positions up and down in the Values area. You can even move
the Values Column Label to the Column Labels area or Row Labels areas. However, you cannot
move the Values Column label to the Report Filters area.
You can add a field only once to either the Report Filter, Row Labels, or Column Labels areas,
whether the data type is numeric or non-numeric. If you try to add the same field more than
once — for example, to the Row Labels and the Column Labels areas in the layout section — the
field is automatically removed from the original area and put in the new area.
Another way to add the same field to the Values area is by using a formula (also called a
calculated column) that uses that same field in the formula.
On the Filter menu, select the filter options that you want.
PivotTable
report Description PivotChart Description
Row Labels Use to display fields as rows on the Axis Field Use to display fields as
side of the report. A row lower in (Categories) an axis in the chart.
position is nested within another row
immediately above it.
Column Use to display fields as columns at the Legend Fields Use to display fields in
Labels top of the report. A column lower in (Series) the legend of the chart.
position is nested within another
column immediately above it.
Report Use to filter the entire report based on Report Filter Use to filter the entire
Filter the selected item in the report filter. report based on the
selected item in the
report filter.
To rearrange fields in a PivotTable report, click the field name in one of the areas, and then select
one of the following commands:
Move to Report Filter Moves the field to the Report Filter area.
Move to Row Labels Moves the field to the Row Labels area.
Move to Column Labels Moves the field to the Column Labels area.
Tip You can also click and hold a field name, and then drag the field between the field and layout
sections, and between the different areas.
In the Choose fields to add to report box, clear the check box of the field you want to remove.
Note Clearing a check box removes all instances of the field from the report.
In a layout area, click the field that you want to remove, and then click Remove Field.
In a layout area, click and hold the field that you want to remove, and then drag it outside the
PivotTable Field List.
To enable manual updating of the PivotTable report, at the bottom of the PivotTable Field List,
select the Defer layout update check box.
Caution After you set the report layout to manual updating, closing the PivotTable Field List,
changing to Fields only view, or exiting Excel discards all layout changes that you have made to
the PivotTable report without confirmation.
In the PivotTable Field List, make the field layout changes, and then click Update to manually
update the layout in the PivotTable report.
To return to automatic updating after you finish changing the report layout in the Field List, clear
the Defer layout update check box.
Budget Reports: In any business, creating budget report is necessary to manage allotted
finances and to minimise expenses. Some common budget reports that can be generated
include production budget, expense budget, income budget, cash budget, etc.
Cashflow Statement Report: With this MIS report, business operations department can
analyse the inflow and outflow of cash, to check the overall transactions at a certain period.It
also helps in tracing fund sources that have been utilised for the outflows.
Funds Statement Report: Funds Statement Report is processed by the accounting and
finance team to keep a track of the fund sources. It is also created to check where the funds
have been utilised.
Profit Report: Profit reports are created by the accounts department to check the difference
between actual and estimated profit (or loss) at a certain time span. It also accounts the
factors which led to the profit or loss.
Income Statement Report: Reports for income, taxes, ledgers and balance sheet are crucial
for assessing the financial data of shareholders and investors. With the help of income
statement report, accountants can analyse the concurrent financial state of a business.
Costing Reports Cost reports are one of the most important aspects of MIS. Whether it is a
small business or an enterprise, overall costs incurred by different departments is analysed to
see if it can be reduced.
Inventory Reports: MIS provides inventory reports to which raw material is in surplus and
which ones need to be replenished. It also helps keep daily, weekly, monthly and quarterly
production and stock statements.
There are two main methods of preparing MIS reports for different tasks; in Tally and in Excel.
Both these processes require advanced MIS reporting skills. Let’s have a look at the two
methods.
Accounting: All the different kinds of reports mentioned above that are used by the accounts
department fall in this category. Reports such as Profits, and Fund Statements can be
Finance: Managed by the finance department, these reports help in managing the
investments and assets of shareholders and creditors. This category includes reports such as
financial statement and fund statement.
Inventory: With the help of inventory MIS report in Tally, tasks related to manufacturing, stock
management, and order reports can be managed. It helps in comparing goods and machinery
that are procured, sold, and bought, for the manufacturing.
Management Control: This category of MIS report in Tally helps in creating reports for
various tasks related to management control such as statistics, costing, budget and sales, to
name a few. This category of MIS reports helps in the efficient management of logistics in the
business.
Using the preset MIS templates provided in Tally, you can create specific reports for various
departments such as sales, MIS reports, HR MIS reports etc. Just fill-in the particulars that
you require in the report.
Next, with the help of formulas in Tally, you simply need to connect the back -end database
(Excel spreadsheet or any other DBMS) where your data is stored. The formulas fetch the
unsorted data from spreadsheet to Tally and you can compile your report according to the
requirements.
The
sec
ond
met
hod
is
to
cre
ate
MIS
rep
orts
in
Exc
el
for
mat
. It
is
nec
essary however, to have a good command on Excel and MIS reporting skills in order to create
MIS Excel reports based on specific requirements.
The next step is to mine or clean up the raw data, to filter the information that is required for
the particular report.
Keep a separate sheet for data repository from where you can pick up information and include
in the main report. This works as a back-end database and helps minimise the scope of errors
and make the whole process systematic.
Next, with the help of Excel formulas, you can connect the back-end database to the MIS
template on the spreadsheet. Excel will pull the data from the database to convert it into a
well-structured report.
Create a Macro
With Excel VBA you can automate tasks in Excel by writing so called macros. In this chapter, learn
how to create a simple macro which will be executed after clicking on a command button. First,
turn on the Developer tab.
Developer Tab
To turn on the Developter tab, execute the following steps.
1. Right click anywhere on the ribbon, and then click Customize the Ribbon.
2. Under Customize the Ribbon, on the right side of the dialog box, select Main tabs (if necessary).
4. Click OK.
5. You can find the Developer tab next to the View tab.
Command Button
To place a command button on your worksheet, execute the following steps.
Assign a Macro
To assign a macro (one or more code lines) to the command button, execute the following steps.
3. Place your cursor between Private Sub CommandButton1_Click() and End Sub.
6. Click the command button on the sheet (make sure Design Mode is deselected).
Result:
Data Tables
Instead of creating different scenarios, you can create a data table to quickly try out different
values for formulas. You can create a one variable data table or a two variable data table.
Assume you own a book store and have 100 books in storage. You sell a certain % for the highest
price of $50 and a certain % for the lower price of $20. If you sell 60% for the highest price, cell
D10 below calculates a total profit of 60 * $50 + 40 * $20 = $3800.
One Variable Data Table
1. Select cell B12 and type =D10 (refer to the total profit cell).
We are going to calculate the total profit if you sell 60% for the highest price, 70% for the highest
price, etc.
6. Click in the 'Column input cell' box (the percentages are in a column) and select cell C4.
We select cell C4 because the percentages refer to cell C4 (% sold for the highest price). Together
with the formula in cell B12, Excel now knows that it should replace cell C4 with 60% to calculate
the total profit, replace cell C4 with 70% to calculate the total profit, etc.
Note: this is a one variable data table so we leave the Row input cell blank.
7. Click OK.
Result.
Conclusion: if you sell 60% for the highest price, you obtain a total profit of $3800, if you sell 70%
for the highest price, you obtain a total profit of $4100, etc.
Note: the formula bar indicates that the cells contain an array formula. Therefore, you cannot
delete a single result. To delete the results, select the range B13:B17 and press Delete.
1. Select cell A12 and type =D10 (refer to the total profit cell).
We are going to calculate the total profit for the different combinations of 'unit profit (highest price)'
and '% sold for the highest price'.
7. Click in the 'Row input cell' box (the unit profits are in a row) and select cell D7.
www.dotnetinstitute.co.in Call us at - 011-4004 0815
Advance Excel
8. Click in the 'Column input cell' box (the percentages are in a column) and select cell C4.
We select cell D7 because the unit profits refer to cell D7. We select cell C4 because the
percentages refer to cell C4. Together with the formula in cell A12, Excel now knows that it should
replace cell D7 with $50 and cell C4 with 60% to calculate the total profit, replace cell D7 with $50
and cell C4 with 70% to calculate the total profit, etc.
9. Click OK.
Result.
Conclusion: if you sell 60% for the highest price, at a unit profit of $50, you obtain a total profit of
$3800, if you sell 80% for the highest price, at a unit profit of $60, you obtain a total profit of $5200,
etc.
Goal Seek
What if you want to know how many books you need to sell for the highest price, to obtain a total
profit of exactly $4700? You can use Excel's Goal Seek feature to find the answer.
5. Click in the 'By changing cell' box and select cell C4.
6. Click OK.
Result. You need to sell 90% of the books for the highest price to obtain a total profit of exactly
$4700.
Note: visit our page about Goal Seek for more examples and tips.
What-If Analysis
What-If Analysis in Excel allows you to try out different values (scenarios) for formulas. The
following example helps you master what-if analysis quickly and easily.
Assume you own a book store and have 100 books in storage. You sell a certain % for the highest
price of $50 and a certain % for the lower price of $20.
If you sell 60% for the highest price, cell D10 calculates a total profit of 60 * $50 + 40 * $20 =
$3800.
But what if you sell 70% for the highest price? And what if you sell 80% for the highest price? Or
90%, or even 100%? Each different percentage is a different scenario. You can use the Scenario
Manager to create these scenarios.
Note: You can simply type in a different percentage into cell C4 to see the corresponding result of
a scenario in cell D10. However, what-if analysis enables you to easily compare the results of
different scenarios. Read on.
4. Type a name (60% highest), select cell C4 (% sold for the highest price) for the Changing cells
and click on OK.
Finally, your Scenario Manager should be consistent with the picture below:
Note: to see the result of a scenario, select the scenario and click on the Show button. Excel will
change the value of cell C4 accordingly for you to see the corresponding result on the sheet.
Scenario Summary
To easily compare the results of these scenarios, execute the following steps.
2. Next, select cell D10 (total profit) for the result cell and click on OK.
Result:
Conclusion: if you sell 70% for the highest price, you obtain a total profit of $4100, if you sell 80%
for the highest price, you obtain a total profit of $4400, etc. That's how easy what-if analysis in
Excel can be.