Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

functions within functions

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Functions within functions

Functions within functions

ResolvedVersion Standard

James has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA Advanced course

Functions within functions

How do you call a predefined function in a User defined function?

Edited on Fri 28 Mar 2008, 09:59

RE: Functions within functions

Hi James

Thank you for your question

I am assuming that you want to use one of the standard functions within your user defined function

To do this use need to use the work sheet function property of the application object.

For example the following code calculates the average of a range of cells and then returns it to a variable called MyAverage

MyAverage = Application.WorksheetFunction.Average("B1:D15")


Hope this is useful

Regards

Stephen


Excel tip:

Checking formulas with multiple operators

When dealing with formulas containing more than one operator (+, -, /, *), Excel follow standard BEDMAS order of operation rules. These rules specify the order that calculations will be performed in, regardless of how the formula reads left to right:

B = brackets
E = exponents
D = division
M = multiplication
A = addition
S = subtraction

It should be noted that multiplication and division are considered equal; as are addition and subtraction.

If you would like to check the order in which Excel is performing calculations in a formula, simply click on the cell containing the formula. Then go to Tools - Formula Auditing and select Evaluate Formula.

In the Evaluate Formula dialogue box that appears on your screen, click the Evaluate button to see how Excel calculates the formula result.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.13 secs.