Subido por raul flores

Productivity Boosting Aspects of Microsof Excel ( PDFDrive.com )

Anuncio
Table of Contents
Preface
Chapter 1: Introduction
Microsoft Excel at a Glance
Menus
File Menu
Home Menu
Insert Menu
Page Layout Menu
Formulas Menu
Data Menu
Review Menu
View Menu
Cell, Worksheet, & Workbook
Chapter 2: Basic Data Types, Data Consistency, and Analysis Aided Tools in Excel
Basic Data Types
Number
Text
Boolean
Formula
Data Consistency
Naming Range
First approach to name a range
The second approach to name a range
Analysis Aided Tools
Insert Sheets
Rename Sheets
Sheet Tab Color
Duplicate Worksheet
Delete Worksheet
Linking Worksheet
Hide / Unhide Rows and Columns
Merging Cells
To Insert, Format, and Delete Cells, Rows or Columns
Chapter 3: Data Formatting
Format Data as Excel Tables
Create a Table
Benefits of Excel Tables
Format for printing and Email
Remove Duplicates
Text to Columns
Flash Fill
Data Validation
To Create a Drop Down List
Subtotal
To Insert Subtotal
To Remove Subtotal
Group and Outline
How to Insert Group and Outline?
To Remove Grouping
Chapter 4: Sorting and Filtering
Top to Bottom Sorting
Left to Right Sorting
Sort by Color
Filter
To Remove Filter
Advance Filtering
Chapter 5: Charts in Excel
Column Chart
Clustered Column
Stacked Column
100% Stacked Column
Line Chart
Bar Chart
Pie Chart
Combo Chart
Chapter 6: Business Analysis Aided Tools
Conditional Formatting
Built-in Conditional Formatting
Logical Formula
Conditional Formatting with Data Validation
Two ways Conditional Formatting
Three-ways Conditional Formatting
Clear Rules
Freezing Panes
Windows Splitting
Protect Worksheet and Workbook
How to Protect Cells that Contain formulas?
Chapter 7: Logical Function in Excel
Basics of IF Function
Combining IF with AND
Combining IF with OR
Nested IF Function
COUNTIF and COUNTIFS
COUNTIF
COUNTIFS
SUMIF and SUMIFS
SUMIF
SUMIFS
AVERAGEIF and AVERAGEIFS
AVERAGEIF
AVERAGEIFS
SUMPRODUCT
IFERROR
Chapter 8: Performing Lookup in Excel
LOOKUP Function and its Application
LOOKUP - Vector Form
LOOKUP - Array Form:
VLOOKUP and its Application
VLOOKUP for Exact Match
VLOOKUP for Approximately Match
HLOOKUP and its Application
Looking for Exact MATCH using HLOOKUP
Looking for Approximately Match using HLOOKUP
Chapter 9: Power Excel Data Functions
MATCH Function
INDEX Function
INDEX MATCH Function
CHOOSE Function
Chapter 10: Arrays in Excel
An Array and array Formula
Creating and Using an Array Formula
Conditional Evaluation in an Array Formula
Chapter 11: Excel Math Functions
The OFFSET Function
RAND and RANDBETWEEN
INDIRECT Function
ROUND, ROUNDUP, and ROUNDDOWN
ROUND
ROUNDUP
ROUNDDOWN
CEILING and FLOOR
COUNT, COUNTBLANK and COUNTA
RANK, RANK.AVG, and BREAK DUPLICATE
RANK
RANK.AVG
BREAK DUPLICATE
DATE, TODAY, DAY, MONTH, YEAR and DATEVALUE
TODAY
DAY
MONTH
YEAR
DATEVALUE
WORKDAY and WORKDAY.INTL
WORKDAY
WORKDAY.INTL
NETWORKDAYS and NETWORKDAYS.INTL
NETWORKDAYS
NETWORKDAYS.INTL
Database Functions in Excel
DAVERAGE
DCOUNT
DCOUNTA
DGET
DMAX
DMIN
DSUM
DPRODUCT
DSTDEV
DSTDEVP
DVAR
DVARP
Chapter 12: Excel Text Functions
LEN and TRIM Text Functions
LEN
TRIM
Using LEFT, MID and RIGHT for String Extraction
LEFT
MID
RIGHT
Use Extracting functions with SEARCH
Joining Data with CONCATENATE or AMPERSAND “&”
CONCATENATE
Ampersand
Changing the Case of Text in Cells (UPPER, LOWER and PROPER)
UPPER
LOWER
PROPER
FIND, REPLACE, SUBSTITUTE, and REPT
FIND
REPLACE
SUBSTITUTE
REPT
Chapter 13: IS Functions
ISNUMBER, ISEVEN, ISODD
ISNUMBER
ISEVEN
ISODD
ISTEXT and ISBLANK
ISTEXT
ISBLANK
ISFORMULA, ISLOGICAL
ISFORMULA
ISLOGICAL
Error Checking with ISERR, ISERROR, ISNA
Error Checking with ISERR
Error Checking with ISERROR
Error Checking with ISNA
Chapter 14: Sparklines
Create a Sparklines in Excel
Change the Design of Sparklines
Removing Sparklines from a Sheet
Chapter 15: Scenario Manager, Goal Seek, and Solver
Scenario Manager and its Application
Setting up Scenario and Entering Values to carry out What-If-Analysis
Getting a summary of all Scenarios
Goal Seek
Using Goal Seek to carry out What –If-Analysis
SOLVER
Activating Solver Add In
Using SOLVER to Carry out What if Analysis
Add constraints into Solver problem
Chapter 16: PivotTable, Slicer, and Timeline tool In Excel
PivotTable
Organize your source data
Create a PivotTable
Arrange / Rearrange Fields in a PivotTable
Show Different Calculations in PivotTable
Summarize Values By
SHOW VALUES AS
Format PivotTable Numbers
Applying Pivot Table Styles
Disabling and Enabling Grand Totals
Applying Report Layout
Making Use of the Report Filter Option
How to Refresh a PivotTable?
Grouping
Moving a Pivot Table
Removing a Pivot Table
The Slicer Tool
The Timeline
Chapter 17: Pivot Charts in Excel
Creating a Pivot Chart
Changing Chart Types Formats and Layouts
Filtering a Pivot Chart
Hiding Pivot Chart Field Buttons
Moving a Pivot Chart between Sheets
Deleting a Pivot Chart (With Care)
Chapter 18: CORRELATION and REGRESSION ANALYSIS
Activating Analysis ToolPak Add In
CORRELATION COEFFICIENT
REGRESSION ANALYSIS
R Square
Significance F and P-Values
Coefficients
Chapter 19: Macros in Excel
What is a Macro?
Activating Developer Tab
Creating Storing and Running your First Macro
Invoke Macro with Keyboard Shortcut
Using Form Button to Invoke Macro
Chapter 20: Power Query and Power Pivot
How to Activate Power Pivot and Power Query
Power Query
Importing Data Using Power Query
Power Pivot
Importing Data to Power Pivot
Bonus: Keyboard Shortcuts in Excel
Preface
Making better-informed business decisions to increase productivity and
profitability is arguably becoming most difficult task for every manager due to
huge volume of data needed to deal with and understand.
Knowing the effective and efficient approach of turning this huge raw data into
relevant information to enhance business success in today's challenging and
competitive-environment inform the written of this book “Productivity
Boosting Aspects of Microsoft Excel” to Instil Data Intelligence using
Microsoft Excel.
The book focused more on how to improve your Microsoft Excel skills and
furnished you with opportunities to be versed with functionality of jobs,
functions and formulas that are needed to grow fast and stay competitive. Our
illustrations mirror the likely situation you might experience at work.
Microsoft Excel remains one of the most cost effective and popular
spreadsheet today. This is as result of its flexibility that allows users to easily
manipulate and effectively analyse data using its key functions and formulas
without having to necessarily understand the complexity of calculations that
informed the formulas.
Kindly download the practise files use in this book through this link:
http://85metrics.com/wpcontent/uploads/2016/12/Productivity_Workbook_Files.rar
Momodu Musa Mayomi
Lagos, Nigeria
www.85metrics.com
Chapter 1: Introduction
Microsoft Excel at a Glance
Spreadsheet application developed by Microsoft to handle calculations,
graphics and charts is called Microsoft Excel. This is very useful to carry out
various analysis on any form of data. Although there are different versions of
Microsoft Excel in public domain but I will stick with Excel 2013 version
throughout my discussion in this book since they have slightest difference.
Microsoft Excel environment and how its features are positioned are clearly
shown in figure 1.1 below. The essence of this chapter is to familiarise you
with the Excel environment by simply introduce you to various features of
Microsoft Excel such as Menu bar, ribbons, formula bar, cell, worksheet, and
workbook.
Figure 1.1
Menus
Menu such as Developer, PowerPivot, and PowerQuery in the Menu Bar as
appeared in figure 1.1 were enabled to carry out some advanced work.
Basically we do have File, Home, Insert, Page layout, Data, Review and View
appeared as default. So we are going to look into those classified to be default
Menu and their sub-menu in this chapter.
File Menu
This menu houses tools to create, save, print, export and even share documents.
It also facilitates how to invoke advance tools that are not appear by default.
Figure 1.2
Home Menu
This considered to be one of the best self-explanatory menu that played host to
the fundamental tools in Microsoft excel.
Figure 1.3
Clipboard allows you to copy, cut, and paste selected content in Excel.
Previous format can be applying with help of Format painter.
Font allows you to change font size, color, and background color. It also
makes contents bold or underline or italic.
Alignment: allows you to justify, aligned content to left, right, center,
wrap text and merge cells
Number: This facilitates how numbers will appear in the cell such as
currency, percentage, fractions, scientific or general, date, and text
format.
Styles: it makes data stands out and visual appealing.
Cells: Allows insertion of new cell, deleting of existing cell, and change
cell format.
Editing: This section considered very powerful as it played host to
Autosum, Sort& Filter, Find & Select, and Find & Replace.
Insert Menu
Insert Menu is an embodiment of most amazing tools in excel such as chart,
table, sparklines, and slicer to mention few.
Figure 1.4
Tables: Allows you to insert Table to organise and analyse related data.
It also facilitates the insertion of PivotTable to summarise complex data.
Illustration: Allows the insertion of shapes, Picture, SmartArt, and
Screenshot.
Apps: Allows you to insert an app into your document and use the web
to enhance your work.
Charts: Allows you to insert any form of chart suitable for a particularly
work.
Reports: This facilitates the insertion of PowerView. PowerView
provides easy to use ad hoc interactive reporting to make better inform
business decisions.
Sparklines: Allows the insertion of mini charts fit into one Excel cell.
Filter: Allows you to remove the field values considered not useful for a
particular task.
Links: Allows you to create a link to your document for quick access to
webpage or file or even a place within the same document.
Text: This facilitates the insertion of any form of texts and objects such
as word Art, signature, header and footer.
Symbols: Allows you to inserts mathematical equations and special
symbols that are not on keyboard.
Page Layout Menu
It houses the necessary tools that can be use enhance the appearance of the
page and very handy in preparing pages for printing.
Figure 1.5
Themes: Each theme had a unique colors, fonts and effects that gives
your document instant styles.
Page Setup: It facilitates Margin adjustment, orientation (portrait or
landscape), paper size, Print Area while preparing document to be
printed.
Scale to Fit: It allows you to shrink both height and width of your
printout to fit a certain number of pages.
Sheet Options: Allows to alter the default setting to either print the
gridlines / headings or not.
Arrange: This is very useful to rearrange overlapping objects.
Formulas Menu
This menu plays host to Microsoft Excel built-in formulas ranging from
finance, logical, to lookup and reference. It enabled auditing to be perform on
formulas in use.
Function Library: This played host to array of formulas group by
category for easier identification. The categories include Autosum,
Financial, Logical, Text, Lookup &Reference, etc.
Define names: This is very useful in create, edit and even delete name
of a cell or selected cell. It’s handy when copying formulas or doing
analyses on large data.
Formula Auditing: Allows you to uncover any error in your formula. It
traces precedent, dependent, and evaluate each part of the formula
individually.
Calculation: Allows to choose whether to calculate formulas manually
or automatically in excel worksheet.
Data Menu
Data Menu is basically enhancing data formatting, data analysis, and serve as
gateway to other sources of data.
Get external Data: This is very handy when importing data file from
other sources (such as Access, Web, Text, SQL Server) to work on in
Excel.
Connections: Allows you to view all data links/connections in
workbook to external data files and possibly refresh to effect any change
made to the external Data file.
Sort & Filter: enabled you to filtering your data and come out with the
useful part of the data. It also allows to perform sorting on data.
Data Tools: This played host some basic tools use to carryout data
analysis. This includes splitting single column to multiple (Text-toColumns), remove duplicates and Data Validation.
Outline: allows you to group, ungroup, and perform subtotal on some
large range of cells.
Analysis: Though not appear by default but was enabled to facilitate
financial and scientific data analysis using tools such as Data Analysis
add-in & Solver add-in.
Review Menu
This comes handy while carrying out commenting, enabling access restriction
and spell checking.
Proofing: facilitates spell checks and further research to establish the
meaning or nearest in meaning to words.
Language: Allows you to translate the selected text to different
language.
Comments: Allows you to add, edit, delete and view comments in excel
sheet.
Changes: Allows you to protect worksheet and workbook to avoid
unnecessary alteration. Also facilitates sharing of file and as well track
changes to the file.
View Menu
This will enable you to make changes to window appearance in excel and not
really in actual document.
Workbook Views: Allows you to set how your workbook appears.
Shows: Enable you to control some features like gridline, heading,
formula bar and ruler whether to appear or not.
Zoom: enhances the selected cell to gain better view.
Window: Allows you to freeze portion of the sheet to keep it visible
while scrolling through the entire sheet, split windows and hide
windows.
Macros: This only visible when Developer menu is enabled. It allows
you to view the list of macros you can work with or better still record
fresh one.
Cell, Worksheet, & Workbook
Cell is an intersection of a row and column.
Worksheet is a single sheet that contains cells organised by rows and
columns.
Workbook is an Excel file that contains one or more worksheets.
Chapter 2: Basic Data Types, Data
Consistency, and Analysis Aided Tools in
Excel
Basic Data Types
The classification of data to various types based on predefined characteristics
and how its value should be stored is referred to as a data type. In this case
Microsoft excel recognises four (4) different data types which include Number,
Text, Boolean, and Formula. Therefore, each cell can contain any of the above
mention data types or even referring another cell in the same sheet.
Number
Basically this is the collection(s) of only digits that usually aligns to the right
in the cell.
Text
This is the collection of alphabet(s) or alphanumeric input into cell in excel.
Sometimes it could be digit only but the entire entry (Text) is always aligned to
the left of the cell.
Boolean
This is the logical TRUE and FALSE and is always aligned to the centre of a
cell.
Formula
Any entry preceded by equal “=” sign in a cell is refers to as formula.
Data Consistency
It is essential to shed more light on what require for datasheet to stands the test
of time and what good data really entails in this section. A data is considered
to be good if it requires no further manual clean up while table that houses data
that are meant to be consistently grow overtime as well evaluate changing
variables is called DataTable, such as record of sales in a supermarket. This
table will continue to grow in as much the supermarket remains in operations
and sometime varies inputs to generate different outputs. Though there are lots
to data table but we will limit it to this.
For these tasks to be as easy as possible the following assertions must be
adhered to
Maintaining a DataTable per sheet helps in minimizing or eliminate
likely errors that may arise overtime since the table will never ceased to
grow.
Each column must have a unique heading and must not contains
formulas or duplicates in the heading.
It is necessary to start the DataTable as close to cell A2 as possible
to avails you the larger space in the worksheet as the table continue to
grow. It is advisable to leave a row up.
Discourage every act of hide rows or columns and ensure the table
remains compact without meaningless gap.
Instead make the table compact like I have below
Imbibe the act of assigning data to unique field rather than lump it
together. This is very handy while performing advance functions on the
table.
Naming Range
Excel allows us to create descriptive name that refers to a cell or group of
cells. This name can be use in formula instead of the cells range. There are
some rules that guide the creation of name which includes the follow:
Space is not allowed within the name, so the name must be one-word.
Names can begin with either letter, underscore, and backslash, while
the rest character can be the combination of letter, underscore, number,
and period
Name cannot be the same as cell reference.
Lastly, name in Excel is not case-sensitive.
Name range can be done in two ways.
First approach to name a range
Select the cell or group of cells to name
Go to Name box, which is to the left of formula bar and type in valid
new name
Press Enter
The second approach to name a range
1. Select the cell or range of cells to name
2. Go to Formula Menu and click on Define Name to invoke the New
Name dialog box.
3. Type in the new name on the Name field.
4. Validate the cells range captured in the “Refers to” field if it covers
the range.
5. Click Ok to effect the change and close.
The existing name on the list can either be edited or deleted through the Name
Manager in the Defined Names group in Formula Menu.
Analysis Aided Tools
We will be looking at some tools considered very important to aid data
analysis processes in Microsoft Excel in order to generate effective reports
that are readable and succinctly convey all you intended to communicate in a
simple way. The tools enhanced our business operation data to easily scale,
visual appealing and more dynamic. These include insert sheets, renaming
sheets, sheet tab color, duplicating sheet, deleting sheet, linking sheet, and
Hide/Unhide Rows and Columns.
Insert Sheets
Microsoft Excel allows insertion of additional worksheets into a workbook.
Excel 2013 has one worksheet by default unlike previous versions that
provided with three worksheets. To insert worksheet next to an existing one.
Select the worksheet, click on the new sheet icon. See the screenshot below
Rename Sheets
Worksheets can be renamed from it default name (sheet1, sheet2 ...) that
appears on its sheet tab at the bottom of the screen to descriptive name that
distinguish your work. To do that:
1.
Right click on the sheet tab you want to rename and select the rename
from pop up option.
2.
The sheet name will be highlight for you to overwrite it to desire name
3.
Type in the new name and click outside the new name to effect the
change.
Sheet Tab Color
Sheet tab can be color or recolor to enhance uniqueness of your work, better
identification, and visual appealing. Right click on the selected sheet tab
intends to color, select tab color from pop up options, that takes you to theme
color dialog box where you can choose the color of your choice, click on the
color you want. The tab color automatically changed.
Duplicate Worksheet
Worksheet can be duplicate in an excel file. This is very common when you
intend to mirror the entire sheet in other to carry out further operation on its
copy without affect the primary sheet. To duplicate a worksheet.
Select the worksheet,
1.
Right click on the sheet tab and choose Move or Copy from the popup
options. Copy or move dialog box will appear
2.
Choose the new book if you want it on a fresh workbook or select the
current workbook and specify the location to place it.
3.
4.
Tick create a copy
Click ok.
Delete Worksheet
Worksheet can be removed when considered not needed or no longer in use. To
remove the worksheet in question, right-click on the sheet tab selected at the
bottom of the screen, choose DELETE from pop up options and click ok. The
sheet will be automatically removed.
Linking Worksheet
Linking sheet in Microsoft Excel is very essential when we work on multiple
worksheets in the same workbook or different workbooks. It keeps worksheets
at a manageable size, enhanced effective reports and add values to projects in
Excel. Linking spreadsheet operation is very handy when carried out
calculations on sheets with lots of information, particularly linking source data
from one sheets to the one that houses dashboard report.
To link worksheet within a workbook is very simple courtesy of "equal to" (=)
that does the magic. All you need to do is to type "=" in the reference (on the
second worksheet) to cell that hold the actual value on the first worksheet and
click on the cell in first worksheet and Kindly notice "!" Between the sheet and
the cell reference, then press Enter key.
Let’s illustrate the above with the below example. We have two separate
worksheets name sheet1 and sheet2
We want to link sheet1 to sheet2 so that cell B2 on sheet1 will be displaying
the Amount Sold in cell B6 of sheet2. The following procedures will serve as
our guide:
Click on cell B2 on sheet1 and type “=” in cell.
Go to sheet2 and click on cell B6 on sheet2
Kindly take note of the exclamation mark “!” in between Sheet2 and B6 in
the formula bar
Press Enter key to get a result that look like the screenshot below on
sheet1
Congrats you have successfully link the two sheets together.
Hide / Unhide Rows and Columns
Sometimes one may considered to hide some information from public or user
of our report in Microsoft Excel. I don't encourage this because it sometimes
messes up a lot than the good we expect. To hide rows or column is so simple,
all you need to do is:
select the row(s) or column(s) by click on numbers at the leftmost of the
sheet or alphabet at top of the sheet you intend to hide respectively
Right click and select hide from the pop up options.
Below is screenshot on how to hide rows
Below is on how to hide columns
The same approach can be employ to unhide both rows and columns initially
hidden.
Merging Cells
This is the process of combine the contents in selected cells to one large cell.
The following are the steps to merge cells:
Highlight the select range of cell you want to merge.
Go to Home Menu
Click on small drop down arrow next to
Merge & Center to choose where to align the text in the merged cells.
To Insert, Format, and Delete Cells, Rows or Columns
There may be need to insert fresh row or new column within the existing ones
in a worksheet, performing formatting such as adjusting height or width of cells
or even get rids of cells, rows and column in a sheet. In order to perform this
insertion,
Select any cell within the sheet to specify the position you wish to insert
cells, rows or columns.
Go to cells group under Home Menu and click on INSERT icon to
choose either sheet rows, sheet columns, and sheet from the drop-down
list to insert fresh rows, columns, and sheet respectively.
Select cells, rows, or columns to format and repeat the same processes.
Select cells, rows, columns, sheet to delete and repeat the same
processes.
Chapter 3: Data Formatting
Data formatting is an essential process of transforming data into proper format
(Good Data) to enhance all kind of operations in excel, simplify all stages of
data analysis, and succinctly gives clear picture of the message been
communicated. In this chapter, I will be explaining how data can be format in
tabular form, format data for printing, and how to remove unnecessary
duplicates during data cleaning, and data validation to minimise or eliminate
errors.
Format Data as Excel Tables
One of the best way to keep data in good format is to convert it to table in
order to make it more flexible and dynamically grow over the period of time.
Excel Tables are not just extremely powerful to deal with large data
considered very difficult to understand but effectively simplify how to handle
dataset and maximize accuracy. All analytical tools required to make sense out
of any form of data can only work perfectly if data are put in tabular form. The
raw data we intend to format as table in excel must satisfied criteria which
include:
Maintaining same data type in a column,
Never merged cells, Formulas must not be in the headings,
All headings must be filled that is no blank headings,
Never duplicate headings, and
Horizontal calculations must not allow.
Create a Table
Let's follow the following steps to convert the data set below to table.
1. Click on any cell in the data sets
2. Go to INSERT MENU then Table group
3. Click on Table convert the range to table (its shortcut keystroke is
CTRL+T)
4. The selected range will show on the dialogue box
5. Take note the checkbox that indicated “My Table has header”. Kindly
unchecked if your table has no header, Excel will add generic names like
Column1, Column2, Column3, and so on.
6. Click ok.
Note, the Table Tools that appeared at the top whenever you select anywhere
in the table indicates the cells range had successfully been converted to table.
7. Rename your table to make it unique. Simply overwrite the default name
that appear in Table Name field in properties group.
8. Hover your mouse over different Table styles under design ribbon to
change to your desire.
9. Tick and untick those checkboxes in Table style option to enable or
disable features likes filter button, Banded row or column, Header row,
Total row, First column, and Last column
Benefits of Excel Tables
Those unbelievable benefits of excel tables include the following:
Excel Tables can effectively handle automatic copying of Formulas,
Validations, Number formatting, and Conditional formatting apply to a
single cell in a column in order to increase accuracy and save time
specifically on newly added columns.
It extremely helpful to overcome the challenge of manual split or
freeze pane perform on tabular data to prevent first row (heading) from
disappear while scroll down.
Excel Tables promote Readable formulas for better understand and
formulas entry much easier to perform. While entering formulas to
tables, you will encounter square bracket around column names involve
in the formula.
Also @ sign together with field name in some excel table formulas
implies - taking value from the specific column for current row only but
affect the entire column when @sign is removed.
Tables effectively handle auto dependence formula and reference to
reduced effort and accuracy. Formulas refer to data or range of data but
sometimes generate results that are operationally wrong as a result of
your failure to update formulas when more data is added which make the
formula becomes outdated. This could lead to wrong decisions that will
cause either monetary or other business losses. We need tables to avoid
this. Let me demonstrate this with example below. cell G3 holding the
sum of data range E3:E6 which return 26 as the result as it appears here
Now you came back to add addition data to the range. Let’s say you want to
add 9 to it. Haven added the value 9, you noticed the result remains unchanged
and there appeared a green mark at the result cell.
Never ignore the green mark, it requires your attention that an error has
occurred. Select the green mark to see the type of error. That tells you that your
“Formula Omits Adjacent Cells” click on the second option “Update
Formula to Include Cells”. That will now automatically update your result in
cell G3 to 35.
Are you going to be repeating this task every time you add more data? What if
you forget to do that? You will get wrong result that is not mathematically
wrong but operationally wrong which could lead to bad decisions. To avoid
this repetitive task and solve the problem once, we need tables. Here we go,
convert the cells range to table and input value 9 in the adjacent cell of the
table as shown below
Immediately you exit the cell that hold value 9, table will automatically add the
new data and the result get updated. This will save you a lot time and reduced
stress.
Format for printing and Email
Having done with our report, there might be need to send it to our boss or
colleagues by either print it out or send through an email in a format that will
make it not just readable but clearly understandable. The following steps will
guide us to format data set for printing and email
1. Highlight the cells range or table you intend to print
2. Go to Page Layout Menu and set PRINT AREA to instruct excel to print
the selected cells range or part of the sheet highlighted.
3. Adjust the width and height in Scale to Fit group, also tick the checkbox
in sheet options to show gridlines or headings in the print out.
4. Do the necessary adjustments you intended to in the page setup group.
Another way to do it, is to click on the arrow underneath “Print Title
icon” to invoke Page setup dialogue box
A Page Setup dialog will appear like in the screenshot below
5. Set the orientation to either portrait or landscape as you choose
6. Adjust the “Scale to Fit” to shrink the height or width of print area to
either a page or more.
7. Set Header and Footer by click on the tab next to Margin on the dialogue
box and type your contents. Click on custom Header to add header or
Custom Footer to add contents to footer. Lastly check/uncheck the
checkboxes to indicate how you want it to appear either on different odd,
even page or not on first page as indicate in the below snapshot.
8. Set Print Area on the Sheet tab beside Header/footer tab to indicate the
cells range selected to print.
9. Set Print Title to repeat the range of cell in case your document is more
than one page and you want the same title to appear in all the pages.
10. Click Print Preview button to preview the setting before sending it to the
printer.
Note: You can Select the File Menu and click on Print option to Preview and
Print or Press CTRL+P.
11. Click on Print to print the document
12. To send the documents as email, select File and click SHARE
13. Then click on email to send it as either an attached, pdf or others.
Remove Duplicates
This function is use to eliminate unnecessary repetition of item on the list. Take
a look at the list of motorcycle brand that appears in the screenshot below and
think how to remove duplicates
Before removing the duplicates, let's first highlight the duplicate brands in the
list for better clarifications. To highlight the duplicates:
1. Highlight the cells range that contains the items
2. Go to Home Menu
3. Click on Conditional Formatting
4. Choose Highlight Cell Rules, and
5. Select Duplicate Value
Duplicates highlighted.
Highlight the cells range to remove the duplicates and follow these steps:
1. Highlight the cells range that contains the items
2. Go to Data Menu
3. Click on Remove Duplicates
4. Remove Duplicates dialogue box will appear, select the column that
contain the values if the checkbox is not tick.
5. Take note the checkbox “My data has headers” if your data has header. In
this case, my data header is Motorcycle Brand.
6. Click on Ok button to effect the change
The duplicates values will automatically be removed. Excel will notify you the
number of duplicates found and removed and number of unique values remain.
Here will have 5 duplicate values removed and left with 11 unique values.
Text to Columns
As its name implies, this feature is used to split bunch of data in a column that
either separated by space, comma or other separators to unique fields
(columns). This function is very helpful to split imported data from text editor
or web into unique columns. For instance, the list in column F below
comprises of both surname and first name. We can split it to two separate
columns to make it more readable. Don't forget we are still under data cleaning
and all our data must be in proper format.
To split data in the above cells range
1. Highlight the cells range
2. Go to Data Menu
3. Click on Text-to-column
4. Covert-to-text dialogue box will appear. Select Delimited or fixedwidth to choose the type of file that best describe your data and click on
next button to proceed.
5. Since my data are separated by space, I will tick checkbox beside space
to select it then click on Next button. Remember excel is very intelligent
to figure out the best in so many cases.
Wow Excel is so intelligent to have separated it.
6. Again I will go with Excel to figure out the destination for me as you can
see it has already picked cell F1 for me in the diagram below
7. Click on Finish button
Great! Successfully splits the data into two columns. Now you can apply
the same format on the data in G column
Flash Fill
Flash Fill is an Excel feature that was first introduced in Excel 2013 as an
alternative to simplified data cleaning process considered very difficult, time
consuming, or not possible with existing methods. The way it works is similar
to that of Text-to-Column but can handle the task of cleaning huge data in faster
and less cumbersome way than any other features.
What it does is to study the pattern of input values and automatically fill in the
rest. This amazing tool is located in Data tools group in Data Menu.
Let’s demonstrate how it works using the randomly generated data below.
What we intend to do is how we can split those text in column B to three
different columns let's say column C to E.
The first way this can be done is to type in the first part of text in column B
"Jude" to the next column C. Upon typing the letter "M" of second text "Musa"
in the next row; Excel is very intelligent to pick out the remaining text in that
category as it appeared in grey below, and then press enter button on your
keyboard.
The same process can be repeat for numbers present in the text in column B to
be split in column D.
The second way to do this is to type the very first text to extract in the intended
column then go to Data Menu and click on Flash Fill in the Data tools group. In
this case I will type “Gombe” in cell E2 and go to Data Menu, and click on
Flash Fill in Data too group
The result will appear as below
Data Validation
This feature is used to create drop down list of items in a cell to facilitate
easier data entry and eliminate or reduced all forms of typing and input errors.
In a nutshell, it controls what one can entered into worksheets. A drop down
list shown below was generated using data validation.
Data Validation which is under Data Menu is very effective to restrict cell
entry to particular range and even restricts cell entry to a particular type of
data based on validation criteria selected.
To Create a Drop Down List
1. Select the cells in which you want the drop down list
2. Go to Data on the menu bar
3. Click on the data validation.
4. Choose LIST from Allow’s drop down options which include Any
Value, Whole Number, Decimal, List, Date, Time, Text Length and
Custom.
Any Value remains indifferent validation criteria as it allows user to
input all forms of value. Whole Number restricts cell entry to only
whole number. Decimal forces users to enter either decimal or whole
numbers. List restricts user to list of items to choose from. Date forces
user to enter only valid data. Time restricts the user entry to only valid
time. Text Length allows entrance of any value in as much the
character length is still within the stipulated value. Custom allows you
to condition cell input based on your conviction that not included in the
available options.
5. Click on the source icon to choose the source to pick the items to
populate the drop down list. Click Ok to close the dialog box and effect
the changes.
6. Done! Now you can click on any of the cell earlier highlight and you
will notice a drop down arrow.
7. Click on the arrow to select an item from the drop down list to fill the
cell.
Subtotal
This can be used to generate subtotal for selected range of cells and is more
efficient when working with large amount data.
One of its cool features is the ability to handle functions like average, count,
product, Max, and Min of bunch of cell. Note that consistent value is the key to
arrive at correct result under subtotal and always ensure the data are well
sorted. Let’s see the example below
Let’s do custom sort on the entire record using two criteria (Year and Product)
in that order. Sorting is generally explained in chapter four.
Good! Now that our data are well sorted. We can proceed to perform subtotals
To Insert Subtotal
1. Highlight the enter record
2. Go to Data Menu and click on Subtotal
3. Subtotals dialog box. Set the necessary parameter which include “At
each change”, “Use function”, “Add subtotals to”, and so on
Note: use function is where to change what subtotal will compute such as
average, sum, Product, and min to mention few.
4. Click Ok button
The number label A at the top of left pane can be used to choose level. The B
label point to the Subtotal based on Years while Label see shown the grand
total of the entire sales across years.
Below diagram shown level 2
See the level 1
You can play around by clicking either of the number (1, 2, and 3) at left pane
to see the different level results.
To Remove Subtotal
1. Highlight the cells range Go to Data Menu
2. Click on subtotal and choose Remove All from the dialog box that pop
up
3. Click ok.
Group and Outline
Navigating huge data in a spreadsheet is considered to be most tasking job that
require an easier method that will make it more manageable both in size and
appearance. This challenge informed the introduction of group and outline
features to enhance the minimization of data and quickly display summary
rows and columns, or to even reveal each group’s details. To do these, one
must ensure the data are properly organised
How to Insert Group and Outline?
1. Select the columns or rows you intend to group
2. Go to Data Menu,
3. Click on group in outline group,
4. Specify rows or columns to indicate what you want to group
5. Click Ok
Take note of those outline symbols indicate with arrows. They can be clicked
on to hide and unhide rows. The good thing here is that excel allows up to 8
levels to the outline by grouping rows inside an existing group.
To Remove Grouping
1. Select the rows or columns you want to ungroup
2. Go to data menu and click on ungroup the outline group. Alternatively
click the down arrow on ungroup button and choose clear all to remove
all groups.
Chapter 4: Sorting and Filtering
Sort and Filter are some of the most amazing features aiding data analyses in
Microsoft Excel. Sort is very handy in changing the order of data as chooses
while filter helps us to focus on a specific set of extracted (filtered) data.
Sorting order on your Excel data could either be in ascending, descending, left
to right, top to bottom or even by color. Sort and Filter functions can be access
in either Home Menu, Data Menu or Right-click and Select as shown below. I
will stick with Home Menu throughout this chapter.
Let us illustrate with an example on how to fix this unsorted record.
Top to Bottom Sorting
Here we are going to sort the motorcycles brands in alphabetical order. By
taking the following steps:
1. Highlight the entire cells range that contain the data
2. Go to Data Menu and click on sort icon to invoke Sort dialog box.
3.
Choose “Motorcycle” in the SORT BY drop down box. Note the
“Add Level” will allows the addition of more than one level of sorting
in case you have more than one criteria.
4. Select “A to Z” in ORDER drop down box to sort in ascending.
5. Click on Ok button.
You will have noticed the Motorcycle Brands had been sorted
alphabetically
Left to Right Sorting
The good example to illustrate this is to sort Months on the record from
January to May (that is from old to new). To do this:
1. Select the record again but leave the motorcycle field (column) out since
we want it to remain in the current position.
2. Go to Data Menu to click on Sort to invoke the sort dialog box
3. Click on the option button in the dialog box to switch from “top to
bottom” to “left to right”.
4. Click Ok.
5. Choose “Row 3” in the SORT BY drop down box since ROW 3
contains item intends to be sorted
6. Select “Older to Newest” in ORDER drop down box.
7. Click Ok to effect the changes.
The record will automatically sorted as it appears below
Sort by Color
Let us sort the record below based on color in the following order (Blue,
Green and Red)
1. Select the record again with the motorcycle field (column) this time.
2. Go to Data Menu to click on Sort to invoke the sort dialog box
3. Choose “Motorcycle” in the SORT BY drop down box
4. Select “Cell color” in the “SORT ON” drop down box
5. Choose the color in the “order” to indicate the order you want them to
appear.
6. Click on “Add Level” to repeat the process for the rest colors.
7. Then click Ok to effect the changes.
Below is what you will get
Filter
Filter enabled us to focus on a specific set of extracted (filtered) records that
met certain criteria. It can be accessed in three different ways (Home Menu,
Data Menu and by Right click option) as earlier explained. Let us take some
examples for clear understanding.
We can use filter to extract some information from the above data set base on
the criteria we choose.
1. Click any cell in the data set
2. Go to Home Menu or Data Menu and click on filter
Take note the arrow that appears in the column heading
3. Click on the arrow next to the “Product” to filter it
4. Click on Select All to unchecked all the boxes and click the box next to
“Bajaj Boxer”
5. Click Ok. Excel will show only Bajaj Boxer sale as it appeared below
We have succeeded in filtering the entire record (Romatee Motorcycle’s Sales)
using Bajaj boxer as criteria.
We are going to take a step further to see all Musa’s sales on Bajaj Boxer
6. Click on the filter arrow beside “Sale Rep”
7. Click on Select All to unchecked all the boxes and click the box next to
“Musa”
8. Click Ok to get the result below
We have successfully filtered the Musa’s sales on Bajaj Boxer.
To Remove Filter
1. Click on the data set
2. Data Menu and select Filter
Or simply Right Click on the Data set and select Filter.
Advance Filtering
This feature did not just facilitate us with an easier way to extract records from
dataset using complex criteria but save us a lot of time. For instance, the
criteria for filtering in our earlier above demonstration include “BAJAJ
BOXER” as product and “MUSA” as Sale Rep. which took us up to eight steps
to completed can be simplify with just three steps using Advance filter as
describe below
Step 1 is to write out the criteria. In this case is “BAJAJ BOXER” and
“MUSA”. Write it in such a way that filter will know the actual column to find
the criteria. That is “Bajaj Boxer” and “Musa” will be written under Product
and Sale Rep respectively.
Step 2: Go to Data Menu and select Advanced in the Sort & Filter group to
launch ADVANCED FILTER
Advanced FILTER dialog box will popup. Select “Filter the list, in place” as
an action, choose the List range and criteria range then click Ok button as
shown below
The result will appear like what I have below
So simple!
The good thing about this advance filter feature is how it facilitate the
placement of filtered records on a separate sheet. All you need to do is to
create new sheet, launch Advance Filter choose “Copy to another location” as
an action and “Copy to” option to specify the new location.
Then click Ok button to get the result I have below on sheet2.
It works like magic and very easy despite it named “advanced” filter.
Chapter 5: Charts in Excel
Charts are essential tools in communicating numeric data (messages) in a
graphical format. Excel has a lot of chart types, including line, pie, column,
stock, radar, and combo to mention few. Knowing the right graphing tools for
message is very important in excel if you are to produce effective reports that
are readable and summarily convey all you intended to communicate.
Create charts that will clearly and succinctly convey our messages required
some fundamental steps found across all types are specified below
Charts creation Steps in excel
Get data into excel sheet
Select a type of chart/graph to create
Switch axes if necessary
Adjust labels and legends, if desired…
Reorder data, if desire
I will be limiting my discussion in this chapter to Line, Column, Bar, Pie and
Combo charts and when to use them since they are the major and most used
charts.
Column Chart
This is used to compare values across categories and can be in either of its
three forms, which include (1) clustered column, (2) stacked column, and (3)
100% stacked column.
Clustered Column
This lay more emphases on individual variance since order of the category is
not matter. The table below shown our Dashboard Software sales to selected
customers will be a good illustration.
Remember the fundamental steps to create chart that I earlier itemized
1. Highlight the range containing the data
2. Go to Insert Menu and click on column chart
3. Select clustered column under 2-D column to choose the chart type.
A chart that looks like what I have below will appeared
Let’s do little formatting on the chart to make it visual appealing.
1.
Click on the chart and go to Design Menu under Chart tools
2. Change the chart layout if need be.
3.
Adjust necessary chart elements like axes, gridline, data label,
legends, data table and so on.
You can do other adjustment like Shape effect, bar color, background and
border color and so on under Format menu as shown below
1.
Click on the chart
2. Go to format menu under chat tool and do necessary format you
want like choosing the border color, background, shape effect, and
bar color.
I selected chart layout three, added data table under add element and choose
blue as my border color. Below is what I got.
This same approach is applicable goes for 3D chart. It just that you choose 3-D
column instead of 2-D column we earlier selected.
You can repeat the necessary formatting as chooses.
Stacked Column
This is an ideal chart to shows the breakdown of data that made up the bar. See
the example below
Remember our fundamental steps
1. Highlight the data set
2. Go to Insert Menu and select on column chart
3. Click on stacked column chart (2-D column). The chart above will
appear.
100% Stacked Column
This shows the breakdown of data that makes up the bar in percentage unlike
the stacked column that shows values.
To insert the above chart
1. Highlight the data set and go to Insert Menu
2. Select column chart and click on 100% stacked column chart (2-D
column).
Line Chart
This type of chart is very handy when it comes to displaying trends of one or
more measures over a period of time.
Remember our fundamental steps.
1.
2.
3.
4.
Highlight the range
Go to Insert Menu and select Line chart
Click on the line chart
Choose the type of line chart you want.
Below is what you will get. Though I made little formatting like border
color, chart layout three and legend to the bottom to make it visual
appealing.
Bar Chart
This is very similar to column chart and ideal chart to use when your table
contains lots of entries or long labels. The example we will be using is the
Nigeria Glo premier football league table as at the end of week 17.
Once again remember our fundamental steps in order to insert bar chart for
the above table.
Below is what you will get
Now let’s reverse the vertical axis to make sure the team with highest point is
at the top. That Sunshine Stars FC will be at the top while FC Taraba will go
to the bottom. To do that
1. Right-click on the vertical axis on the chart
2. Select Format Axis and Click on Axis option
3. Click on Categories in Reverse Order box to check it.
Below is what you will get. Though I adjust the data labels to outside end and
removed the horizontal axis to make it visual appealing. Go on and do other
formatting as wishes.
Pie Chart
Pie chart is the right chart to emphasise the contribution of each category to the
pie that represents grand total. This can be demonstrating with the following
example showing the number staff across selected department in Nicon Hotel.
To insert pie chart for the above table.
1.
2.
3.
4.
Highlight the data
Go to Insert Menu and select pie chart
click on pie chart
Select the type of pie you want.
Below is the result you will get
Now you can do little format as you chose. But here I will select one of the
design in excel.
Combo Chart
This contains two or more chart types in a graph. It is cool feature is how it
shows the interconnected data with their combined relevance. For example,
Romatee Motorcycle sales trends across years.
To insert combo chart for this is very easy particularly in excel 2013 and
beyond.
1.
2.
3.
4.
Highlight the cells range
Go to Insert Menu then chart group
Choose Recommended chart and
Select combo chart you want and click Ok
Screenshot below looks like what you will get
Chapter 6: Business Analysis Aided Tools
Conditional Formatting
This is arguably one of the best tools used to indicate various metrics
performance in report generation. It is in two forms which include built-in
conditional formatting and Logical formula. It can be access under Home Menu
as indicates below
Built-in Conditional Formatting
This contains predefined conditional formatting rules built in Excel to display
various metrics performance without building any new formula. The built –in
formatting rules include Highlight cells rules, Data bars, color scales,
Top/Bottom, and Icon sets.
Highlight Cells Rules
Here you can highlight cells that either greater than, less than or equal to a
value. It also allows us to highlight cells than contain specific text, value in
between, duplicate to mention few. Let’s illustrate how Excel highlights cells
that hold values that are greater than a particular one. For instance, quantity
sold that are greater than 400 from the table below
Do the following
1.
Highlight cells B3:B10
2. Go to Home menu
3. Click on Conditional formatting
4. Select Highlight Cells Rules and choose Greater Than
5.
6.
Enter the specified value, in our case here is 400.
Choose format style, I will go with default.
7.
Click ok to get the below result
The same process can be repeat for the like of Less Than, Equal to, value in
between, and duplicate to mention few.
Top/Bottom Rules:
Here we can highlight the cells that hold highest values or least ones, top
percentages or bottom percentages, and above average or below average. Let’s
applied Top/Bottom Rules on the same given table. To highlight the TOP 3
values in the range.
1. Highlight cells range B3:B10
2.
3.
4.
5.
Go to Home menu
Click Conditional formatting
Choose Top/Bottom Rules
Select Top 10 items
6. Change rank top 10 to 3 and choose format style
7. Click ok to get the below result
The same process can be repeat for the like of bottom values, above or below
average, top percentages.
Data Bars
Data bars use bars to represent values in the cells, the higher the value the
longer the bar. Let’s follow the same procedure on the above table.
1. Highlight cells range B3:B10
2.
3.
4.
5.
Go to Home menu
Click on Conditional formatting
Select Data Bars
Choose any of the Gradients or solid fill.
Your result will look like the screenshot below
Color Scales
Let’s applied color scales on our example. We can still follow the same
procedures
1. Highlight cells range B3:B10
2.
3.
4.
5.
Go to Home menu
Click on Conditional formatting
Select Color Scale
Choose any of the color pattern from the popup.
Below is what you will get.
Icon Sets
Icon sets enhance visualization of data with arrows, flags, check marks,
shapes, and rating starts to mention few. Let’s applied icon sets on the above
example. Follow the same procedure
1. Highlight cells range B3:B10
2.
3.
4.
5.
Go to Home menu
Click on Conditional formatting
Select Icon Set
Choose from the options. But I will like to choose directional symbol
from the popup.
Here is my result
Logical Formula
This involve building rules to satisfy some conditions that are taken care of by
preset conditional formatting. In a table below I want to build a formula that
will highlight the entire rows that contain the same transactions date with the
date supplied in cell A3.
To do this is very simple. All you need to do is to follow the set out steps
below:
1.
Highlight the cells range starting from cell A7 to cell D23
2. Go to Home Menu
3. Click on Conditional Formatting
4. Select New Rule
5.
Click on “Use formula to determine which cell to format” from
conditional dialog box that popup.
6. Click on “Format values where this formula is true” field and type
the formula below in it
=$B7=$A$3
{This formula is asking cell B7 if its content is the same as that of cell
A3}
7.
Click on format
8. Click on FILL tab in the format cells dialog box
9. Select color of your choice
10. Click Ok to accept the format and return to conditional formatting
dialog box
11. Click Ok again in the conditional dialog box to effect the change.
Below is what you will get.
You can decide to change the date in cell A3 to see different effect. The good
thing about this is that the condition formatting will remains in the sheet even
when the entire data has been deleted and can still be used for another month.
Conditional Formatting with Data Validation
Instead of inputting data directly into the search cell like will did in cell A3 in
the previous example, we can restrict the input value to certain set of values to
reduce or eliminate input errors. Let’s see how will can apply data validation
in this example.
Select cell A3 and the knowledge of data validation you learnt earlier in
chapter 3. You will get what appears below
You can now proceed to build your rules in the same process demonstrated in
the previous example.
Once you pick any Sales rep from the list in cell A3, the rules apply
accordingly as it shown below. This make the process more dynamic and
faster.
Two ways Conditional Formatting
Unlike what happened in the previous example, with help of conditional
formatting you can easily fetch certain record from data set with two criteria.
For instance, I may choose to search for the actual values sold on any product
by a particular Sales representative in the data set below
The only trick here is to make use of AND operator to combine the two
criteria. In this case, we will build rules based on Sales Rep and Product. The
rule will be in form of this
=AND ($A8=$A$3, B$7=$B$3)
The dollar Sign “$” uses as absolute reference to lock a certain parameter.
What this implies here is to lock the column A on the first condition since it
house all the Sales Rep but on different rows. Row 7 is also locked since it
hosts all the products input but on different column.
You will get this
So simple!
Three-ways Conditional Formatting
We can improve on how we build rules in conditional formatting to
accommodate the scenario that involves three criteria. Unlike two-ways that
based on Sales Rep and Product earlier discussed, we can include additional
criteria to make it three. Let’s call it Month as shown in the data set below
Let’s repeat the same process we deployed in 2-ways earlier using the AND
operation to include the three conditions. The rule will appear like this
=AND ($A8=$A$3, $B8=$B$3, C$7=$C$3)
You will have something in the screenshot below
The will output the following result
Wow! So simple and interesting. You can try other possibilities since is
impossibility is nothing specifically in Excel.
Clear Rules
Follow the following steps to clear rules
1. Go to Home menu
2. Click on Conditional formatting and choose Clear Rules
3. Select either “Clear Rule from Entire Sheet” or “Clear Rules from
Selected cells”
Freezing Panes
This is very useful when dealing with huge data sets and you intend to keep
some rows or columns such as heading to remain visible while scrolling
through the entire sheet. All you need to do this is to select the Row or Column
to freeze, go to VIEW Menu, and Click on FREEZE PANE to either unfreeze if
there is existing frozen columns/rows or perform fresh freeze on
rows/columns.
The three popup options to select from include Freeze panes, Freeze Top
Row, and Free First Column.
4. Freeze panes: this keep both rows and column visible while the rest of the
worksheet moving.
5. Freeze Top Row: as it names implies, it keeps the top row visible while
scrolling the entire worksheet.
6. Free First Column: this undoubtedly keeps the first column visible while
the scrolling through the entire sheet.
Below is an example show how I applied freeze to allow my first two rows
to remain visible while other rows are moving when scrolling. All I did
was to click on a cell in Row3 (where I want the scrolling to start)
click on view
select Freeze Panes
then
Windows Splitting
Splitting Window is very essential when there is need to compare or monitor
parts of an excel worksheet that are far from each other but dependent. This
tool will not just allow you to have view of two independent windows but can
be scroll independently. Below is a table comprises all our revenue for the
year 2015. Let’s split it into two using SPLITTING WINDOW tool so that we
can compare the performance of each client with the other.
All you need to achieve this is to click on any of the number at leftmost of
the sheet to select a complete Row or on any of the alphabet to select
column, go to view, and click on split.
Below is the result you will get
Take note of those arrows and the numbering at the leftmost of the sheet.
Protect Worksheet and Workbook
Access restriction is key to report generation to avoid unnecessary alteration to
records. More so, it is very essential in excel to control access to either
spreadsheet or workbook. Sometimes you may decide not to allow access to
the entire workbook or protect users from edit any part of the worksheet. To
protect either workbook or worksheet, do the follow:
Open the file, go to File (excel 2013), Click on Workbook protection, and
Select the access control you want from the popup. Those popup option
include
Mark as Final: this mark documents as read-only.
Encrypt with Password: allows us to protect the entire workbook
Protect Current Sheet: it facilitates the protection of current sheet.
Protect Workbook Structure: restrict unnecessary change to the
workbook structure
Restrict Access: prevent user from edit, copy or print but can only
view the document.
Add a Digital Signature: promote the integrity of the entire work.
Select “Encrypt with Password” to protect the entire workbook. This
implies that users must supplied password to open the workbook. A dialog
box will appear for you to supplied password and click Ok to accept the
setting. The setting will take effect as soon as you want to reopen the file.
Select “Protect Current Sheet” to protect worksheet as its name implies. A
Protect Sheet dialog box will appear to control your access restriction for
that sheet. Just supplied the password and tick the corresponding checkbox
to allow users some certain access. Then click ok to accept the setting.
You can work round the remaining options to see the effect. The skills are
endless.
How to Protect Cells that Contain formulas?
It is advisable to always protect cells that hold formulas in a worksheet to
avoid unnecessary alterations or operational errors. The following steps will
serve as our guide to protect the cells that contain formulas in the data set
below:
1. Highlight the entire worksheet by press CTRL A on your keyboard, then
Right click to select “Format Cell” option.
2. Format cell dialog box will appear, click on protection tab and Uncheck
the box next to Lock, then click Ok to accept the setting.
3. Go to Home and click on Find and Select in editing group then choose
formulas from the popup options to select all the cells that contain
formulas in the entire worksheet.
4. Now right click on one of the selected formulas cells and click on
“format cell” from the popup options to open format cell dialog box
5. Tick the checkbox beside LOCK and click Ok
6. Now go to REVIEW MENU and click on “Protect Sheet” in changes
group to invoke Protect Sheet dialog box. Key in your password and
click OK to confirm the password.
7. Click Ok again to accept the password settings.
Chapter 7: Logical Function in Excel
Basics of IF Function
IF function is one of the most useful function in Excel and the trick behind the
function is to instructs Excel to test a condition and returns one value if the
supplied condition is met (TRUE) and return another value if otherwise
(FALSE).
Syntax:
IF (logical_test, [value_if_true], [value_if_false])
Logical_test: this a logical expression that can be either TRUE or
FALSE
Value_if_true: values to return if the condition is satisfied
Value_if_false: value to return if the condition is not met.
For instance, the screenshot below shown the test to check the voting status of
selected people and established if they are eligible to vote or not. One must
have attained the age of 18 or above in order to vote.
How It Works:
IF (B2>=18,"Eligible to Vote”, “Not Eligible to Vote")
B2>=18: This logical expression test if age given in cell B2 is
18years and above
Eligible to Vote: is what Excel will return in cell C2 if the
condition is satisfied (TRUE)
Not Eligible to Vote: is what Excel will return if the condition is
not met (FALSE).
The formula asked excel to match Saheed’s age in cell B2 and test if is greater
or equal to 18years old and return “Eligible to Vote” if it is TRUE and return
“Not Eligible to Vote” if the result is otherwise.
Let’s further our illustration with another example. Using IF function to
determine bonus earned by each product based on quantity sold.
The formula asked excel to test the quantity of the Product sold if is more than
100 then assign 5% bonus to the sales agent and 2% otherwise.
Combining IF with AND
Incorporate AND function in IF function’s logical expression will ask Excel to
returns TRUE if all conditions are satisfied and FALSE otherwise.
IF (AND (C4>=18, D4="YES"),"Eligible to Vote”, “Not Eligible to Vote")
The above formula combined two conditions that must be satisfied in
order to return TRUE and return FALSE if otherwise.
Condition 1: the person must be 18years and above
Condition 2: must be a citizen of Nigeria
Combining IF with OR
Embed OR function within IF function’s logical expression will force Excel to
return TRUE if any of the conditions is met, and FALSE if otherwise.
=IF (OR (L4<18, L4>60),"Entitle to Free Health”, “No Free Health")
The above formula comprises of two conditions that one must be met to return
TRUE and return FALSE if none of the conditions is met. Before one can
entitle to free health, he/she must either less than 18years old or above 60years
old.
Condition 1: the person must not be up to 18years old
Condition 2: the person must be 60years above
Nested IF Function
This function facilitates the use of multiple IF functions in order to return three
(3) or more different results. The good thing about this function in Excel 2007
and later version is how it makes room to accommodate up to 64 NESTED IF.
The table below shows the scores of selected students in a certain examination
and their examiner remarks based on individual performance.
=IF (D2<=45,"Poor", IF (D2<=69,"Good","Excellent"))
The above formula is made up of three conditions
Condition 1: D2<=45, this expression test if the score in cell D2 is 45 or
less and return POOR performance as the remark.
Condition 2: D2<=69, this expression test if the score is 69 or below but
must greater than 45 and return GOOD if satisfied.
Condition 3: D2<=45, this test if the score is 70 and above and return
EXCELLENT is satisfied.
COUNTIF and COUNTIFS
COUNTIF function in Excel is use to counting cells within selected range that
met a certain condition.
Syntax: COUNTIF (range, criteria)
Range: this is the selected cells to count from
Criteria: it spelt out the condition to be met doing the counting
The following example elaborate more on how COUNTIF works. The formula
asked excel to count the number of Bajaj Boxer in the selected range B2:B15
and return the amount count to cell E2. It returned 4 to show that Bajaj Boxer
appears in four places.
Let’s take further steps to count the number of occurrence of individual
motorcycle. I decided to put all the motorcycles in column E and the number of
occurrence using COUNTIF in column F as shown below. Cell address was
used against the name of individual motorcycle as a criterion. This tell excel to
pick whatever found in the cell in column E as the criteria.
COUNTIFS function is other hand is use for counting cells within selected
range that meet multiple criteria or conditions.
Syntax:
COUNTIFS (criteria_range1, criteria1, [criteria_range2, criteria2],)
Let’s illustrate this better with the example below. The intention here is to
count the number of times a particular sale agent sold a brand of motorcycle.
The function asked Excel to search “Honda” (criteria1) in cells range A2:A15
(range_criteria1) and match it with another cells range B2:B3
(range_criteria2) to lookup for “Zainab” (criteria2) and return the number of
occurrence where the two criteria are on the same row. This prompt the
formula in cell E2 returns 3 to indicate Zainab sold Honda in three times.
Let’s take a step further to see how we can trick excel to return the number of
occurrence of an individual Sales Rep on all available brands of motorcycle
when select the sale rep in a drop-down menu. To do this we need to use data
validation for the drop down menu as appear in cell G1 below.
Having done with the drop-down menu using data validation, we can now
select individual sale rep from the list. The next is to trick excel to return the
number of occurrence where the two selected criteria are on the same row to
cells G6 to G9. COUNTIFS can do it easily as appeared in the screenshot
below
With the drop down menu, you can select other sale rep from the list to see
their corresponding values in the cell G6 to G9.
SUMIF and SUMIFS
SUMIF is an Excel function that adds values based on a single criterion.
Syntax: SUMIF (range, criteria, [sum_range])
range: selected cells to be matched
criteria: condition that must be met
sum_range: cells to sum if the condition is satisfied
This is similar to what we did under COUNTIF but instead of only count based
on a single criterion, we will be adding values under SUMIF. The example
below shows how the function asked excel to lookup for the criteria (Bajaj
boxer) in the range criteria (B2:B15) and return the addition of the
corresponding values in the sum_range (C2:C15) to cell E2.
The total quantity of Bajaj boxer sold for the period under consideration is 194
pieces as indicate in cell E2.
Here is another illustration to for better understanding. I want excel to supply
the total quantity sold per brand of the motorcycle to show in the cell (in
column F) next to the motorcycles in column E.
The total quantity sold per brand is now appear next to the cell that holds
individual brand of the motorcycle. This makes our work nicer and readable.
Trick excel to do more since the skills are endless.
SUMIFS function was introduced in Excel 2007 to find conditional sum of
values based on multiple conditions. In short, it sums cells that matched
multiple criteria.
Syntax:
SUMIFS
(sum_range,
[criteria_range2, criteria2] …)
criteria_range1,
criteria1,
sum_range: cells to sum if the condition is satisfied
criteria_range1: the first range to be evaluate with associated
criteria
criteria1: the first condition to be satisfied
This is better explained in the following example. Here we will be using
multiple criteria against what we have in SUMIF where addition of values is
based on a single criterion. The two criteria to use here is Honda (motorcycle)
and Zainab (Sale Rep). Excel will have established the rows that contain the
criteria and return the addition of the corresponding values in sum_range
(D2:D15) to cell F2.
The function returns 150 as the total quantity of Honda motorcycle sold by
Zainab.
Like I did earlier under COUNTIFS, I want to break individual quantity of
motorcycle sold to different brand by placing the quantity at the next cell in
column H to one that hold each brand of motorcycle in column G. I make use of
data validation to create my drop down menu in cell H1. See the detail below
The individual quantity sold per brand will be showing as you keep selecting
different Sale rep.
AVERAGEIF and AVERAGEIFS
AVERAGEIF gets the average numbers that satisfied one condition and return
number representing the average. It is similar to the way we count and sum
under COUNTIF and SUMIF respectively.
Syntax: AVERAGEIF (criteria_range, criteria, [average_range])
Criteria_range: cells range that hold the cells to match our criteria
criteria: a condition to follow
average_range: the cell to average
The illustration below searched for Honda (criteria) in the criteria_range
(B2:B15) that contains brands of motorcycle and return the average of the
values to cell E2.
The function simply extracts those values where the condition is met and
calculate the average. The values include 74 and 41.
The average = (74+41)/2 = 57.5
AVERAGEIFS gets the average numbers that satisfied multiple condition and
return numbers represent the average. In short, it averages cells that matched
multiple criteria.
Syntax:
AVERAGEIFS
(average_range,
[criteria_range2, criteria2] …)
criteria_range1,
criteria1,
average_range: cells to average if the condition is satisfied
criteria_range1: the first range to be evaluate with associated
criteria
criteria1: the first condition to be satisfied
The example below illustrates how to find average based on two criteria. The
criteria are Honda (motorcycle) and Zainab (sales Rep). I tried to figure out
the average of the Honda motorcycle sold by Zainab for the selected period.
SUMPRODUCT
SUMPRODUCT function can be use in place of SUMIFS and COUNTIFS
since it addressed lots of their limitations in Excel.
Syntax:
SUMPRODUCT (array, [array1], [array2] …)
It simply takes one or more arrays of numbers then test for TRUE or FALSE
answer with the numerical equivalent of 1 being TRUE or 0 being FALSE (that
is Excel should use 1 where the condition is true and 0 where is false) and
return the sum of products of corresponding number.
Let’s illustrate this concept with the example below
How it works:
Remember we have two criteria (Honda and Zainab) to lookup for in the two
criteria_range. Wherever any of the criteria is met, excel will return TRUE and
awarding the cell a 1, if otherwise FALSE will be return and awarding the cell
0. This is more explain in the screenshot below
The function will find the products of individual rows as will do in column J.
And later sum the products to get the total quantity of Honda motorcycle sold
by Zainab for the period under review.
IFERROR
This function helps to trap errors and return a meaningful value in place of
usual cryptic error entry if formula evaluates to an error in Excel.
Syntax: =IFERROR (value, value_if_error)
value: the expression to be check for an error
value_if_error: value to return if error is found
Let’s illustrate this an example below
#DIV/0! and #VALUE! Errors indicates that Excel cannot divide numerical
value by zero and by text respectively. We can have used IFERROR function to
display something meaningful rather than those Excel jargons. See how we
handled that in the screenshot below
IFERROR function asked Excel to return zero if an expression tested return
error.
Chapter 8: Performing Lookup in Excel
LOOKUP Function and its Application
LOOKUP function simply searches for a value in one-row or one-column range
and retrieve a value from the same position in another one-row or one-column
range. This is very useful particularly in find the value in the last non-empty
cell in a row or column. This function is in two forms of vector or array.
LOOKUP - Vector Form
Syntax: =LOOKUP (lookup_value, lookup_vector, [result_vector])
lookup_value: This argument is the value to search.
lookup_vector: The one-row or one-column range to search.
result_vector: the one-row or one-column range of result [optional].
LOOKUP function does assume that lookup_vector is sorted in ascending order
and whenever lookup value cannot be found, LOOKUP will automatically
match the next smallest value. Lastly, it will return #N/A error when lookup
value is less than all values in lookup_vector.
The LOOKUP takes the lookup_value in argument cell A3 (40) and search for
it in lookup_vector and returned the corresponding value (E) in the
result_vector.
Note: the lookup_vector range must be of the same size with that of
result_vector.
LOOKUP - Array Form:
This search for a given lookup_value in first row or column of supplied array
and returned the corresponding value from the last row or column of the array.
Syntax: =LOOKUP (lookup_value, array)
lookup_value: This is the value to search.
Array: A 2-dimentional array of data containing values you intended
search in the either first column or row and corresponding values to be
retuned in either last column or row.
This clearly illustrated in the example below. The concept behind ‘Grade
generating board’ is to search the student score in the table array and return the
corresponding grade.
The LOOKUP will match the lookup_value supplied with the values in first
row and in case it cannot be found it will match the next smallest value to the
lookup_value and return the corresponding value in the last row. In this case
our lookup_value in cell A3 is 56 and 56 cannot be found in the first row but
we found 50 as next smallest value to 56. LOOKUP will return the
corresponding value to 50 at last row which is ‘C’ back to cell B3.
To find the last non-empty cell using LOOKUP function, let us work on the
example below
To fix this is very simple with the help of LOOKUP using the formula below
=LOOKUP (2, 1/ (3:3<>""), 3:3)
How the Formula Works
a) 2 is the lookup_value
b) The expression 3:3<>”” is a range in row 3 that returns an array of
TRUE or FALSE values.
c) The number 1 will then in turn divided by this array in (b) above to
get another new array that made up of either 1’s (1/1) or Divide by zero
errors (#DIV/0!) Which will now form our new lookup _vector.
d)
The lookup function will search for lookup_value and in case it
cannot be found, the next smallest value position will be automatically
matched. That shows lookup will match the last 1 in the array since 1 is
the largest value in the lookup_vector and next smallest value to 2.
e) The corresponding value at that same position will be returned by
LOOKUP.
VLOOKUP and its Application
VLOOKUP Function is one of the powerful Excel Formula that does a lot of
magic for me. Interestingly, it enables me to carry out hundreds of calculations
and analysis in minutes. Though the golden rule is to search vertically (top to
bottom) of the left column (usually leftmost) of the lookup table until it
establishes a value that matches or nearly approximate the one being looking
up and then return the corresponding value in the column that matches the one
specifies in col_index_num argument of the VLOOKUP. It can be use in two
ways to search for either EXACT MATCH of the value you intend looking up
in the table or closest (Approximately match) value you wish to return.
The syntax is:
=VLOOKUP
[range_lookup])
(lookup_value,
table_array,
col_index_num,
Argument details:
lookup_value: the value you want to look up in the table
table_array: the cell range that containing both value to look up for and
the one to return.
col_index_num: the number of column whose value you want to return
range_lookup: option logical TRUE or FALSE that specifies if you want
excel to find either exact match or approximate match.
Better illustration
=VLOOKUP (search this value, in this given table, bring back the value in
column number Y of the table as result, [but only if ONE of these conditions
{Exact Match is established (FALSE) or approximately Match (TRUE)}])
In the table below we want to find the salary of each manager in column E
using their Staff ID as the lookup value. Interestingly the salary information in
column E in a table is to the right of Staff ID (supplied value) in column A, and
this where we will allow the almighty VLOOKUP to come to our rescue.
To get this done and return the salary of the manager with “Staff ID” supplied
in cell A2, the following VLOOKUP formula needs to be insert into cell B2.
= VLOOKUP (A2, A7:E13, 5, FALSE)
That is Cell B2 = VLOOKUP (search the ‘Staff ID’ appear in cell A2, in the
table array (A7:E13), upon sited it (lookup value) bring back the
corresponding value in column number 5, and it must be Exact Match (FALSE)
VLOOKUP for Exact Match
The optional logical FALSE of the range_lookup argument does the magic here
by forcing excel to established the lookup value to locates exact match.
=VLOOKUP (search this value, in this given table, bring back the value in
column number Y of the table as result, [but only if it Exact Match is
established])
In the example below, we want to search BONUS for individual manager
based on the percentage allocate to each department in the second table title
‘Bonus’ and place the percentage in column E. The good news here is that the
column (I) that houses the department is at the LEFT side of the column (J) that
holds our percentage. VLOOKUP will come into play again
Insert this formula into cell E3
=VLOOKUP (C3, $I$2: $J$7, 2, FALSE)
Take note of FALSE argument
Below is what you will get 0.02 as the value in cell E3. You can format the
cell back to percentage to get this 2%. Though they both mean the same thing.
The bonus percentage for Sylvanus 2% because he is in Account department.
You can copy the formula down to see what happen in other cells.
Now we can improve our formula by calculate the actual bonus. It is very
simple to do that, just multiply the VLOOKUP formula in cells in column E by
its counterpart in column D. The formula in cell E3 will become this
= (VLOOKUP (C3, $I$2: $J$7, 2, FALSE)) *C3
Then change the cell format back to general from percentage to get this
So Sylvanus in account department will go home with a bonus of N7,522.62.
That is 2% of his salary.
VLOOKUP for Approximately Match
The optional logical TRUE of the range_lookup argument allow Excel to guess
the closest and smallest value (Approximately Match) to the lookup value and
returns the value in the column designated by col_index_num argument. This
pertains to when searching for numeric value. It is very important that Numeric
lookup column must be unique as well sorted.
=VLOOKUP (search this value, in this given table, bring back the value
in column number Y of the table as result, [allow Excel to guess the
closest Approximately Match])
Let’s generate commission base on each total sale (column F) carried out by
sales Representative in ABX Motorcycle Company on different motorcycle
brand in the table below.
We will allow Excel to match the closest value in the table array (K3:M12) to
the lookup value pick from column F if there is no exact match and THEN
return the corresponding commission rate to column G. this is possible with the
help of logical TRUE of the range_lookup argument.
The formula is cell G3 will become
=VLOOKUP (F3, K3:M12, 3, TRUE)
In other word, the TRUE can be left out since Excel recognises it as default.
That mean the formula can be in this form
=VLOOKUP (F3, K3:M12, 3)
HLOOKUP and its Application
HLOOKUP in other hand does it search horizontally by matching lookup value
located at the first row (unlike VLOOKUP that is vertical) from top to the row
that holds the value you want to return. It can be use just like VLOOKUP in two
ways to search for either EXACT MATCH of the value you intend looking up
in the table or closest (Approximately match) value you wish to return.
The syntax is:
HLOOKUP
(lookup_value,
table_array,
row_index_num,
[range_lookup])
lookup_value: the value being lookup to
table_array: table from which to retrieve the data
row_index_num: the row number from which to retrieve data
range_lookup: A Boolean to indicate exact match or approximate
match.
Looking for Exact MATCH using HLOOKUP
In the table below we want to find the salary of each manager in row 5 using
their Staff ID as the lookup value. Interestingly the salary information in row 5
in a table is to the bottom of Staff ID (supplied value) at row 1, and this where
we allow the almighty HLOOKUP to strut its stuff.
To get this done and return the salary of the manager with “Staff ID” supplied
in cell A2, the following HLOOKUP formula needs to be insert into cell B2.
=HLOOKUP (A3, F2:L6, 5, FALSE)
That is Cell B2 = HLOOKUP (search the ‘Staff ID’ appear in cell A2, in the
table array (F2:L6), upon sited it (lookup value) bring back the corresponding
value in row number 5, and it must be Exact Match (FALSE)
You will get below result
Looking for Approximately Match using HLOOKUP
The optional logical TRUE of the range_lookup argument influence the change
here by allow excel to guess approximate match to the lookup value.
HLOOKUP (search this value, in this given table, bring back the value in row
number Y of the table as result, [allow Excel to look for approximate match in
the absent of exact match])
Let’s see if we can search commission base on each total sale (column F)
carried out by sales Representative in ABX Motorcycle Company on different
motorcycle brand in the table below.
We will allow Excel to match the closest value in the table array (I1:P3) to the
lookup value pick from column F if there is no exact match and THEN return
the corresponding commission rate to column G from row 3. The optional
logical TRUE of the range_lookup argument make this possible.
The formula is cell G3 will become
=HLOOKUP (F3, I1:P3, 3, TRUE)
In other word, the TRUE can be left out since Excel recognises it as default.
That mean the formula can be in this form: =HLOOKUP (F3, I1:P3, 3)
Chapter 9: Power Excel Data Functions
Sometimes one might want to work with datasets that contain longer strings
even more than 255 characters without ending up having #value! Error while
Excel maintains highest processing speed of lookup formulas in workbooks
that contain thousands rows as well as thousands of lookup formula, the ideal
tools to employ to address the aforementioned are INDEX, MATCH, and
CHOOSE functions.
MATCH Function
This searches for lookup values in a range of cell, and return the corresponding
position of the value in the range. In other word, it gets the position of an item
in an array.
Syntax:
=MATCH (lookup_value, lookup array, [match_type])
Lookup_value is the value to match in lookup_array
Lookup_array is a range of cells or an array of reference
Match_type is an optional argument that specified whether to return
exact match or otherwise:
1. -1: Match the smallest that is greater or equal to lookup value
2. 0: Match the first value that is exactly equal to the lookup value
3. 1: Match the largest that is greater or equal to lookup value.
Since MATCH is all about locating the position of an item in array. Let’s
illustrate it better with following examples
Let’s use MATCH function to find the row number that holds “AFROMART”
in the column A of the above table. The formula will be
=MATCH ("afromart", A3:A9, 0)
And can be explain as follows:
Look up this value “AFROMART” in the lookup array “A3:A9” and return
exact match “0” position to cell H2 as the row number
Having insert, the formula in to cell H2, it returned 4 to cell H2 which
indicating that AFROMART is on row 4 of the lookup array.
Let’s use the same MATCH function to find the column number holding
“TRIAINING” in the same table. Type this formula in cell H2
=MATCH ("training", A2:E2, 0)
The above formula can be better explain as follows
Search the value “TRAINING” in the lookup array “A2:E2” and return Exact
Match “0” position to cell H2.
This return 3 as the column number to cell H2.
INDEX Function
This function returns a value in an array based on the specified row and
column number. That is, it gets value cell range based on its location.
Syntax:
=INDEX (array, row_num, [column_num])
Or
=INDEX (reference, row_num, [column_num], [area_num])
Array is the range of cells or an array of constant(reference)
Row_num is the row position in the reference or array. If omitted, the
column_num is required.
Column_num is the column position in the array. In case it is omitted, the
row_num is required.
Area_num is optional specifying the range in reference that should be
used.
Suppose we want to know the exact amount charged by 85Metrics for the
recent Excel Training conducted for Afromart’s staff from the table below.
INDEX function will be ideal tool to deploy since it primary purpose is to
return value and not position like MATCH function. Remember with the help of
MATCH function in earlier example we were able to determine the both row
and column number for this particular task to be 4 and 3 respectively. Let’s
make use of it in our new formula below
=INDEX (A3:E9, 4, 3)
The formula searches the table array A3:E9 and returned the value located at
position where row4 intersect column 3 to the cell H2.
INDEX function returned ₦ 700,468 to cell H2 which is the exact amount
charged AFROMART for the training.
We can decide to combine both INDEX and MATCH together and still get the
same result. The formula will now look like this
=INDEX (A3:E9, MATCH ("afromart", A3:A9, 0), MATCH ("training",
A2:E2, 0))
INDEX MATCH Function
We can even combine both INDEX and MATCH together and still get the same
result in the previous example. The formula will now look like this
=INDEX (A3:E9, MATCH ("afromart", A3:A9, 0), MATCH ("training",
A2:E2, 0))
We can still mate more dynamic to cover other companies and their charges
with the help of Drop-down List Menu in data validation. Let’s following the
following steps to accomplish the task.
1. Create Drop-down list menu for both Clients in cell H2 using data
validation
2. Repeat the same for Charges in cell H3
3. Key in this formula into cell H4 to return the charges for individual item
selected for the client.
=INDEX (A3:E9, MATCH (H2, A3:A9, 0), MATCH (H3, A2:E2,
0))
4. Below is what it will returned to cell H4 as the Amount charged for the
selected items in both cell H2 and H3.
The amount charged on SOFTWARE for MATRIX is ₦ 705,927. You can play
with it by changing both clients and charges from Drop down Menu to see
different values. That is one power of INDEX MATCH function.
More so, INDEX MATCH function has put an end to VLOOKUP shortcoming
of its inability to look left. Lookup column can now be at the right column of
lookup table as result of the flexibility of INDEX MATCH function against the
VLOOKUP’s golden rule that lookup value be reside at leftmost column of
lookup range. In the below example, I will pick CONTACT OFFICER as my
lookup value. Interestingly is at the rightmost column of the lookup table.
INDEX MATCH is the right tool to strut the stuff.
The following are the steps to the task.
1. Let’s make it more dynamics by using drop down list menu in data
validation to pick the contact officer (lookup value) as it appears below.
Kindly take note of the column number as indicated.
2. Key in this formula in to cell B3 to pull corresponding client to the
Contact Officer (lookup value) selected in cell A3.
=INDEX (A10:E16, MATCH (A3, E10:E16, 0), 1)
The good thing here is that we used MATCH function to determine the specific
row number while column number is being input direct.
3. Repeat the same formula for the rest by simple change their column
number. Let’s do one more for SOFTWARE
4. Repeat the same process for the rest.
CHOOSE Function
CHOOSE function returns a values based on its position on the list
Syntax:
= CHOOSE (index_num, value1, value2, value3…)
Index_num: this is the value to choose
Value1: this the first value from which to choose
Note the value to choose could be between 1 and 254.
Below is a list of tasks to buttress our illustration. I want a situation if Task
number (index_num) is input into cell B2, CHOOSE function will
automatically populate cell C2 with detail of the task (value) as stated in the
task list.
The following steps will lead us to the solution:
1. In put any number between 1 and 8 in cell B2 since we have just eight
tasks
2. Type in this formula into cell C2
=CHOOSE ($B$2, C7, C8, C9, C10, C11, C12, C13, C14)
This formula asked the CHOOSE function to match the index_num supplied in
cell B2 and return the corresponding value (Description) from the list of
values (cell C7 to C14) back to the cell C2.
3. Press Enter to get the result in the screenshot below
Chapter 10: Arrays in Excel
An Array and array Formula
An array is a series of data values in a cell as against the usual single value. It
can be in either a column, row, rows or columns.
Array formula is a premium excel tool that works with series of data values
rather than a single value. It can return either single or multiple results. More
so, it allows performance of multiple calculations within a cell and can be
entered in a cell or range of cells. In order to input array formula into a select
cell, type the formula in the cell and Press CTRL+SHIFT+ENTER keys
together on your keyboard to tell excel that is an array. Excel will
automatically add curly braces around the formula to confirm it as an array.
Never type the curly braces by yourself because excel will not recognised it.
Creating and Using an Array Formula
Let's illustrate with the following, what we plan to do is to find the highest
among the profits made on the sale of selected motorcycles as appear in the
screenshot below
Ordinarily to calculate the highest profit, we need to create a column for profit
by subtracting cost price from selling price (selling price – cost price) and
then use MAX function to determine the highest profit like I have below
MAX function was used to determine the highest among the profits in column D
which is N8,000.
But all these long processes can be cut short with the help of an Array
Formula. Let’s use array formula on this same scenario.
=MAX (B2:B7-C2:C7)
This array expression (B2:B7-C2:C7) in above formula asked Excel to
determine the list of the profits without creating additional column by simply
subtract the cells range contain the Cost Price (C2:C7) from its counterpart that
contains Selling Price (B2:B7). The MAX function will be furnished with this
list of profit to return the highest Profit back to cell B11.
Having typed the above formula in a selected cell, one last thing to do before
exit the cell is to press CTRL+SHIFT+ENTER keys together on your
keyboard to indicate it is an array and Excel will automatically add curly
braces around the formula. In the absence of this #VALUE! Error will appear
which mean that you forgot to the keystroke to tell Excel to make an array
operation.
This same can be done for MIN, AVERAGE and SUM.
SUMPRODUCT function can be used to add the profits in an alternative to the
above example. The good thing about SUMPRODUCT is its ability to function
as an array formula without pressing the special keystroke,
CTRL+SHIFT+ENTER to inform the function to make the array operation.
SUMPRODUCT was explained in details in chapter seven.
Conditional Evaluation in an Array Formula
There may be need to perform operations like SUM or AVERAGE on selected
values that satisfied certain conditions with a data set. This will require Excel
to perform logical test (IF function) on the set of values to return TRUE as
answer where the conditions are met and rewarding the cell a 1 being it
numerical equivalent and 0 where otherwise that is FALSE. This same concept
was earlier explained under SUMPRODUCT in chapter seven. For example,
let’s use array formula to find the quantity of Yamaha Motorcycle sold by
Raymond in the data set below
We are going to make use of the Name Range skills learnt in chapter two to
make the formulas more readable. Cells range A2:A15 has been renamed to be
Motorcycle while we will be referring to cells range B2:B15 as Sales_Rep,
and the name of cells range C2:C15 will be Qty_sold. This can be strut out
easily with this array formula
E2 = SUM ((Qty_Sold) *(Motorcycle="Yamaha”) *(Sales_Rep="Raymond"))
Remember to press the CTRL+SHIFT+ENTER key.
The array formula asked Excel to lookup for Yamaha in the motorcycle and
matched it with RAYMOND in the Sales_Rep, then sum the corresponding
values in Qty_sold and returned the total value to cell E2.
Do you just say SUMIFS function can handle this? Yes! But array can still dig
further to extracts other information that SUMIFS cannot. For example, let’s
find the number of quantity sold IF the motorcycle is Honda OR Yamaha AND
the sales rep is Raymond OR Zainab.
This array formula will easily do that without stress
SUM ((Qty_Sold) *((Motorcycle="Honda") + (Motorcycle="Yamaha")) *
((Sales_Rep="Raymond")
+ (Sales_Rep="Zainab")))
Remember to press the CTRL+SHIFT+ENTER key before exit the cell holding
the formula.
The formula instructs Excel to lookup for Honda OR Yamaha in the motorcycle
and matched it with RAYMOND OR Zainab in the Sales_Rep, then sum the
corresponding values in Qty_sold and returned the total value to cell E2.
The good thing is that array formula also allow logical OR operation in
addition to AND operation to specify criteria, unlike SUMIFS and COUNTIFS
functions that are limited to only AND operation to specified criteria. Note that
excel will interpret multiplication sign * as AND and addition sign + as OR.
Chapter 11: Excel Math Functions
The OFFSET Function
OFFSET is very handy and tricky function in Excel. It returns a reference to a
range that is offset from starting cell or range of cells by specified number of
rows and columns. The reference to return can be a single cell or a range of
cells. It is very useful to create dynamic range for charts to make sure that
source data is always up to date.
Syntax: OFFSET (reference, rows, cols, [height], [width])
Reference: I do refer to this as starting point
Rows: this indicates the number of rows to move from starting point
Cols: number of columns to move from the starting point
Height: specified the height (in number) of the rows of the reference to
return
Width: the width of the columns of the return reference.
For example
OFFSET (B4, 4, 2)
This formula forced excel to pick cell B4 as starting point then move 4
rows down and 2 columns to the right as demonstrated below
The function will return which ever value in cell D8 back to cell A1 that
holds the formula. We can even go a bit further to use SUM function with
OFFSET function to add dynamic data. This formula will recalculate itself
to accommodate the new changes (added data). Let’s use this powerful
formula to add Total Amount in the earlier dataset.
=SUM (OFFSET (D4,,,COUNT(D4:D19)))
One of the benefits of OFFSET is its ability to automatically recalculate
whenever a source table gets updated. More so, it can be use with any other
functions that expects to receive a reference. Lastly, it will display #REF!
Error value if the OFFSET is outside the edge of worksheet.
Note: both rows and columns can be supplied as negative number to offset to
left and above respectively, that is to reverse their normal offset direction.
RAND and RANDBETWEEN
RAND () is used to generate random decimal number between 0 and 1 with
exclusion of 0 and 1.
RANDBETWEEN (bottom_number, top_number) very useful in generate
lots of number between specified bound.
INDIRECT Function
INDIRECT is used to create reference from text. More so, it returns reference
to a range.
Syntax:
= INDIRECT (ref_text [a1])
ref_text: a cell reference or text string that create the range reference.
a1: this is said to be TRUE if the reference is using A1 reference style
and FALSE if the reference style is R1C1. But we mostly go with
default (TRUE) to omit this argument.
The example below shown how I create a reference from number and text
using formula with INDIRECT function, number and a text string (the column
letter).
INDIRECT will concatenate letter “D” and number “2” to become D2 and
asked excel to return value in cell D2 to cell A1 that holds the formula.
Let’s move a step further and see how we can create a reference from cell
value and text in addition with INDIRECT function as it appear in the
screenshot below
What we do here is to force INDIRECT function to concatenate the text string
“D” (column letter) with the value in cell C1, this will give us D2 since 2 is
the value in cell C1 and return value in cell D2 back to cell A1 that hold the
formula.
We can as well trick excel to create a reference from text and
RANDBETWEEN function. I used this a lot to generate huge data for my Excel
training. The gimmick here is to force INDIRECT function to concatenate letter
“E” (column letter) with number randomly picked by RANDBETWEEN. We
knew how RANDBETWEEN function works from above section.
RANDBETWEEN will pick between 1 and 4 in this case.
INDIRECT return “Waheed” in cell E3 to cell A1 because RANDBETWEEN
picked number 3. You can be more creative than this. Try work around as what
to come out of.
ROUND, ROUNDUP, and ROUNDDOWN
ROUND: This round a number to a given digit.
Syntax: ROUND (number, num_digit)
See the example below
The scope behind the above illustration is that ROUND function asked excel to
convert the third digit at the right side of decimal number in cell B2 to 1 if it is
5 or above and add it to the digit that precede it. But neglects if it’s otherwise.
You will be wondering why third digit, yes! Because we are working toward 2
decimal place.
ROUNDUP: round a number up away from zero to a given number of digit
Syntax: ROUNDUP (number, num_digit)
ROUNDDOWN: this round a number down to a given digit mostly toward
zero.
Syntax: ROUNDDOWN (number, num_digit)
Here is a bit different, ROUNDDOWN function is not care about if the digit is
above or below 5. All it does is not drop the third digit.
CEILING and FLOOR
CEILING rounds number up to specified multiple while FLOOR in other
hand rounds number down to specified multiple.
Syntax: CEILING (number, multiple)
FLOOR (number, multiple)
CEILING is what will use while working with population since a human being
cannot be in fraction form. It round everything up to 1. As it appears in the
illustration it rounded .94 to 1 and we have 17168.
COUNT, COUNTBLANK and COUNTA
COUNT: this function count cells that contain numbers only. As appeared in
the screenshot below.
Syntax: COUNT (range)
COUNTBLANK is use to count the number of cells that are blank and return it
as result. The illustration in the below screenshot shows we only have 2 blank
cells.
Syntax: COUNTBLANK (range)
COUNTA in other word counts the number of cells that are not blank. It counts
both text and number. See the screenshot below
Syntax: COUNTA (range)
RANK, RANK.AVG, and BREAK DUPLICATE
RANK function is used to find the rank of a value in a list of number.
Syntax: RANK (number, ref, [order])
Number is value to rank
Ref: the list to compare the number to rank
Order: indicating whether ascending or descending.
The illustration below shown the performance of selected students in an exam
recently conducted. We are to rank base on their score in an ascending order.
=RANK (B3, $B$3: $B$10)
Rank function pick each score and compared it with rest scores to determine
its rank. But one limitation with RANK function is its inability to handle
duplicate (tie) values. All it does is to give the duplicates the same rank.
RANK.AVE was invented in Excel 2010 onward to address this limitation.
RANK.AVG
This function was invented to address the issue related to tie rank. The
screenshot below shown duplicate scores involved Idowu and Cosmos. You
can see that both assigned same rank of 7th and 8th rank is skipped.
Syntax: RANK.AVG (number, ref, [order])
What RANK.AVG does is to take the two position and find their average an
assigned the average as their new rank but fixed the limitation behind the
scene. Do I hear you saying while not 7th and 8th rather than 7.5th assigned to
the two? Relax as we will use Array formula to break the duplicate.
BREAK DUPLICATE
See the screenshot below for better clarifications. Since most of the break
duplicate cases use order to address limitations
=COUNTIF ($E$2:$E$9,">"&E2) +SUM (IF (E2=$E$2:E2, 1, 0))
Having key in the above formula into cell G2 as it appears in my case, yours
could be other cell. You must press CTRL+SHIFT+ENTER to add the curly
braces to indicate is an array formula. What the formula does is simply using
the COUNTIF to determine the number of values that are greater that value
being rank and SUM to count the occurrence duplicate (7) in the range
$E$2:E2. Yes, it seems one cell right, don’t worry as the range will increases
since I’ve locked $E$2 as you move down the column.
DATE, TODAY, DAY, MONTH, YEAR and DATEVALUE
TODAY function is used to show today’s date as it appears in the cell A2 in
above screenshot.
Syntax: = TODAY ()
DAY
One may decide to show only the day from the date in cell A2 as it appear in
cell B2, the function to applied is DAY function.
Syntax: = DAY (serial_number)
Serial_number is the date in which you want the day to be extracted.
For example, =DAY (A2). The cell A2 is holding our date.
MONTH
This function used to extract month from specific date.
Syntax = MONTH (serial_number).
As you can see how used MONTH (A2) to extract month in above illustration
will.
YEAR
This function is used to extract year and it follows the same trend. Just as we
use this formula YEAR (A2) in above example to extract year from the date in
cell A2
DATEVALUE
This Excel function converts a text representation of a date into serial number
that represents the date in Excel's date-time code. If the date_text supplied
cannot be recognised as a valid Excel date, #VALUE! Error will occur.
Syntax: DATEVALUE (data_text)
WORKDAY and WORKDAY.INTL
WORKDAY function returns a date of certain number of working days in the
past or future base on input. It helps to determine due date and delivery. It's
very important that date must be enter in conform with how excel handle date,
preferably (month/day/year). More so, Saturday and Sunday been considered
as weekend days by default.
Syntax:
=WORKDAY (start_date, days, [holidays])
The arguments detail:
Start_date: is the date that represents the start date and is required
Days: number on days that not either holiday or weekend and also
required
Holiday: indicates number of non-working day(s) that will not be
included in report and is optional
For instance, you started a project on Friday April 08, 2016 and to be
completed within 53 working days with Monday April 25, 2016 as public
Holiday. There was a directive from your boss to complete the project within
48 working days. WORKDAY function comes handy to calculate the new due
date
WORKDAY.INTL function is similar to WORKDAY function but more
flexible with introduction of weekend argument that will allow you to
customize which days of the week are considered weekend using weekend
codes.
Syntax:
=WORKDAY.INTL (start_date, days, [weekend], [holidays])
The arguments detail:
Start_date: is the date that represents the start date and is required
Days: number on days that not either holiday or weekend and also
required
Weekend: indicates non-working days of week popularly refer to
weekend. WORKDAY.INTL usually considered Saturday and Sunday as
weekend by default. However, with help of supplied code in this
function you can control which days are considered weekend
Code Weekend days
1
Saturday, Sunday
2
Sunday, Monday
3
Monday, Tuesday
4
Tuesday,
Wednesday
5
Wednesday,
Thursday
6
Thursday, Friday
7
Friday, Saturday
11
Sunday Only
12
Monday Only
13
Tuesday Only
14
Wednesday Only
15
Thursday Only
16
Friday Only
17
Saturday Only
Holiday: indicates number of non-working day(s) that will not be
included in the result and is optional.
See the example below
NETWORKDAYS and NETWORKDAYS.INTL
NETWORKDAYS function returns the total number of working days between
start_date and end_date.
Syntax: NETWORKDAYS (start_date, end_date, [holidays])
The arguments detail:
Start_date: is the date that represents the start date and is required
End_date: represents the end date and is required.
Holiday: indicates number of non-working day(s) that will not be
included in report and is optional
For example
NETWORKDAYS.INTL function is similar to NETWORKDAYS function but
more flexible with introduction of weekend argument that will allow you to use
parameter to determine which days of the week are considered weekend.
Syntax:
=NETWORKDAYS.INTL (start_date, end_date, [weekend], [holidays])
The arguments detail:
Start_date: is the date that represents the start date and is required
End_date: represents the end date and is required.
Weekend: indicates non-working days of week popularly refer to
weekend. NETWORKDAYS.INTL seen Saturday and Sunday as
weekend by default. However, with help of supplied code in this
function you can control which days are considered weekend
Code Weekend days
1
Saturday, Sunday
2
Sunday, Monday
3
Monday, Tuesday
4
Tuesday, Wednesday
5
Wednesday, Thursday
6
Thursday, Friday
7
Friday, Saturday
11
Sunday Only
12
Monday Only
13
Tuesday Only
14
Wednesday Only
15
Thursday Only
16
Friday Only
17
Saturday Only
Holidays: indicate number of non-working day(s) that will not be
included in the result and is optional. For example
Database Functions in Excel
This section is set aside to shed more light on database functions use in
Microsoft excel. Database is a detailed collection of data in such manner that
can easily be read(access), manage, updated, and delete. In other word, a
database can refer to as a list of related data in which rows of related
information are records, and columns of data are fields with the first row of the
list serve as labels for each column. The selected database functions to look in
to include DAVERAGE, DCOUNT, DCOUNTA, DGET, DMAX, DMIN,
DSUM, DPRODUCT, DSTDEV, DSTDEVP, DVAR, and DVARP. Their
syntax follows the same pattern
Syntax: key: - NAME (Database, field, criteria)
Database: This indicates the range of cells that makes up the list
or database. For example, the cells range (A2:E20) as it appears in
the screenshot below.
Field: this indicates the column used in the function, which can be
input using the column label enclosed between double quotation
marks, such as “Transaction No” "Product", “City”, “Unit Sold” or
a number (without quotation marks) that represents the position of the
column within the list. For example, Transaction No = 1, Product = 2,
and so on.
Criteria: this represents the range of cells that house the
conditions you specified. It could be any range as long as it includes
at least one column label and at least one cell below the column label
in which you specify a condition for the column. In this case, my
criteria cells range is (H4:L5) as it appears in the screenshot.
DAVERAGE
This database function calculates the average of selected list or database
entries based on specified criteria in excel.
syntax
=DAVERAGE (database, field, criteria)
Let’s demonstrate how this work using the above data set to the average
Amount of Vanilla Sold in the city of Lagos.
To solve this, we need to identify the given values,
Our database range is $A$2:$E$20
The field we intend to return is Amount Sold
The two criteria here is “Product” = Vanilla and “City” = Lagos.
Having created a range for our criteria from the above data set to be
H4:L5, all we need to do is to input our criteria. That is vanilla and
Lagos for product and city respectively as appear below.
=DAVERAGE ($A$2:$E$20,"Amount Sold”, H4:L5)
The above formula in cell I9 return N14,520 as the average amount of vanilla
sold in the city of Lagos. Let’s find the Average Unit of Tampico Sold in the
city of Lagos within the Transaction No that is above 44110. The key here is
Unit Sold because we intend to return Unit Sold not Amount Sold as it was in
previous example, kindly take note while keying this formula
=DAVERAGE ($A$2:$E$20,"Unit Sold”, H4:L5)
That gave us 48 as the average unit sold. So simple!
You can play around it to determine all sort of average that fall within the
available criteria.
DCOUNT
This is saddle with counting of cells that containing numbers from a specified
database that satisfied given criteria
syntax =DCOUNT (database, field, criteria)
Let’s use this function to determine from the above dataset, the number of
transaction(s) that involved Tampico where the unit sold is above 70 per
transaction. Kindly input all the criteria in the criteria cells range and input this
formula in cell I9
=DCOUNT ($A$2:$E$20,"Unit Sold”, H4:L5)
DCOUNTA
This is similar to COUNTA; it counts non blank cells from a specified
database that match supplied criteria
Syntax =DCOUNTA (database, field, criteria)
Let’s use this function to determine from the above dataset, the number of
transaction(s) that involved Tampico. Repeat the same process but with
different formula
=DCOUNTA ($A$2:$E$20,"Unit Sold”, H4:L5)
DGET
This extracts a single value that matches given criteria from a specified
database, and said to return #NUM Error value if more than one records meet
the set criteria.
Syntax =DGET (database, field, criteria)
Let’s use this function to return the number of Unit Sold for the Transaction No
44115. Repeat the same process with this formula
=DGET ($A$2:$E$20,"Unit Sold”, H4:L5)
DMAX
This function extracts maximum number in a column of a list or database that
matches given criteria
Syntax =DMAX (database, field, criteria)
We can use this function to return the highest number unit sold for certain
product known as Vanilla from the above data set. Repeat the same procedure
but with this formula
=DMAX ($A$2:$E$20,"Unit Sold”, H4:L5)
DMIN
Extracts minimum number in a column of a list or database that matches
specified conditions.
Syntax =DMIN (database, field, criteria)
Like we did with DMAX, we can as well determine the least number unit sold
for certain product known as Vanilla from the above data set. Using this
formula
=DMIN ($A$2:$E$20,"Unit Sold”, H4:L5)
DSUM
This adds the numbers in the field column of records in the database that
satisfied the specified condition.
Syntax =DSUM (database, field, criteria)
Let’s use this function to determine the total unit of a product called Vanilla
sold in the city of Lagos from the above data set. This returned 242 as the total
unit sold in Lagos, using this formula
=DSUM ($A$2:$E$20,"Unit Sold”, H4:L5)
DPRODUCT
This simply multiplies the values in a particular field of records that match the
given condition in a database.
Syntax = DPRODUCT (database, field, criteria)
For instance, let’s multiply units of all products sold in the city of Kano from
the above data set with the help of this function. Kindly repeat the same
procedure but with this formula
=DPRODUCT ($A$2:$E$20,"Unit Sold”, H4:L5)
This will return 5538 as the value generated from the multiplication of
products sold in Kano.
DSTDEV
This is a database function used to estimates the standard deviation of a
population based on a sample using numbers in a column of a list or database
that satisfied given criteria.
Syntax = DSTDEV (database, field, criteria)
DSTDEVP
This function is use to determine the standard deviation of a population based
on a sample using numbers in a column of a list or database that satisfied the
given condition.
Syntax = DSTDEVP (database, field, criteria)
DVAR
This function is use to determines the variance of a population based on a
sample by using the numbers in a column of a list or database that satisfied
certain condition.
Syntax =DVAR (database, field, criteria)
DVARP
The rationale behind this function is to determines the variance of a population
based on a sample by using the numbers in a column of a list or database that
match certain criteria.
syntax =DVARP (database, field, criteria)
Chapter 12: Excel Text Functions
Here are some functions that applicable to text in excel
LEN and TRIM Text Functions
LEN function is used to determine the length of a text. In short, it tells the
number of characters include space that made up a text.
Syntax: LEN (value)
The illustration shown the number of characters that made up “MUSA” is 4 as
indicated. In the second example, “MUSA MOMODU” supposed to be made
up of 10 characters but Excel will count the space in between.
TRIM function is very handy to trim off the unwanted spaces that are attached
before and after text in order to have exact match of the text.
Syntax: TRIM (text)
Let’s demonstrate this with an example below
I used cell B1 to find out the number of characters that made up value in cell
A1. Don’t be surprise it return 6, yes it was as a result of the space before
letter M and a space after letter A. remember LEN function includes any space
found to its counting. That is how TRIM came in handy to trim off the unwanted
spaces attached to our text. The formula in cell C2 asked Excel to trim the text
in cell A1 and then count the number of the text which gave us 4.
Using LEFT, MID and RIGHT for String Extraction
LEFT, MID and RIGTH functions are ideal tool tools to extract parts of text.
LEFT function is used to extract the leftmost characters, MID function is used
to extract selected characters within text, and RIGHT function is used to
extract rightmost characters of a text in Excel. Let’s demonstrate how these
functions work in the data set called Matric Numbers below
Our intention is to extract parts of those text in Matric Number column to their
respective columns which includes Entry Year, Departmental ID, and Student
Number column with help of LEFT, MID, and RIGHT function respectively.
LEFT function is used to extract the leftmost characters in Excel.
Syntax: LEFT (text, [num_chars])
Text: the text to extract from. In this case the text is in cell
A8
Num_chars: Number of character to extract from left. Here
we need the first two characters.
The formula in cell B8 will be =LEFT(A8,2)
MID function is used to extract selected characters within text in Excel.
Syntax:
MID (text, start_num, num_chars)
Text: the text to extract from. In this case the text is in cell A8
Start_num: number to start the extraction. In this case is 6
Num_chars: Number of character to extract. Here we need the next
two characters. The formula in cell C8 will be
=MID(A8,6,2)
RIGHT function is used to extract rightmost characters of a text in Excel
Syntax:
RIGHT (text, [num_chars])
Text: the text to extract from. In this case the text is in cell
A8
Num_chars: Number of characters to extract from right. Here
we need the three last characters. The formula in cell D8
will be
=RIGHT(A8,3)
That is how to extracts part of text in Excel.
Use Extracting functions with SEARCH
Search function can be combine sometimes to handle advance extractions
where there is no uniform number of characters to extract from text. For
instance, to extract staff name in the below data set may not be easy as we
think. But with SEARCH function it becomes simpler.
What we need to do here is to use SEARCH function with this formula
=SEARCH("-”, A26) to find the location of the separator “-“, which will give
us the location number 5 then subtract 1 from it to determine the length of the
Staff Name.
=SEARCH("-”, A26)-1
we can now deploy the LEFT function to extract the leftmost with the length
determined by SEARCH function above.
The formula in cell B26 will be this
=LEFT(A26, SEARCH ("-”, A26)-1)
Copy the formula down to fill the remaining cells in column B.
Repeat the same process for MID function but add 1 to search function since
the mid extraction will start immediately after the first hyphen (-) then
specified the length of the mid extraction which is 4 in this case. The formula
in cell C26 will be this:
=MID (A26, SEARCH("-”, A26) +1,4)
Copy the formula down to fill the remaining cells in column C.
The rightmost extraction will follow the same approach will earlier deploy
since the number of characters to extract is the same. Copy the formula down to
fill the remaining cells in column D.
Joining Data with CONCATENATE or AMPERSAND “&”
CONCATENATE
This function allows us to join data Strings from Multiple Cells.
Syntax: CONCATENATE (text1, [text2], [text3] …)
See the illustration below
You can see that both FirstName and LastName were join together without any
space. It makes no sense at all. So I need to add space in between the names.
See how I fixed that in the screenshot below. You will notice is very simple.
Ampersand
We can as well used ampersand sign “&” to concatenate strings together. See
how that is been done below
Changing the Case of Text in Cells (UPPER, LOWER and PROPER)
UPPER function changes cell entry to CAPITAL LETTERS
Syntax: = UPPER (text)
LOWER function changes cell entry to small letters
Syntax: =LOWER (text)
PROPER function changes the first letter of every text in cell entry to Capital
Syntax: = PROPER (text)
FIND, REPLACE, SUBSTITUTE, and REPT
FIND function in Excel return the position of a particular substring within a
string. Note that search is always case-sensitive. FIND function will return a
#VALUE! Error if it doesn’t find a match.
Syntax: = FIND (find_text, within_text, [start_num])
Find_text: The substring that you want to find.
Within_text: the string to search within.
Start_num: this specifies the position where search will start.
The FIND function asked Excel to look for the position of “r” in the entry in
cell A1 “Microsoft” and start the search from position 1.
REPLACE
This function replaces a sequence of characters in a text with another
Syntax:
= REPLACE (old_text, start_num, num_chars, new_text)
Old_text is the original value
Start_num is where the replace will start
Num_chars indicates the number of characters to replace
New_text is the text to substitute the old
This function asked Excel to go to position 2 in the original text and count
additional 2 to make it 3 characters “omo” then replace with “xyz”.
SUBSTITUTE function replaces a set of characters with another
Syntax:
= SUBSTITUTE (text, old_text, new_text, [instance_num])
text the main string to use for the substitution
old_text is the existing character to replace
new_text is the character that will replace the old text
Instance_num specifies the number of appearance of old text you want
to replace. This argument is optional
REPT returns a repeated text based on the number of time specified
Syntax: = REPT (text, number)
text is value to repeat
number is amount of time to repeat the text
REPT function asked excel to repeat “m” in 10times.
Chapter 13: IS Functions
ISNUMBER, ISEVEN, ISODD
ISNUMBER function is used to test if a value is a number and return TRUE
and FALSE if it is otherwise that is not a numeric.
Syntax: = ISNUMBER (value)
This example tests the value in cell A1 to be numeric and returned TRUE as
the answer in cell B1 while returned FALSE in cell B2 because the value in
cell A2 is non numeric.
ISEVEN function test if a numerical value is an even number and return TRUE
if it is an even number or FALSE if the value is not even number. Even
numbers are the numerical values that are divisible by 2 without remainder.
Syntax: ISEVEN (value)
ISODD function return logical TRUE if a numerical value been tested is ODD
and FALSE if otherwise.
Syntax: ISODD (value)
ISTEXT and ISBLANK
ISTEXT function is used to check if value is TEXT, then return logical TRUE
if the condition is satisfied and FALSE if it is not Text.
Syntax: ISTEXT (value)
The above illustration confirmed the value in cell A2 to be text and return
TRUE as the answer, while cell B1 returned FALSE since the value in cell A1
is not a text value.
ISBLANK function return logical TRUE if a cell under test is empty and
FALSE if is not empty.
Syntax: ISBLANK (value)
ISFORMULA, ISLOGICAL
ISFORMULA function test if a value in the cell is formula and return TRUE
and FALSE if it’s otherwise.
Syntax: ISFORMULA (reference)
Let’s illustrate this with example below. The screenshot shown the addition of
the first and second value. That is cell A1+B1, but no formula was input in cell
C2.
I want Excel to test if any of the cells in holding formula and return logical
TRUE and FALSE if otherwise. See how to go about it
This indicates that value in cell C2 is formula while that in cell C3 is not.
ISLOGICAL function test if a value is logical and return TRUE or FALSE if
otherwise
Syntax: ISLOGICAL (value)
Error Checking with ISERR, ISERROR, ISNA
Error Checking with ISERR
This function is used to test for any error except #N/A Error and return logical
TRUE or FALSE if otherwise. The errors include #NUM! #NAME?, #NULL!,
#DIV/0!, #REF!, and #VALUE! To mention few. #N/A error occurs when a
value is not available to function or formula. This type of error is very
common in VLOOKUP function.
Syntax: ISERR (value)
ISNA cannot recognises #N/A to be an error that is why it returned false. To fix
the particular case ISERROR is the right function for that.
Error Checking with ISERROR
This function test for all forms of errors include #N/A and return Logical
TRUE if it found or FALSE if otherwise.
Syntax: ISERROR (value)
Let’s make this more dynamic with the help of IF function to display YES if
there is error and NO if otherwise.
This function tests all forms of errors without exception and returns logical
TRUE if found any, and FALSE if otherwise.
Error Checking with ISNA
THIS FUNCTION test the result of the formula for error (#N/A) and return
logical TRUE if exist or FALSE if otherwise
Syntax: ISNA (value)
This function only recognised #N/A as the only error. As it appear in the
screenshot above clearly show how ISNA handle errors.
Chapter 14: Sparklines
Sparklines is mini chart place in a single cells and very useful to show data
trends. It can either be in form of line, column, and win/loss sparklines. While
Line Sparkline representing row of data in a line format, Column Sparkline
representing row of data with bar in form of bar chart format, and Win / Loss
Sparkline representing row of data in bar chart format with preference to
positive (in blue) and negative (red) value. Sparklines is located in Insert
Menu.
Create a Sparklines in Excel
This is very simple task in Excel. All you need to do is to
1. Highlight the row contains the values
2. Go to Insert Menu
3. Select the type of sparklines you want in sparklines group. Let’s create a
line sparklines to shown the growth trend of 85Metrics Excel Training
Penetration below.
Highlight the growth row go to Insert Menu
Sparklines group and
select Line sparklines.
Create Sparklines dialog box will appear for you to choose where the
Sparklines to be placed and ensure the data range is completely captured
Click Ok to accept the setting. Below is how the output will look like.
The same process can be done for other types as well. Good luck as you
work around to see the effects.
Change the Design of Sparklines
Sparklines lines design can be change to suite your choice. To do that click on
the cell that houses the sparklines to activate Sparkline Tools
do the
necessary changes on design tab. The changes may include style, color, maker
color, and maker to mention a few.
Removing Sparklines from a Sheet
Sparklines can be removed from a worksheet when is no longer useful. Rightclick the Sparkline to delete, click on Sparklines from the popup options, and
Choose “Clear Selected Sparklines” to remove the sparklines.
Chapter 15: Scenario Manager, Goal Seek,
and Solver
Scenario Manager and its Application
The process of trying out different value with formula to see how the changes
will affect the outcome is known as What-If Analysis. Scenario Manager in
other hand, is one of the tools used to create and save multiple assumptions
"what-If" Scenario in Microsoft Excel. What-If Analysis tools are located in
the Data Menu.
ZHM resources is one of our clients that is into Shoes making business,
conceived an idea to produce 3,000 pieces of highly demanded shoes in Kano,
Nigeria at production price of N1,400 per shoe. Based on their findings, the
company is convinced to make up to 95% sales of the production at a selling
price of N3,000 per shoe. The screenshot below shown all their analysis with
formulas which include cost of production, expenses, revenue, and gross profit
expected.
But still engage our services to furnished more scenarios to cover every
situation that may arise. Here comes in the scenario manager to strut the stuff.
Setting up Scenario and Entering Values to carry out What-If-Analysis
1. Go to Data menu, click on What-If-Analysis in that data group to select
Scenario Manager. The Scenario Manager dialog box will appear.
2. Click on Add button to input scenario name, select cells to change, then
click Ok. Our first scenario name is Excellent as shown in the table
below
The cells to be changing are cell B10 and B11 that hold percentage of quantity
sold and amount per shoe respectively.
3. Enter corresponding values. In this case we are going to input percentage
of quantity sold and amount per shoe and then Click ok again
4. Repeat the process to Add other scenarios
Getting a summary of all Scenarios
Having added all the scenarios, click on summary button and select the Result
Cells. In this case our result cell is cell B21 that contains the gross profit.
Click Ok to get the scenario summary of all scenarios like I have below
Good! I can now give this to ZHM Resource to take a look at the scenarios and
see how they can align their operation towards this. There are more to it but
hope you get the concept?
Goal Seek
This is another amazing "What-if" analysis tool used to generate the best input
for a formula you already known the result but not sure of the exact input. The
limitation here is that it only work with one variable input. Solver is an ideal
tool in case you want more than one variable input. Goal seek can be access
under What-If Analysis in Data Menu.
Using Goal Seek to carry out What –If-Analysis
Let’s demonstrate how this work with the data set below from XYZ Company’s
available stock. The company specialized in the sale of four different brands of
motorcycles (Bajaj Boxer, Haojue, Honda, & Yamaha).
Yamaha sales that has not been encouraged for the past 8months suddenly
started experiencing high demand. In view of this the management decided to
take the advantage of the season to make more sale on Yamaha to increase their
revenue to N19,800,000 from initial income of N16,370,000. Goal seek is
very handy to figure out the number of Yamaha required in the store to generate
the said revenue.
The following process will lead us to the solution
Go to Data Menu, select What-If Analysis, and click on Goal seek
Select cell D6 as the cell to set
Type N19,800,000 in to value field
Select the By changing cell field and choose cell C5
Click Ok to get the result below
This result shown the number of Yamaha Motorcycle will be increase to 65
pieces in order to generate the set out revenue of N19,800,000.
SOLVER
Solver is one of the premium Excel tools that comes handy while setting goals
with set of constraints to arrive at the best solution. It accepts more than one
input unlike goal seek that work with on variable input. Solver function can be
found in Analysis group under Data Menu but needed to be first activate since
is not appear by default.
Activating Solver Add In
1. Go to File and click on Option to invoke Excel option dialog box
2. Click on the Add-in to manage Add-in
3. select Solver Add-in
4. Ensure Excel Add-in is selected from the list of drop-down at bottom
left of the dialog box
5. Click on Go
6. An Add-ins dialog box will appear. Click on the small box beside the
Solver add-in to select it, then Click Ok to return to Excel option dialog
box
7. Click Ok to accept the setting.
Solver the amazing tool is now activated and can be access under Analysis
group in Data Menu
Using SOLVER to Carry out What if Analysis
This can be demonstrated with a case of one of our clients. XYZ Motorcycle
budgeted the sum of N 5,000,000 naira to start a motorcycle business based on
the following constraints:
8. Planning to start with 4 brands of Motorcycles (Bajaj Boxer, Haojue,
Honda, Yamaha)
At least 3 pieces of every Brand
Bajaj Boxer must be twice of Haojue
Haojue must not less than 5 pieces
Yamaha will be less or equal to three-quarter (3/4) of
Haojue
Honda will be the 5/3 of Yamaha
The objective is to determine the number of motorcycles per brand that the
company can buy with N 5,000,000 with the following unit cost for a start.
Bajaj Boxer N125,000
Haojue
N 123,000
Honda
N 117,000
Yamaha N 98,000
Let’s put all these into Excel and see how Solver will strut the stuff easily for
us.
In view of our goal to determine the total quantity of selected motorcycle we
can buy with N 5,000,000, the value in Cell C8 will be our output (goal) by
changing values in cells range C4:C7 (Inputs). A step was taking further to
calculate the Total cost per brand in column D with the Grand Total in cell D8
which must less or equal to budgeted amount in cell E1. Lastly, all input must
be an integer.
We can now apply solver to figure it out.
1. Go to Data Menu and click on Solver in Analysis group to invoke Solver
Parameter dialog box.
2. Set Objective field to cell C8 and choose maximum
3. Set “By Changing Variable Cells” field to cells range C4:C7
Add constraints into Solver problem
4. Click on Add button to add various constraints, Add Constraint dialog
will appear as shown below and repeat the process to add other
constraints
5. Select SIMPLEX LP as the Solving Method
Note that all inputs are set to be an integer in one of the constraints since
motorcycle cannot be in decimal number.
6. Click on Solve.
7. Solver Result dialog will appear like the one I have below. Select the
Keep Solver Solution to go with this solution
8. Click on Ok to have this result below.
Good! The above result clearly shown that our client can conveniently buy 41
pieces of different brand of motorcycles with N 4,982,000 as indicate as
follows: 22 pieces of Bajaj Boxer,11 pieces of Haojue, 5 pieces of Honda, and
3 pieces of Yamaha.
Chapter 16: PivotTable, Slicer, and Timeline
tool In Excel
PivotTable
PivotTable is an essential Excel tool used to explore and analyse huge data set
in order to generate an interactive and user friendly summary reports. Its
ability to automatically group, sort and filter different subset of data, and
ensure data are summarized by categories and subcategories are its cool
features that stand it out among excel tools. More so, pivot table allows
changes to be made to structure of summary table by dragging and dropping the
source table column as well switch rows and columns. It makes provision to
drill down to see the detail behind every operation by simply collapse or
expand the level.
Organize your source data
This is very essential before creating a PivotTable, source data need to be
organise into rows and columns, and then convert the cells range into Excel
table to make our data more dynamic. This was earlier explained under data
formatting as table in chapter 3. To do this for the purpose of recap, select any
cell in the data set, go to INSERT MENU and click on Table in table group or
Press CTRL+T to convert the range to Table.
Create a PivotTable
The following steps will guide us to the creation of a PivotTable.
Select any cell within the source data, go to Insert Menu, and click on
PivotTable in table group
A create PivotTable dialog box will appear, ensure the correct table or
cells range is highlighted in the table/Range field. Then choose the location
you want the PivotTable to be placed.
Select New Worksheet to place the PivotTable in a new worksheet, or
selecting the existing worksheet to place the PivotTable at a specified
location in an existing worksheet. I will go with default to have my
PivotTable on New Worksheet.
Click ok to create a blank PivotTable in the specified location like what
appear in the screenshot below
Arrange / Rearrange Fields in a PivotTable
This can be done on the PivotTable fields list located at right-hand side of the
worksheet. It’s made up of field section and layout section as it appears in the
screenshot below.
Field section is where you can find the name of the field that can be add
to PivotTable since is correspond to the column names of our source
data. Select the checkbox next to the field name in the field section to
add it to the layout section. By default, non-numerical field are added to
Rows area, numerical fields are added to Values area, and time or date
are added to Columns area.
Layout section at the other hand contains the Filter area, Columns area,
Rows area and Values areas. Click on any field name of your choice and
drag it to where you want it to be in the layout if you don’t want to go
with default.
The good part of it, is that any change made on the PivotTable Field
immediately reflect to your PivotTable.
If check my layout section, you will notice those fields appear as I choose. I
place motorcycle on Filter area to filter data source based on selected
Motorcycle Products, with other criteria that include Sale Rep placed in Rows
areas, to generate sum of sales in values area within the Selected Period in
Columns areas.
Show Different Calculations in PivotTable
This facilitates how to change or applied different functions on our data item in
PivotTable. To do this is very simple, go to layout section of the PivotTable
field, click on the field you intend to change its math operation in the Values
Area, and select Value Field Settings from the popup.
Value Field settings dialog box will appear. This dialog box is like one-stopshopping to various functions in PivotTable.
Summarize Values By
There are 11 options of functions in this tab to perform various calculations
which include Sum, Average, Count, Max, Min, Count Number, Product, Stdev,
Stdevp, Var and Varp.
To make use of these functions
1. Right click on any of the values cell in the PivotTable and select value
field settings from the popup menu
2. Click on the SUMMARIZE VALUES BY tab and select the function you
want to perform on the values. Let’s take MAX for instance
3. Give it a descriptive name in the custom name field
4. Click Ok on value field settings to effect the changes
SHOW VALUES AS
This tab furnishes us with 15 different custom built-in calculations options to
display our reports such as % of Grand Total, % of Row Total, % of Column
Total, % Of, % of Parent, % of Parent Row Total, % of Parent Column
Total, Difference From, % of Difference From, Running Total In, %
Running Total In, Rank, Index. You can as well customize field name in the
custom Name field.
To apply these functions on our PivotTable reports
1. Right click on any of the values cell in the PivotTable and select value
field settings from the popup menu
2. Click on the SHOW VALUES AS tab and select the option you want to
perform on the values. Let’s select % of Grand Total for example.
3. Give it a descriptive name in the custom name field
4. Click Ok on value field settings to effect the changes.
Format PivotTable Numbers
One of the way to format numbers in PivotTable can be done in the Value Field
Setting dialogue box. Click on the Number Format button at the bottom-left part
of the dialog box. Or Right-click on any number in the Value areas of
PivotTable to bring out scaled down format cell dialog box as shown below.
Pick the necessary numeric format for the values and click Ok to effect the
change.
All other operations such as Refresh, Sort, and many more can be performing
by simply right-click on the PivotTable and choose the respective function
from the popup options.
Applying Pivot Table Styles
This is allowing us to change the style of our report to one of the available
eighty-five (85) built-in PivotTable styles to make it more readable and visual
appealing. To do this: Click any cell on the PivotTable report, go to
PIVOTTABLE TOOLS, and click on design. Choose any style of your choice
in PivotTable Styles as shown in this screenshot.
Disabling and Enabling Grand Totals
Grand total, as its name implies is the sum of all the values in the fields in a
report. There may be need to get rid of grand total from both rows and columns
or either of the two. To do this is very simple. Click a cell in the PivotTable
report, go to PIVOTTABLE TOOLS, select Grand Totals under DESIGN tab
and choose one of the popup options which include: OFF for Rows and
Columns, ON for Rows and Columns, ON for Rows Only, and On for Columns
Only.
Applying Report Layout
It is essential to make our report layout more visual appealing. This can be
done by click on a cell within the active PivotTable, go to PivotTable tools,
Report Layout under Design tab, and select any of the popup options that
include Show in Compact, Outline form, Tabular form, Repeat All Item label,
and Do Not Repeat item labels.
I will select Show in Tabular Form option to get what appear in screenshot
below
Making Use of the Report Filter Option
With the help of Filters on the layout section we can easily sieve the
PivotTable in order to extract specific information. All you need to do is to
drag any field you wish to anchor the filtering and drop it in FILTERS area like
I have motorcycle in my own example below.
Report Filter will immediately appear on the top of your PivotTable to select
any criteria from the drop-down to sieve the data.
You can select single or multiple criteria from the popup and click Ok
How to Refresh a PivotTable?
PivotTable needs to be refresh to get all data updated because Excel doesn’t
refresh it automatically. In view of this PivotTable can be refresh manually or
automatically when opening the workbook.
To refresh PivotTable manually. Click on the PivotTable, go to
ANALYZE under PIVOTTABLE TOOL, and Click on Refresh
button, or press ALT+F5.
You can as well Right-click on the table and select refresh.
To refresh PivotTable automatically when the workbook is open.
Click on any cell in the PivotTable, go to ANALYZE under
PIVOTTABLE TOOL, click on option to invoke PivotTable option
dialog box, select Data tab and click on checkbox beside
REFRESH DATA WHEN OPENING THE FILE.
Then click ok
Grouping
Grouping is essential in generating clear report and there might be need to base
our report on certain range of Numbers, period, and custom group. Therefore,
value can be group to a chosen class interval while date can be group into
days, week, month, and years to enhance the generation of a robust summary
report in PivotTable. Let’s demonstrate how grouping is being done on data set
below
First Insert PivotTable for the data set and drag the number field to Row
Labels
Click on the PivotTable to select it Go to Analyze in PivotTable Tools Group
and select GROUP FIELD to invoke Grouping dialog box. Do the necessary
adjustment and click ok button to effect the change.
Since the numbers in question fall in between 1 and 20. I want to change the
“Starting At” and “Ending At” to 1 and 20 respectively, then change “By” field
to 5.
Having changed the settings, click Ok button to get what appear in the
screenshot below
Wow Very simple! Same process can be repeat for Date.
Moving a Pivot Table
There may be a need to move your pivot table to a new worksheet, workbook
and any other area within the current sheet. This can be achieved under
Analyse tab in Excel 2013. Click on PivotTable report, go to Analyser tab, and
click on MOVE PIVOTTABLE. Move PivotTable dialog will appear, choose
your targeted location to place the PivotTable and click Ok.
Removing a Pivot Table
When your PivotTable is no longer needed and you want to get rid of it. The
following are the steps to follow to get it done, provided your PivotTable is on
the same page with other data. Go to ANALYZE, click on Select Then Entire
PivotTable, and hit delete key on your keyboard.
But if the PivotTable is on separate worksheet, simply delete the sheet.
The Slicer Tool
Slicer is an Excel tool that allows quick and easy filtering of PivotTable. It
makes it possible to connect and control more PivotTables with a single click.
Let’s demonstrate how slicers work on the current PivotTable. Click on
PivotTable, go to ANALYZE under PIVOTTABLE in Excel 2013, click on
Insert Slicer in Filter group.
Select from the available list of fields in Insert Slicer dialog box. In this case I
will select Motorcycle from my available options. You can select as many as
you want.
Then click Ok to accept the setting. Something that look like the one below
appears
Good! The slicer shown all the motorcycle brands. I can go further to select a
brand. Let me select Jicheng to see what I will get.
Nice it does exactly what I want. You can play around to see the wonder of
slicer tool.
The Timeline
Timeline is very handy in filtering time in PivotTable, Table, and PivotChart.
Let’s see how timeline will work on the PivotTable. The key thing here is that
you must have a field formatted with date.
To add timeline to a report
Click on a cell in PivotTable and go to ANALYZE under PIVOTTABLE in
Excel 2013
Click on Insert Timeline in Filter group and tick the date, then click Ok
button to accept the settings
Something that look like the one below will appears
Wow! Now I can select the period I want to filter on the PivotTable report
using the timeline. The good thing is that you can select more period at a go but
in sequential order. Let’s select 3 months (March, April, and May) in this
report.
You can even switch the period on the timeline from Month to either Day,
Quarter, or Year. Click on the arrow beside the month or what you have to
switch.
Chapter 17: Pivot Charts in Excel
Pivot chart is an Excel tool used to visualize the numeric data generated via
PivotTable. It produced effective reports that are readable and summarily
convey the necessary messages that will informed best decisions. PivotChart
has its own set of rules that are different from conventional charts earlier
discussed in chapter 5. Pivot chart can be access in Insert Menu in excel 2013.
Creating a Pivot Chart
To insert a pivot chart,
1. Click on anywhere in the Data Source
2. Go to Insert Menu and select PivotChart in Charts Group
3. Drop down menu will appear for you to select from popup option to either
insert PivotChart or insert PivotChart & PivotTable.
4. Create PivotChart dialog box will appear. Ensure the right Data source
range is highlighted in the table/Range field.
5. Then choose the location you want the PivotChart to be located. Select
New Worksheet to place the PivotChart in a new worksheet, or selecting
the existing worksheet to place the PivotChart at a specified location in an
existing worksheet. I will go with default to have my PivotChart on New
Worksheet.
6. Click Ok to create a blank PivotTable and PivotChart in the specified
location like what appear in the screenshot below
7. Go to PivotChart fields to populate the layout section that contains Filters,
Legend (series), Axis (categories), and Values Areas from the available
field on the field section. As shown below from my own example.
The good part of it, is that any change made on the PivotChart Field
immediately reflect on both PivotTable and PivotChart.
We have successfully created a PivotChart.
Changing Chart Types Formats and Layouts
Sometimes you might decide to change your chart type and its layout in order to
make your PivotChart more visual appealing.
To change PivotChart layout.
1. Click on the PivotChart
2. Click on DESIGN tab under PivotChart Tool
3. Click on Change Chart Type to change it.
To change layout and other styles
1. Click on the PivotChart
2. Go and click on Format tab under PivotChart Tool and
3. Do the necessary format you want such as choosing the border color,
background, shape effect, and bar color.
Filtering a Pivot Chart
Filters on the layout section can be used to extract specific information from
the PivotChart. All you need to do is to drag any field you wish to anchor the
filtering and drop it in FILTERS area like I have motorcycle in my own
example below.
The filter tool will automatically appear on the chart area as shown below. In
this case, Motorcycle is the field using for filtering.
Click on the arrow besides the filter to select the brand you intend to filter
from the drop down list and click Ok.
Hiding Pivot Chart Field Buttons
To hide chart elements on the PivotChart is very simple. Right-click on any of
the chart elements and select the Hide All Fields Button on the Chart to hide all
the elements or hide the axis Field button on Chart to hide axis elements only.
Moving a Pivot Chart between Sheets
There might be need to relocate our PivotChart to new position sometimes. In
order to move the chart, Right-click on the chart area and select the Move
Chart from the popup options.
Or go to DESIGN TAB in PIVOTCHART TOOL and click on Move Chart
Location
Move Chart dialog box will appear for you to select your targeted location
Select the New sheet to move the chart to fresh sheet. You can even rename the
New Sheet in the field beside the new sheet. Select Object in to place it on the
current sheet. But sometime I do right-click the chart area and select Cut from
the popup option then go to where I want it to be place and paste it there.
Deleting a Pivot Chart (With Care)
When the PivotChart is no longer needed and you intend to get rid of it. Click
on the chart area of the PivotChart to ensure the entire chart is selected then hit
the delete button on your keyboard.
Chapter 18: CORRELATION and
REGRESSION ANALYSIS
These are Excel premium statistical tools used to determine the relationship
between variables while carrying out data analysis. These can be found in
Analysis group in Data Menu but need to be enable first since it doesn’t appear
by default.
Activating Analysis ToolPak Add In
1. Go to File and click on Options
2. Click on Add-Ins, select Analysis Toolpak, Excel add-ins and click Go
button
3. Enable Analysis ToolPak and click Ok
Data Analysis tool is now accessible under Data Menu
CORRELATION COEFFICIENT
This is the statistical tool used to determine the degree at which adjustment
made to certain set of measurement affects the other set of measurement. For
instance, correlation coefficient is an ideal tool to measure the success or
failure of business strategies deployed or to determine the effect of advert
recently carried out on a selected product in your organization. The correlation
coefficient value ranged between -1 and +1. The value of -1 indicates a perfect
negative correlation suggest that one of the variable increases while other will
decreases (exactly opposite). The +1 indicates perfect positive correlation
between two variables suggest both variables move perfectly positive together,
and 0 indicates no correlation exist between the variables. Let’s find out if
there is correlation between the following data sets
The following steps will serve as guide
1. Go to Data Menu and click on Data Analysis in Analysis Group
2. Choose Regression and click Ok to invoke correlation dialog box
3.
4.
5.
6.
Select the input range (B2:C9)
Choose the group by option, in this case mine is in columns B and C
Check the labels in first row box
Pick the output options. I want my report on the same week and start in
cell H2
7. Click ok to generate the report
With coefficient correlation of 0.91 (approximately 1) indicates perfect
positive correlation between Number of Like and Advert charge. This suggest
both variables move perfectly positive together as it shown in the chart below.
REGRESSION ANALYSIS
Regression analysis is one of the most powerful statistical techniques use to
establishes the relationship between dependent variable and series of other
independent variables. The trick here is its ability to predict actual outcome
(dependable variable called Y) from independent variable X (Linear
Regression) or more than two independent variables (Multiple Regression). It
can also be deploying for forecasting and optimization in business. Below is
the formula for simple regression.
Y = C +bX
Y = the variable to predict
X = the variable to use for the prediction
C = intercept
Let’s demonstrate how this work with data generate from number of like on our
Facebook page for certain weeks as it appears in the data sets below to see if
there is a relation between NUMBER OF LIKE(output) and ADVERT
CHARGE (input). Also see if we can predict number of like in weeks to come
having the idea of the amount to pay for advert.
The following steps will serve as guide
1.
2.
3.
4.
Go to Data Menu
Click on Data Analysis in Analysis Group
Choose Regression
Click Ok to invoke regression dialog box
5.
6.
7.
8.
Select the dependent range Y (B2:B9). This output we want to predict.
Select the independent range X (C2:C9).
Check the checkbox beside the labels.
Select the Output option to place the result on the same sheet or go with
default to place the result on new worksheet.
9. Click Ok to invoke the summary Output
The summary Output like the screenshot below appears
Now we can interpret the above result under important headings:
R Square
R Square is 0.843 indicates our model is in good fit that is - the closer to 1 the
better. R Square of 0.843 means that 84% of the variation in NUMBER OF
LIKE can be explained by ADVERT CHARGE. Another good thing here is
Multiple R is the same thing as the coefficient correlation.
Significance F and P-Values
These help us to determine the relevance of our result. A result is said to be
relevant if the value of P and significance F are lesser than 0.005. With
significance F value (0.003) and P-values (0.002, 0.003) show our result is
relevant
Coefficients
With the coefficients values of 698.156 and 0.711 for Intercept and Advert
Charge respectively, the regression line will be:
Y = 698.156 + 0.711 *X
Number of Like = 698.156 + 0.711 *[Advert Charge]
The above regression line indicates that I can still end up with 699 like on my
Facebook page if I decided not to pay any advert charge. This can be used to
predict possible “Number of Facebook like (Y)” given the certain advert
charge (X). We are considering to spend ₦ 3,500, ₦ 4,000, and ₦ 5,000 on
the advert for the next three weeks in that order to increase our LIKE on the
Facebook page. This formula will be handy to predict the numbers of new
LIKE as shown below.with ₦ 3,500 we are going to get addition 3,188
Facebook LIKE on our page, ₦ 4,000 will give us 3,543 LIKE, we expect
₦ 5,000 to give us 4,255 LIKE, and so on.
Y =698.156 + 0.711 * X
All you need to do is to plug any amount for “X” in the above formula to get
the predict output.
Chapter 19: Macros in Excel
What is a Macro?
Macro is an act of automating repetitive operation or task you perform
frequently to save more time in Excel by creating a custom command that could
be execute with a single command of either a button-click or keystroke. Macro
is so simple contrary to people’s perception that is very difficult. All that is
require is to do few adjustments to our Microsoft Excel settings to add the
Developer Tab to the ribbon and start recording macro in a similar way we
record live events but doesn’t require a camera.
Activating Developer Tab
The following steps will guide us to do the few settings
1. Go to File and click on Options or Press ALT+FT
2. Click on Customize Ribbon and check the box beside Developer under
main tab to select it, then click ok to accept the settings.
DEVELOPER tab will automatically appear at the menu bar.
One good thing again is that you can find Record Marco button on the Excel
2013 status bar.
Creating Storing and Running your First Macro
Turn on the macro recorder to record macro by either clicking on macro
recorder on the active Excel status bar or go to Developer tab then click on
Record Macro from the options. All actions been performed on the worksheet
will be recorded by macro recorder and stored them sometimes as part of the
current workbook or in personal macro workbook popularly referred to as
PERSONAL.XLSB. Store macro in “personal macro workbook” make it
available to all Excel files while on “current workbook” restrict the macro to
the active workbook. Having recorded macro, you can run it by go to
Developer tab and click on macro to open macro dialog box, then click on the
name of the macro you want to run and click on Run button.
Invoke Macro with Keyboard Shortcut
Better still you can use the assigned keystroke if any, by press SHIFT+CTRL
or only CTRL plus any letter key earlier assigned.
Let’s demonstrate how macro work with the following example. The task here
is to format the data set generated by an organisation on monthly basis to make
it visual appealing and reduce time spent. Here I have report for three months
range from January to March on a separate sheet.
The following steps will serve as a guide to carry out the task.
1. Go to Developer Tab and click on record macro or on macro recording
icon on Excel task bar. Record macro dialog box will appear, fill the
following as it appeared in the snapshot below macro name, shortcut
letter, select “this workbook” type in any description of your choice, and
click Ok button
2. Highlight the first data set, do necessary format like I had in the snapshot
below, and click on stop recording to halt the recording.
3. Let’s run the macro on the second data set in second sheet called
February to see how effective it will. highlight the entire second data set,
go to Developer tab, click on macro to open macro dialog box, then click
on “Format_data” from the list of macro to select and click on Run
button. Or use the assigned keystroke by press CTRL+k.
You will get this result, which shown it works because we set the macro
to work in this workbook.
Using Form Button to Invoke Macro
You can decide to go a bit further to assign button to macro in order to run
macro using button-click instead of keystroke or through developer tab.
1. Switch to third sheet (March) and go to Developer
click Insert to
choose command Button you want to assign the macro under Form
control
Draw the command button that is in form of rectangular shape wherever you
want on the sheet. Assign macro dialog box will automatically appear to
choose the macro to assign the button.
Filled the macro field name with the macro we earlier recorded from the list of
the available macro and click ok.
To get what appear below. Though I changed the button caption to “Format
Macro” by simply Right-Click the control button and click edit text to do that.
Good! Let’s now run the macro on our third data set. Highlight the data set and
click the form button.
To get the result below
Yes! It works. There more into macro but these serve as basics for better
understanding.
Chapter 20: Power Query and Power Pivot
These amazing tools were not just developed to enhance mining, cleansing,
combining, and transform data from various sources such as Web, Azure
Marketplace, Hadoop File, SQL Server Database, Excel Workbook, Social
Media, and others but with capability to handle huge volume of data with ease.
How to Activate Power Pivot and Power Query
Having successfully installed power query Addin downloaded from Microsoft
Website, you can now a go a step further to activate it so that it will be visible
on menu bar and available for use. The following steps will guide us on how
to activate both power query and power pivot:
Go to file and select option to invoke Excel Option dialog box
Click the Add-Ins on the left pane and select COM Add-ins from the
Manage option and click on Go button
A COM Add-Ins dialog box will pop up, tick the corresponding check
box to Microsoft Power Pivot and Power Query and click Ok to effect
the changes.
You will notice both power query and power pivot will appear on the
menu bar
Power Query
The rational behinds the creation of this amazing tool popular called power
Query (in Excel 2010 & 2013) but refers to as Get & Transform in Excel 2016
is all about automating the process of getting data and cleansing it. The good
thing about Power Query is how it recorded all the processes of getting data
and transformation in the first time and automate those task subsequently by
simply refresh the query to get data and cleanse it within seconds. This
requires no knowledge of VBA to carry out the task. Part of tasks that can be
perform with power Query includes importing data from multiple sources and
consolidate it to a table for further analysis and performing cleansing
operations such as trimming, splitting text, row/column duplicate,
pivoting/unpivoting data, share and manage query to mention few. Power
Query Add-in can be download on Microsoft website at no cost for excel
2010 and 2013 users but already built with excel 2016 which can be found in
the Get & Transform group of Data Menu.
Importing Data Using Power Query
Get Data from various sources to power query for appropriate cleansing and
necessary transformation that will enable you to do further analyses will take
the center stage in this section. Since we can import data from different
sources, I will be taking you through steps involve in import data from web as
an example which is applicable to other sources.
1. Go to Power Query and click From Web(in Excel 2013). For Excel
2016 users, go to Data New Query From Other Sources
From
Web.
2. Enter a Web Page URL that you intend to get the data from in the pop up
From Web dialog box and click Ok to continue. Take Google finance
for instance, to get stock quote and other international market data. The
URL is https://google.com/finance
3. Power Query will try to parse the webpage and returns the available
tables on the webpage.
4. Navigate through the tables to select the target table then click on Edit to
import it to query editor.
The selected table (Table 0 in this illustration) will be import to power query
environment for further cleansing. Below is what you will get
5. Perform appropriate transformation in Transform Tab to cleansing data
for necessary analyses. This can be splitting, Transpose, Trim, etc. Let us
split the data in column 3 to explain this better. You need to perform the
following in order to achieve the task
1. Right click on the head of column 3 to choose SPLIT COLUMN
from the pop up option, and then select delimiter
2. Select SPACE as the Delimiter and choose At each occurrence of
the delimiter then click Ok to effect the change.
Below is the result you will get
6. Having done with transformation, you can now click on Close & Load
to load data into Excel Workbook.
7. Now that your data is in Excel sheet, the good thing about the power
query is to select the data click the refresh on the queries pane to keep it
up to date within seconds.
Good! So simple.
Power Pivot
This another powerful analytical tool using familiar pivotTable tools to
analyze data as well create sophisticated data model. Power Pivot’s
compression algorithm is the key to its effective and efficient manner of
compressing data that spread across multiple tables as well handle huge
volume of data that more than usual 1,048,576 rows found in a worksheet. The
ability of Power Pivot to connect directly to huge rage of data sources or
power query data sources and its in-built Data Analysis Expression (DAX) –
a new formula language that will enable you to write sophisticated calculations
that beyond the capabilities of regular PivotTable calculated field stand it out
among Excel Add-ins.
Importing Data to Power Pivot
Power Pivot makes provision to import data from various sources such as
Excel Files, Oracle, Text Files, OData Data field, Access, Analysis Services,
and SQL Server to mention few. This section will take you through on how to
get data from various external sources to power pivot in order to perform
further analysis and sophisticated calculations. For instance, let us import data
from external Excel file called Transactions that appear below
1. Open new Excel workbook, then go to Power Pivot tab to open window
and click on Manage
2. Go to Home tab
then From Other Sources in Get External Data group
of power pivot window
3. Choose Excel File in Table Import Wizard dialogue box and click Next
4. Browse for the targeted Excel Workbook that contains your data. Ensure
you tick Use first row as column header since my table has column
headers.
5. Select the targeted file and click Open.
6. Click Next to proceed.
7. Ensure the selected Source Table is the targeted Source Table and click
Preview & Filter if there is need be to filter data intends to import and
click Ok.
8. Click Finish to display Importing Success dialogue that shown the
number of rows that have been successfully imported.
9. Click Close to get your data ready for Power Pivot analysis.
Further analysis
Bonus: Keyboard Shortcuts in Excel
Kindly download the practise files use in this book through this link:
http://85metrics.com/wpcontent/uploads/2016/12/Productivity_Workbook_Files.rar
Descargar