Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 33

15 MICROSOFT OFFICE EXCEL 2013

Microsoft Office Excel doesn’t have a function for every type of calculation we
perform. The designers of Excel couldn’t possibly complement every calculation
need of every user.
4 - Excel for Scientists and Engineers - Numerical Methods - E. Joseph Billo

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 1


15.1 CREATING A SIMPLE CUSTOM FUNCTION

Step 1

Step 2:
 Alt+F11
 Right Click to Thisworkbook
 Insert  Module
(as Fig.1)

Fig. 1: Module 1

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 2
15.2 USING CUSTOM FUNCTIONS

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 3


15.1 CREATING A SIMPLE CUSTOM FUNCTION – If … End

Use “Tab key”


to indent lines

Click Save  Choose in Tab – save as type:

Excel Macro-Enabled Workbook


Do also: + Classify Grade as A+,A,B+,B,C,D,F
+ Solve a quadric equation ax2+bx+c=0

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 4
15.2 USING CUSTOM FUNCTIONS – for LOOP

See Book #4 - Number Series on Page 69

Homework: Do all Problems in the Chapter

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 5
15.2 USING CUSTOM FUNCTIONS – DO UNTIL LOOP

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 6


15.3 MAKING CUSTOM FUNCTIONS AVAILABLE ANYWHERE

1. After creating the custom functions, click File  Save


As  choose a folder to save.
2. In the Save As dialog box, open Save As Type drop-
down list, and select Excel Add-in. Save the workbook
under a recognizable name - such as
My_Bank_Functions in the AddIns folder. (The
Save As dialog box will propose that folder, so all you
need to do is accept the default location.)
3. After you have saved the workbook, click the File 
Options.
4. In the Excel Options dialog box, the Add-Ins
category.
5. In the Manage drop-down list, select Excel Add-Ins.
Then click the Go… button.
6. In the Add-Ins dialog box, select the check box beside
the name you used to save your workbook, as shown
next to.

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 7


15.3 HOMEWORK – CUSTOM FUNCTIONS
Solve the following problems
– Put all problems in one file and each of the problems in one sheet
– Create file name as [Student ID] [Student Name] [Excel Custom Function]

Write a custom function


named circuit_current

Write a custom function


named cubic_equation

5. Find the two sets of coordinates of the intersection of the


Write a custom function
straight line y = mx + n, where m = 5 and n = 50, with the
named intersection_point
parabola y = ax2 + bx + c, where a = 1.1, b = -2.3 and c = -30.5.
Make a chart of the two series to show the intersections.

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 8


15.3 HOMEWORK – CUSTOM FUNCTION

Write a custom
function named
Reynods_Number

*. Write a function named Classify_Grade to classify grades as A+,A,B+,B,C,D,F

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 9


15.4 HOMEWORK – NUMBER SERIES
Write a function named
MY_SUM_i
with i as the problem title

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 10


15.4 HOMEWORK – NUMBER SERIES
Write a function named
MY_SUM_i
with i as the problem title

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 11


15.5 FORECAST - INTERPOLATION

BOOK #4 - [E._Joseph_Billo]_Excel_for_Scientists_and_Engineers
Numerical Methods(BookZZ.org).pdf

Homework:
1. Write function InterpL , InterpC, InterpC2
2. Use these functions to answer all Problems from 1-6 on page 96 and 97
as the followings on next page

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 12


15.5 FORECAST - INTERPOLATION

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 13


15.5 FORECAST - INTERPOLATION

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 14


15.5 FORECAST - INTERPOLATION

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 15


15.6 LINEAR REGRESSION AND CURVE FITTING
Regression analysis uses quantities
  N 
2

 N   xi 
 S  x 2   i 1 
 xx  i
where
i 1 N • N is the number of data points
 2
  N
 • R2 can be used as a measure of the
  yi 

 xy 
2
 N
 i 1  goodness of fit of data and ranges
 S yy   yi 
2

N R2  from 0 (no correlation) to 1 (perfect


 i 1 S xx S yy
 N N correlation).
 N  xi  yi
 S  x y  i 1 i 1
 xy  i 1
i i
N

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 16


15.6 GOAL SEEK
? Question:
4
5
6
7

8
1

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 17


15.6 SOLVER
? Question:
1
2
3

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 18


15.4 SOLVER
To formulate this linear programming model, answer the following three questions.
1. What are the decisions to be made? For this problem, we need Excel to find out how
much to order of each product (bicycles, mopeds and child seats).
2. What are the constraints on these decisions? The constrains here are that the
amount of capital and storage used by the products cannot exceed the limited
amount of capital and storage (resources) available.
3. What is the overall measure of performance for these decisions? The overall
measure of performance is the total profit of the three products, so the objective is to
maximize this quantity.

CHAPTER 15. MICROSOFT OFFICE EXCEL 2013 19


15.4 SOLVER

Constraints

Changing data Target

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 20
15.4 SOLVER

1
2
3
4a

4b
5

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 21
15.4 SOLVER – EXTRA EXAMPLES

http://www.excel-easy.com/examples/transportation-problem.html

http://www.excel-easy.com/examples/assignment-problem.html

http://www.excel-easy.com/examples/shortest-path-problem.html

http://www.excel-easy.com/examples/maximum-flow-problem.html

http://www.excel-easy.com/examples/capital-investment.html

http://www.excel-easy.com/examples/sensitivity-analysis.html

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 22
15.5 FORECAST - TREND

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 23
15.5 FORECAST - TREND

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 24
15.5 FORECAST - TREND

Read more with Excel help (Press F1)


LINEST function
CORREL

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 25
15.6 INTERPOLATION
Using Excel's Lookup Functions to Obtain Values from a Table VLOOKUP
HLOOKUP
LOOKUP
INDEX & MATCH

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 26
15.6 INTERPOLATION

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 27
15.6 DATA VALIDATION
Reject Invalid Dates

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 28
15.6 DATA VALIDATION
BUDGET LIMIT

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 29
15.6 DATA VALIDATION
PREVENT DUPLICATE ENTRIES

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 30
15.6 DATA VALIDATION
PRODUCT CODES

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 31
15.6 DATA VALIDATION
DROP-DOWN LIST

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 32
15.6 DATA VALIDATION
DEPENDENT DROP-DOWN LIST

CHAPTER 15. MICROSOFT OFFICE EXCEL


2013 33

You might also like