what is function vs. formula?

F

francine

my question is what is function vs. formula?
I need to know so that I can study for finals. I'm trying to get as much
information as I can on the subject so that I may possibly get a good grade
 
G

Gord Dibben

francine

Formulas can use Functions or not.

Functions have to be used in formula mode.

This is a formula =A1+A2+A3+A4+A5+A6+A7

This is a formula with a Function in use =SUM(A1:A7) which saves you a lot of
typing.


Gord Dibben Excel MVP
 
R

Rob van Gelder

A formula contains one or more operators.
eg. 1+1 (the + is the operator)

A function returns one value
=SUM(1, 2, 3, 4)
 
G

Gord Dibben

The statement below is not entirely true.

Actually, Functions do not have to be used only in Formulas.

A Function can be called by VBA code also.

A couple of examples.........one with a User Defined Function...........

Sub foo()
MsgBox "The row height is " & rowht(ActiveCell)
End Sub

Function rowht(x)
Application.Volatile
rowht = x.RowHeight
End Function

One using an Excel Function............

Sub foo2()
MsgBox "The Total is " & Application.WorksheetFunction.Sum(Range("A1:A32"))
End Sub


Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top