Microsoft Excel Functions Examples
Microsoft Excel Functions Examples
FIND
Text Functions
LEFT, RIGHT, MID
CONCATENATE
REPLACE
TRIM
LEN
UPPER, LOWER
DOLLAR
PROPER
REPT
SUBSTITUTE
BAHTTEXT
VALUE
TEXT
Enter the following data in an Excel spreadsheet:
A1: 7678.868
A2: 123.65
A3: 30/11/2008
Place the cursor on B1. On the Formulas tab, click
the Text drop down and select “TEXT”.
When the cursor is on the Value field, select cell A1
on the worksheet.
Place the cursor on the Format field, then enter :
“$#,##0.00”
Click OK
B1 has now changed to: $7,678.87
TEXT (cont.)
Place your cursor on C1. On the Formulas tab,
click the Text drop down and select “TEXT”.
When the cursor is on the Value field, select cell
A1 on the worksheet.
Place the cursor on the Format field, then enter
: “0”
Click OK
C1 has now changed to: 7,679
Click B2. On the Formulas tab, click the Text
drop down and select “TEXT”.
TEXT (cont.)
When the cursor is on the Value field, select cell
A2 on the worksheet.
Place the cursor on the Format field, then enter :
“0.0”
Click OK
B2 has now changed to: 123.7
Place cursor on C2. On the Formulas tab, click
the Text drop down and select “TEXT”.
When the cursor is on the Value field, select cell
A2 on the worksheet.
Place the cursor on the Format field, then enter :
“0.00”
Click OK
FIND
Enter the following sentence in A1:
“King Henry ruled with an iron fist.”
Click B1.
On the formulas tab, click the “Text” dropdown
and select “FIND”
On the find_text field enter “Henry”
On the within_text field enter A1.
Click OK.
C3= 53
Click D1.
Click on the Formulas tab. Choose More
Functions > Information from the ribbon to
open the function drop down list and select
ISERROR.
ISERROR (cont.)
On the Value field, select cell C1.
Copy the contents of D1 to D2 and D3.
D1 becomes FALSE
D2 becomes TRUE
D3 becomes FALSE
=IF((OR(D2>5,C2>10000)),2,1)
=IF((AND(D2>5,C2>10000)),3,(IF((OR(D2>
5,C2>10000)),2,1)))
=IF((B2="East"),4,IF((B2="West"),3,IF((B2
="North"),2,IF((B2="South"),1,""))))
Other Nested Functions
Examples of how other nested functions may
look like:
=SUM(SUM(B1:B3),SUM(C1:C3))
=LEFT(C2,FIND(“”,C2),-1)
PivotTable
Use the data below to create a PivotTable report
and PivotChart
Custome
Order # Year Month Rep Category Item Sales r
Brewer's
20040045 2004 August Hickman Health Yeast $800Goods4U
Protein
20040044 2004 August Hickman Feedstuffs Mix $400Winners
Boneshak Countrywi
20040043 2004 August Velasquez Str Ale er $300 de
Protein
20040042 2004 August Hickman Feedstuffs Mix $900Winners
Extra
Septembe Iron Continent
20040041 2004 r Nilsson Str Lager Reserve $2,384 Extra
al
Continent
20040040 2004 July Hickman Std Ale Mary Giant $3,295 al
Boneshak Countrywi
20040039 2004 June Velasquez Str Ale er $400 de
Brewer's
20040038 2004 April Hickman Health Yeast $995Goods4U
Corn Moose
20040037 2004 March Stewart Std Ale Circle $2,500 Pubs
PivotTable (cont.)
Drag the Year field to the page area. Excel adds
the field, displays a drop-down list next to it for
selecting the years, and selects the (All) entry
Drag the Rep field to the row area. Excel adds
the field with a drop-down list button for
selecting the rep name, enters the rep names in
the cells (again, displaying all items), and adds a
Grand Total entry under them
Drag the Category field to the column area.
Excel adds the field with a drop-down list button
for selecting the category, enters the categories
in the cells across the columns, and adds a
Grand Total entry immediately to their right
PivotTable (cont.)
Drag the Sales field to the data area. Excel
snaps the data into place and displays a Sum of
Sales button at the intersection of the rows and
columns. Now you can see which rep has sold
how much of each category of product
To see the reps’ results for a specific year (as
shown below) instead of for all years, choose
the year from the Year drop-down list
Changing a PivotTable
Drag the Item field to the column area. Excel
breaks down each category by its components.
Drag the Category field off the PivotTable area to
remove it. (Either drop the field in limbo anywhere
outside the PivotTable or drop it back in the
PivotTable Field List window.)
The PivotTable then shows how much of each item each
rep sold in the specified year, which shows very clearly
which rep is selling most of which item.
Drag the Customer field to the column area to
produce a PivotTable showing which rep sold how
much of which item to which customer. Drag the
Rep field off the PivotTable to display a breakdown
of which items each customer purchased.
PivotChart
Click on the data that is to be presented on the
PivotChart
Click on the Insert tab of the ribbon menu.
Click on the PivotTable Function and select
PivotChart on the dropdown menu to open the
PivotChart dialog box.
Select the range of cells for which to create the
PivotChart on the Table/Range field or select
the connection if the data is from another
source.
Choose whether to display the PivotChart on a
new worksheet or the location if on an existing
one, then click OK.
PivotChart (cont.)
A PivotChart area appears.
On the PivotTable field list, select which fields
to be added to the PivotChart.
Note that a PivotTable gets created as you select the
fields.
Whatever changes you make on the PivotTable, the
PivotChart gets changed accordingly.
You can change the order of sorting the chart.
You may also change the type of PivotChart to
use.
Right-click on the PivotChart and click “Change Chart
Type..” or while the PivotChart has been clicked, on
the Design tab on the toolbar, select “Change Chart
What-If Analysis
What-If Utilities
Goal Seek
Scenario Manager
Solver
VLOOKUP and HLOOKUP
Goal Seek
You have two worksheet cells: Cell A1
contains a temperature value in degrees
Fahrenheit, and cell A2 contains the
Fahrenheit-to-Celsius temperature conversion
formula =CONVERT(A1, "F", "C").
Typing 100 in cell A1 returns the Celsius
temperature of approximately 37.8 degrees in
cell A2. But how many degrees Fahrenheit is a
Celsius temperature of 20 degrees?
Goal Seek (cont.)
Solution:
1. Click What-If Analysis ➤ Goal Seek from
the Data tab.
2. In the Set Value box, type or click cell
A2.
3. In the To Value box, type 20.
4. In the By Changing Cell box, type or
click cell A1.
5. Click OK.
The Goal Seek Status dialog box displays the
target value, 20, and Excel inserts the answer,
68, into cell A1.
Scenario Manager
Loan payment calculations.
Enter the following data in the spreadsheet:
cell B1 represents the loan’s interest rate,
cell B2 represents the loan term, cell B3
represents the loan amount, and cell B4
represents the loan payment.
Let’s call the scenario in Table 1 the Three-
Bedroom House scenario, and let’s call the
scenario in Table 2 the Four-Bedroom House
scenario.
Tables follow.
Scenario Manager (cont.)
Table 1
Interest 6.90%
Months 360
Loan Payment
Table 2
Interest 6.30%
Months 360
Loan Amount R 250,000
Loan Payment
Solver
consider the problem of determining the best
theater ticket prices and number of tickets to
sell at those prices for a theater to achieve a
desired box office income amount.
The Theater Ticket Prices worksheet lists three
ticket price points for child, adult, and senior
tickets. The target box office income is simply
the sum of the child, adult, and senior ticket
prices multiplied by their respective number of
tickets to sell.
Solver (cont.)
Using Goal Seek, you can look for one value at
a time: the number of tickets sold for child,
adult, or senior, or the ticket prices for child,
adult, or senior.
With Solver, you can still solve for only one
value at a time, but you gain the flexibility of
solving for specific values, minimum values,
and maximum values, and applying various
other constraints.
You can use Solver to figure out how many
tickets to sell to achieve an income of exactly
$1,000.00, subject to the following constraints:
Child tickets sell only for $3.00 each.
Solver (cont.)
Adult tickets sell only for $5.00 each.
Senior tickets sell only for $4.00 each.
Cell Data
D3 - Part
D4 - Bearing
D5 - Bolt
D6 - Cog
D7 - Gear
D8 – Washer
E3 - Price
E4 - $17.34
E5 - $1.54
E6 - $20.21
E7 - $23.56
VLOOKUP (cont.)
Click on cell E1
Click on the Formulas tab.
Choose Lookup & Reference from the ribbon to
open the function drop down list.
Click on VLOOKUP in the list to bring up the
function's dialog box.
In the dialog box, click on the Lookup _value line.
Click on cell D1 in the spreadsheet. This is where
we will type the name of the part we wish to price.
In the dialog box, click on the Table_array line.
Drag select cells D4 to E8 in the spreadsheet to
enter the range into the dialog box. This is the
range of data we want VLOOKUP to search.
VLOOKUP (cont.)
In the dialog box, click on the Col_index_num line.
Type the number 2 to indicate that the data we
want returned is in column 2 of the table_array.
In the dialog box, click on the Range_lookup line.
Type the word False to indicate that we want an
exact match for our requested data.
Click OK.
In cell D1 of the spreadsheet, type the word bolt.
The value $1.54 should appear in cell E1 displaying
the price of a bolt as indicated in the table_array.
If you click on cell E1, the complete function =
VLOOKUP ( D1 , D4:E8 , 2 , FALSE ) appears in
the formula bar above the worksheet.
HLOOKUP
If you have an inventory list of parts or a large
membership contact list, HLOOKUP can help
you find data that matches specific criteria such
as the price of a specific item or a person's
phone number.
Part Bearing Gear Widget Cog
Price $17.34 $23.56 $14.76 $20.21