36
Excel Functions Excel Functions

Excel Functions

Embed Size (px)

DESCRIPTION

Excel Functions. Part 1. Introduction. An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the Excel spreadsheet. For example, the sum of two variables can be evaluated in an Excel spreadsheet as follows :. - PowerPoint PPT Presentation

Citation preview

Page 1: Excel  Functions

Excel FunctionsExcel Functions

Page 2: Excel  Functions

Part 1. Introduction

2

Page 3: Excel  Functions

An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the Excel spreadsheet.

3

Page 4: Excel  Functions

For example, the sum of two variables can be evaluated in an Excel spreadsheet as follows:

4

Page 5: Excel  Functions

Sum x + y

  x = 5

  Y = 3

Sum = 8

5

Sum of two variables in an Excel spreadsheet

Page 6: Excel  Functions

This same sum can be done in the environment of Visual Basic (VB)

6

Page 7: Excel  Functions

You can define a function called "Sum", which receives the You can define a function called "Sum", which receives the value of two inputs "x" and "y" and returns the value of value of two inputs "x" and "y" and returns the value of the sum of themthe sum of them

7

Page 8: Excel  Functions

How to build the function "Sum"How to build the function "Sum"

8

Page 9: Excel  Functions

- Click on the "Programmer" tab- Click on the "Programmer" tab

9

Page 10: Excel  Functions

- Click on the "Programmer" tab- Click on the "Programmer" tab

10

If the tab is not available, see Note 1 "Activate tab" at the end of the document.

Page 11: Excel  Functions

- Click on the "Programmer" tab- Click on the "Programmer" tab

11

Page 12: Excel  Functions

Click on "view code"Click on "view code"

12

Page 13: Excel  Functions

The "Visual Basic" ambient is openThe "Visual Basic" ambient is open

13

Page 14: Excel  Functions

Function code

14

Page 15: Excel  Functions

Function code

15

The codes are written in the VB "Modules"

Page 16: Excel  Functions

Function code

16

The codes are written in the VB "Modules"

To open a module

Page 17: Excel  Functions

Function code

17

The codes are written in the VB "Modules"

To open a module

Click right button on the left side window

Page 18: Excel  Functions

Function code

18

The codes are written in the VB "Modules"

To open a module

Click right button on the left side window

It opens a window

Page 19: Excel  Functions

19

Select “Insert”

Page 20: Excel  Functions

Click Module

20

Page 21: Excel  Functions

Appears the new created VB module, with the name Module1.

21

This name can be changed later by a more suitable one.

Page 22: Excel  Functions

The right window displays a flashing line

22

Page 23: Excel  Functions

The right window displays a flashing line

23

The module is now ready for use

Page 24: Excel  Functions

Sum Function Code

24

Page 25: Excel  Functions

Código de la función Suma

25

In the right window type the function name followed by the dependent variables.

Page 26: Excel  Functions

Código de la función Suma

26

In the right window type the function name followed by the dependent variables

Function Suma(x,y)

Page 27: Excel  Functions

Código de la función Suma

27

In the right window type the function name followed by the dependent variables.

Function Suma(x,y)

When you "Enter", VB automatically puts the final line of the function.

Page 28: Excel  Functions

Sum Function Code

28

In the right window type the function name followed by the dependent variables.

Function Suma(x,y)

End Function

Page 29: Excel  Functions

The new code must be written between these two commands.

29

Page 30: Excel  Functions

The new code must be written between these two commands.

30

In this case, the code consists of a single line

Page 31: Excel  Functions

The new code must be written between these two commands.

31

In this case, the code consists of a single line

Suma = x + y

Page 32: Excel  Functions

32

The complete function looks like

Page 33: Excel  Functions

 x = 5Y = 3

Sum =  =SUMA(C5,C6)Sum = 8

33

Application of the Sum function in the Excel spreadsheet

Page 34: Excel  Functions

End of Part 1. Introduction

34

Page 35: Excel  Functions

Activating the "Programmer" tab

35

Page 36: Excel  Functions

Activating the "Programmer" tab

36

Nota 1

To activate the “Programmer” tab

1. Click the File tab.

2. Under Help, click Options.

3. Click Customize Ribbon.

4. Select the Developer check box.