AddingPowertoExcel
AddingPowertoExcel
EXCEL
Contents
Developing Effective Formulas & Functions .............................................................................................................4
Differentiating Formulas & Functions ...................................................................................................................4
Developing One Time Formulas / Functions .........................................................................................................4
Linking Sheets & Files ............................................................................................................................................8
Referencing Different Sheets in Same File ........................................................................................................8
Referencing From Different Files .................................................................................................................... 10
Evaluating and Auditing Formula’s & Functions ................................................................................................ 11
Verifying Formula / Function .......................................................................................................................... 11
Writing Effective Formulas Key Points ............................................................................................................ 12
ADVANCED FUNCTIONS .......................................................................................................................................... 13
Understanding Functions.................................................................................................................................... 13
Logical Functions ................................................................................................................................................. 14
IF() Function .................................................................................................................................................... 14
AND ................................................................................................................................................................. 15
OR .................................................................................................................................................................... 16
Conditional Functions ......................................................................................................................................... 18
SUMIF() Function ............................................................................................................................................ 18
SUMIFS() Function .......................................................................................................................................... 20
AVERAGEIF() Function .................................................................................................................................... 21
AVERAGEIFS() Function ................................................................................................................................... 24
Lookup Functions ................................................................................................................................................ 26
LOOKUP() Function ......................................................................................................................................... 27
VLOOKUP() Function ....................................................................................................................................... 33
HLOOKUP() Function ....................................................................................................................................... 36
Nesting Functions ............................................................................................................................................... 39
Analyzing, Reporting and Enhancing Data ............................................................................................................. 41
Conditional Formatting....................................................................................................................................... 41
Advance Sorting & Filtering ................................................................................................................................ 44
Custom Sorting ................................................................................................................................................ 44
Advance Filter ................................................................................................................................................. 45
Generating Subtotal ............................................................................................................................................ 47
PivotTable ........................................................................................................................................................... 50
What if Analysis .................................................................................................................................................. 53
Goal Seek ......................................................................................................................................................... 53
Scenarios in Excel ............................................................................................................................................ 55
Effective utilities ..................................................................................................................................................... 59
Security ................................................................................................................................................................ 59
Protecting Cell Data in Excel ........................................................................................................................... 59
Templates ............................................................................................................................................................ 61
Introduction to Macros ....................................................................................................................................... 62
Adding Power To
Microsoft Excel
Developing Effective Formulas & Functions
Formulas and Functions are used for Calculations and manipulating data. Data can be generated from
Systems or Manually Enter the information.
Formulas - Calculations generated for specific purpose and are specific to needs. For example
10+20/5*6-3
Functions – Pre defined actions which are already developed by Microsoft. For example to find the Total,
Average, Statistical Calculations, Date Manipulations, Text Manipulations etc.
3. Mixed Reference – Used in situations when only part of the cell reference needs to change, either the
column or the row and the other part is fixed. For e.g. G$2 / $F4 .Mixed Reference is achieved by putting
“$” symbol before the Column name or “$” symbol before the row number. Short cut key which can be
used is “F4”,
continue
pressing till $
symbol before
the column
name or the
row number is
visible
The Challenge of Fixed / Mixed Referencing
Fixed / Mixed Referencing of Cell sometimes might be challenging, to decide what to fix (Row or Column)
and what not to fix. Simple process which can be followed and is useful is as below:
1. Write the Formula / Function in the First Cell
2. Ask a Question – Is similar Action (Formula / Function) Required for the Corresponding Rows Below?
a. If Yes – Relate to Each Cell Reference Used in the Formula / Function one at a time.
i. Ask – Am I OK with the Row Number Increasing?
1. If Yes – Ignore
2. If No – Put a “$” symbol before the Row Number or Keep on Pressing “F4” Function key till the Time “$”
symbol appears before the Row Number
b. If No – Ignore and Move to Next Question.
3. Ask a Question – Is similar Action (Formula / Function) required for the Corresponding Columns Below?
a. If Yes – Relate to Each Cell Reference Used in the Formula / Function one at a time.
i. Ask – Am I OK with the Column Name Changing?
1. If Yes – Ignore
2. If No – Put a “$” symbol before the Column Name or Keep on Pressing “F4” Function key till the Time “$”
symbol appears before
the Column Name
b. If No – Ignore and Move and Copy the Formula to the Corresponding cells
Type the names of the Ranges in the Cell where the calculation needs to be done
In the Cell use the Names given in the Function / Formula. The Name can be included in the Formula /
Function using two options after Typing the “=”.
1. Formulas Tab -> Define Names Panel -> Use in Formula
2. Start typing the Name and select the required name from the Drop Down List
Linking
Sheets &
Files
Referencing
Different
Sheets in
Same File
Linking of
Sheets is
required
when we need to perform an action on a sheet using Formula / Function by using values from different
sheets in the same file: For example –
Option 1: Creating the Formula
Steps to Calculate
1. Go to Cell in the Destination Sheet where the Formula / Function is Required
2. Type = symbol then Click on Source Sheet -> Select the Cell with Required Value
3. Type arithmetical operator as required
4. Click on the Other Source Sheet -> Select the Cell with Required Value
5. If the formula / calculation is complete with the required values press enter
When we need to use values from different file to calculate in another files.
Steps
1. Open the required files
2. Select the file from the Task Bar where calculation is required
3. Select the Cell where the Calculation is required
4. Type = and start the formula with the 1st Value; Use Arithmetical Symbol (+,-,*,/)
5. Select the Second File from the task Bar -> Select the Cell which has the required value
6. Press Enter
As a good Practice the Formula / Function developed should be verified for the correctness of the output.
Options provided by Microsoft for doing this are:
Evaluating Formula is used to understand the steps in which the Formula / Function is executed and what
values are being taken at each step. To Evaluate the Formula / Function follow the steps as below:
Formula Tab -> Evaluate Formula
The part of the Formula / Function which is underlined is the step which is getting executed, to move further
click on the Step In Button which reveals the Cell address and then Click on Step Out and Evaluate to
Reveal the Value
To Audit the Formula to Trace the Dependents and the source of calculation
Formula Tab -> Trace Dependents
Formula Tab -> Trace Precedents
Writing Effective Formulas Key Points
To use Microsoft Excel more efficiently and to its core strength is to be able to formulate Formulas and
Functions more efficiently and to be able to understand the Working of the Formulas. To write an effective
Formula remember the following
1. Mathematical rule of BODMAS – sequence in which the calculations are performed
Functions are
predefined
actions
available in
Excel for the
purpose of
performing:
Calculations
– (Statistical,
Financial, Math & Trigonometrical), Text Manipulations, Date Manipulation and Calculations, Conditional,
Lookup and Reference.
To use a Function
1. Click on the category depending on the action
2. Choose the Function from The drop Down – Purpose can be identified by taking the mouse on the
Function Name the small screen shows the use of the function
3. Click on the Function
Function Window enter the Parameters – Mandatory and if required the optional
Mandatory Parameter (in Bold)
Optional Parameter
Number of Parameters & Parameter Values
Logical Functions
IF() Function
The IF function, one of Excel's logical functions in Excel is used for Generating additional information as
fixed value or result of a calculation.
Certain Scenarios:
1. Providing Discounts and generating the value after Discount, based on Sale Value to Customers.
2. Giving Increments to employees an generating the New Salaries
3. Generating the Invoice Aging Days for Customers.
The syntax for the IF function is:
=IF (logical_test, value_if_true, value_if_false )
logical_test - a value or expression that is tested to see if it is true or false.
value_if_true - the value that is displayed or an action (calculation) if logical_test is true.
value_if_false - the value that is displayed or an action (calculation) if logical_test is false.
The IF function can be used to handle more than One conditions by using AND,OR Functions.
AND function results to True only when all the Conditions are Satisfied
OR Function results to True when any one of the Conditions is satisfied
Conditional Functions
SUMIF() Function
SUMIF() function is used to add up the values in cells in a selected range that meet certain criteria. The syntax
for the SUMIF() function is:
=SUMIF( Range, Criteria, Sum_Range)
Range - the group of cells the function is to search.
Criteria – Value to be searched in the Range, it determines whether the respective cell in the SUM_Range is to
be included while performing the SUM.
Sum_Range - the data range that is summed if the first range meets the specified criteria. If this range is omitted,
the first range is summed instead.
Example:
Find out the Total of Expenses for the Size Large
SUMIFS() function is used to add up the values in cells in a selected range that meet more than one criteria.
The syntax for the SUMIFS() function is:
=SUMIFS(Sum_range,Criteria_range1,Criteria1,Criteria_range2,Criteria2,…up-to255 criteria_ranges
and criteria’s)
Sum_range – is the data range that is summed if the specified criteria’s in the criteria_ranges are met
Criteria_range1 - the group of cells the function is to search.
Criteria1 - Value to be searched in the Criteria_range1, it determines whether the respective cell in the
SUM_Range is to be included while performing the SUM.
Criteria_range2 - the group of cells the function is to search.
Criteria2 - Value to be searched in the Criteria_range2, it determines whether the respective cell in the
SUM_Range is to be included while performing the SUM.
SUMIFS() function can be located in
Formula Tab->Math&Trig->SUMIFS
Example
Find the Total of Expenses for Size as Large and Destination as Domestic
AVERAGEIF() Function
AVERAGEIF() function is
used to find the Average of
values in cells in a selected
range that meet certain
criteria. The syntax for the AVERAGEIF() function is:
=AVERAGEIF ( Range, Criteria, Average_Range)
Range - the group of cells the function is to search.
Criteria – Value to be searched in the Range, it determines whether the respective cell in the
Average_Range is to be included while performing the AVERAGE.
Avrage_Range - the data range that is averaged if the first range meets the specified criteria.
If this range is omitted, the first range is averaged instead.
Average
AVERAGEIF() function can be located in Expense for
Size Large
AVERAGEIFS() function is used to Average the values in cells in a selected range that meet more than one
criteria. The syntax for the AVERAGEIFS() function is:
=AVERAGEIFS(Average_range,Criteria_range1,Criteria1,Criteria_range2,Criteria2,…up-to255
criteria_ranges and criteria’s)
Average_range – is the data range that is averaged if the specified criteria’s in the criteria_ranges are met
Criteria_range1 - the group of cells the function is to search.
Criteria1 - Value to be searched in the Criteria_range1, it determines whether the respective cell in the
Average_Range is to be included while performing the Average.
Criteria_range2 - the group of cells the function is to search.
Criteria2 - Value to be searched in the Criteria_range2, it determines whether the respective cell in the
Average_Range is to be included while performing the AVERAGE.
AVERAGEIFS() function can be located in
Formula Tab->More Functions->Statistical->AVERAGEIFS
Example:
Find out the Average of Expenses for the Size Large and Destination Domestic
Average Expense for Size
Large & Destination
Domestic
Lookup Functions
Microsoft Excel Provides various
functions to Search a value
in a range and return a
corresponding value from the
source if the value is found. Lookup
functions provided by Microsoft
Excel are Lookup(),
VLookup() and HLookup().
LOOKUP() Function
The LOOKUP() function is used to search one column of data and find data in the corresponding row. Once
the value is found the data from that same row is returned.
LOOKUP() function has 2 variations
Variation 1:
Vector form: To search one row or one column for a value. Vector form is used when you want to specify the
range that contains the values that you want to match. The syntax is as below:
=LOOKUP(Lookup_value,Lookup_vector,Result_vector)
Lookup_value : A value that is required to be searched.
Lookup_vector : Range that contains only one row or one column where the Lookup_value needs to be
searched
Result_vector : Range that contains only one row or column from where the corresponding value needs to
be returned
Lookup() function can be located from
Formula Tab->Lookup & Reference->LOOKUP
Example:
Fill in the Discount Rate Based on the Source of Contact where the Discount Rate for each Source of Contact is
mentioned in the panel below.
array : Is range of cells that contains text, numbers, or logical values that you want to compare with
lookup_value.
Lookup() function can be located from
Formula Tab->Lookup & Reference->LOOKUP
Example:
Fill in the Discount Rate Based on the Source of Contact where the Discount Rate for each Source of Contact is
mentioned in the panel below.
Retrieve the Discount Rate
Lookup function is useful in situations where the Data List is small or it is very specific that the return value
is required from the last column or row of the Data List.
For more flexibility in terms of Large Lists or when the return value is required from the column or row which
might be somewhere in the middle of the data range, Microsoft Excel provides 2
other additional functions that is VLOOKUP and HLOOKUP.
VLOOKUP() Function
Stands for vertical lookup, is used to find specific information that has been stored in a spreadsheet table.
Data in the table should be sorted in ascending order (alphabetically A to Z).
The syntax for the VLOOKUP function is:
lookup _value: The value required to be searched in the first column of the table_array.
table_array: This is the table where the value is required to be searched to return the required value. The
table_array must contain at least two columns of data. The first column contains the lookup_values.
col_index_num: The number of the column in the table_array that contains the value that is require.
range_lookup: A logical value (TRUE or FALSE only) that indicates whether you want VLOOKUP to find an
exact or an approximate match to the lookup_value. Typing False will return exact matches only.
VLookup() function can be located from
Formula Tab->Lookup & Reference->VLOOKUP
Example:
Fill in the Description Based on the Source of Contact where the Description Information for each Source of
Contact is mentioned in the panel below.
Retrieve the Description
HLOOKUP() Function
Stands for Horizontal lookup, is used to find specific information that has been stored in a spreadsheet
table. Data in the table should be sorted in ascending order (alphabetically A to Z).
The syntax for the HLOOKUP function is:
lookup_value: The value required to be searched in the first row of the table_array.
table_array: This is the table where the value is required to be searched to return the required value. The
table_array must contain at least two rows of data. The first row contains the lookup_values.
row_index_num: The number of the row in the table_array that contains the value that is require.
range_lookup: A logical value (TRUE or FALSE only) that indicates whether HLOOKUP to find an exact or
an approximate match to the lookup_value. Typing False will return exact matches only.
HLookup() function can be located from
Formula Tab->Lookup & Reference->HLOOKUP
Example:
Fill in the Description Based on the Source of Contact where the Description Information for each Source of
Contact is mentioned in the panel below.
In certain situations we might be required to use different functions separately to achieve the final result. In
such scenarios getting results from different functions in different columns adds up to adding additional
columns in the sheet which actually are not required and hence increase the size of the sheet. Other
implication of this method is the time taken by Microsoft Excel to evaluate the final result increases and
therefore reduces the efficiency of the file.
To overcome this we can create a complete logic and give the relevant functions inside one another, this is
referred to Nesting of Functions. Nested functions look something like below
=<FinalFunctionName>(<subFunction1(p1,p2,..)>, fixed value or reference or other function,…)
Example
Let us consider a scenario where we have to Generate the Item Code based as a combination of 1 st two
characters of Description followed by a “-“ symbol, then Last two characters of the Description followed by a
“-“ symbol and finally the 1st two Characters of the Packing finally the Item could should like “DG-60-60”
For the above scenario as a normal process we use multiple functions in different columns and finally
combine the values in the Item code column, as shown below
The same can be achieved by using Nested
Functions as below
Conditional Formatting allows you to change the appearance of a cell, depending on certain conditions. As
compared to normal formatting Conditional Formatting is Dynamic that is the Format changes according to
the value of the cell and the formatting condition applied on the cell.
Conditional Formatting option is available in the Home Tab
Example:
Color the Overall Averages, depending on the grade. As 50 and below; 51 to 60; 61 to 70; 71 to 80; 81 and
above
Advance Sorting & Filtering
Custom Sorting
While sorting data it is required that all the columns in the sheet are selected before we sort the data. By default
if we use
Home Tab->Sort & Filter -> A to Z or Z to A or Sort option from the Data Tab
the data is sorted according to the 1st column of the data
In order to sort the data as per some other column we use custom sort option, which is available in Home
->Sort&Filter->Custom Sort also available in the Data Tab
Advance Filter
Example:
We need Type wise Size wise totals of expenses
In this scenario we need to first sort the data by Type and then by Size and then we follow the below steps
This add subtotals to the Type , to further add subtotals to the Size we again use the subtotal tool.
PivotTable
A Pivot Table enables us to dynamically create reports from the data available, it enables to change the
structure of the report and the dynamically change the information which is required.
Pivot Table is available in
Insert Tab->Pivot
Table
Example:
Microsoft Excel Provides three tools to perform analysis based on situation these are called as What if
Analysis tools. They are Gola Seek, Scenario and Solver
Goal Seek
Goal Seek is used to get a particular result when you're not too sure of the starting value. For example, if
the answer is 56, and the first number is 8, what is the second number? Is it 8 multiplied by 7, or 8 multiplied
by 6? You can use Goal Seek to find out. We'll try that example to get you started, and then have a go at a
more practical example.
Example 1
The first thing Excel is looking for is "Set cell". This is not very well named. It means "Which
cell contains the Formula that you want Excel to use". For us, this is cell B3. We have the following formula
in B3:
= B1 * B2
So enter B3 into the "Set cell" box, if it's not already in there.
The "To value" box means "What answer are you looking for"? For us, this is 56. So just type 56 into the "To
value" box
The "By Changing Cell" is the part you're not sure of. Excel will be changing this part. For us, it was cell B2.
We're weren't sure which number, when multiplied by 8, gave the answer 56. So type B2 into the box.
You Goal Seek dialogue box should look like ours below:
Click OK again, because Excel has found the answer. Your new
spreadsheet will look like this one:
As you can see, Excel has changed cell B2 and replace the 6 with a 7 - the correct answer.
Scenarios in Excel
Scenarios come under the heading of "What-If Analysis" in Excel ““. They are similar to tables in that you
are changing values to get new results. For example, What if I reduce the amount I'm spending on food?
How much will I have left then? Scenarios can be saved, so that you can apply them with a quick click of the
mouse.
The J22 in the image is just whatever cell you had selected when you brought up the dialogue boxes. We'll
change this. First, type a Name for
your Scenario in the Scenario Name
box. Call it Original Budget.
Excel now needs you to enter
which cells in your spreadsheet will
be changing. In this first scenario,
nothing will be changing (because
it's our original). But we still need to
specify which cells will be changing.
Let's try to reduce the Food bill, the
Clothes Bill, and the Phone bill.
These
are in cells B7 to B9 in our spreadsheet. So in the
Changing Cells box, enter B7:B9
Don't forget to include the colon in the middle! But
your Add Scenario box should look like this:
We don't want any values to change in this first scenario, so just click OK. You will be taken back
to the Scenario Manager box. It should now look like this:
Now that we have one scenario set up, we can add a second
one. This is where we'll enter some new values - our savings.
Effective utilities
Security
Protecting Cell Data in Excel
Unlocking cells
1. If the worksheet is protected, click the Unprotect Sheet button in the Changes group on the Review tab
(type the password, if prompted).
2. Select the cells you want to unlock.These are the cells you want to allow users to edit when the
worksheet is protected.
3. Press Ctrl+1 to open the Format Cells dialog box and
click the Protection tab.
A template in Excel is a spreadsheet file containing common data and formatting options that is used as a
model for other spreadsheets.
Formatting can include font and layout changes, conditional formatting, color changes, and any other
available options. Charts can added to the template file as can formulas, functions, look up tables, and
macros.
To save the template once all changes have been made to your spreadsheet:
1. Click the OK button in the Record Macro dialog box to start the macro recorder.
2. Click on the Home tab of the ribbon.
3. Drag select cells A1 to F1 in the worksheet to highlight them.
4. Click on the Merge and Center icon to center the title between cells A1 and F1.
5. Click on the Fill Color icon (looks like a paint can) to open the fill color drop down list.
6. Choose Blue, Accent 1 from the list to turn the background color of the selected cells to blue.
7. Click on the Font Color icon (it is a large letter "A") to open the font color drop down list.
8. Choose White from the list to turn the text in the selected cells to white.
9. Click on the Font Size icon (above the paint can icon) to open the font size drop down list.
10. Choose 16 from the list to change the size the text in the selected cells to 16 point.
11. Click on the Developer tab of the ribbon.
12. Click the Stop Recording button on the ribbon to stop the macro recording.
13. At this point, your worksheet title should resemble the title in the image above.
Running a Macro in Excel