Anda di halaman 1dari 12

MS ExceI Topics: FormuIas/Functions (By Category)

View an AIphabeticaI Listing of FormuIas/Functions


String Functions:

Asc (VBA) Find Mid Substitute

Char Fixed Proper T

Chr (VBA) Format (VBA) Replace Text

Clean InStr (VBA) Rept Trim

Code InStrRev (VBA) Right UCase (VBA)

Concatenate LCase (VBA) RTrim (VBA) Upper

Concatenate with & Left Search Value

CurDir (VBA) Len Space (VBA)

Dollar Lower Str (VBA)

Exact LTrim (VBA) StrConv (VBA)

umeric / Mathematical Functions:

Abs CountIf Minverse Small

ACos Degrees Mmult Sqrt

ACosh Even Mod Subtotal

ASin Exp Odd Sum

ASinh Fact Pi SumIf

ATan Fix (VBA) Power SumProduct

ATan2 Floor Product SumSq

ATanh Format (VBA) Radians SumX2mY2

Atn (VBA) Int Rand SumX2pY2

Average Large Rnd (VBA) SumXmY2

AverageA Ln Roman Tan

Ceiling Log Round Tanh

Combin Log10 RoundDown Trunc

Cos Max RoundUp Val (VBA)

Cosh MaxA Sgn (VBA) Var

Count Mdeterm Sign VarA

CountA Min Sin VarP

CountBlank MinA Sinh VarPA

Statistical Functions:

AveDev Growth Percentile StDevP

Average Intercept PercentRank StDevPA

AverageA Large Permut Var

BetaDist Max Quartile VarA

BetaInv MaxA Rank VarP

BinomDist Median Small VarPA

Covar Min StDev


Forecast MinA StDevA


ogical Functions:

And If IF-THEN-ELSE (VBA) True

Case (VBA) Nested Ifs (up to 7) Not


False Nested Ifs (more than 7) Or


nIormation Functions:

Cell IsErr IsNull (VBA) N

Error.Type IsError IsNumber NA

Info IsLogical IsNumeric (VBA) Type

IsBlank IsNA IsRef


IsDate (VBA) IsNonText IsText


ate & Time Functions:
Date DateSerial (VBA) Minute TimeSerial (VBA)
Date (VBA) DateValue Month TimeValue
DateAdd (VBA) Day MonthName (VBA) Today
DateDif Days360 Now Weekday
DateDiff (VBA) Format (VBA) Second WeekdayName (VBA)
DatePart (VBA) Hour Time Year

atabase Functions:

DAverage DGet DProduct DSum

DCount DMax DStDev DVar

DCountA DMin DStDevP DVarP

ookup / ReIerence Functions:

Address GetPivotData (Ex #1) Indirect Rows

Areas GetPivotData (Ex #2) Lookup Switch (VBA)

Choose HLookup Match Transpose

Column Hyperlink Offset VLookup

Columns Index Row


More ookup Functions:

Two-Dimensional Lookup (Example #1)


Two-Dimensional Lookup (Example #2)


Two-Dimensional Lookup (Example #3)


Two-Dimensional Lookup (Example #4)


ata Type Conversion Functions:

CBool (VBA) CDate (VBA) CInt (VBA) CStr (VBA)

CByte (VBA) CDbl (VBA) CLng (VBA) CVar (VBA)

CCur (VBA) CDec (VBA) CSng (VBA)


Financial Functions:

Db Irr Npv Rate

DDb ISPmt Pmt SLn

FV Mirr PPmt Syd

IPmt NPer PV Vdb

File/irectory Functions:

ChDir (VBA) Dir (VBA) FileLen (VBA) MkDir (VBA)

ChDrive (VBA) FileDateTime (VBA) GetAttr (VBA) SetAttr (VBA)

Miscellaneous Functions:

Test a string for an alphanumeric value

Convert currency into words

How to Autonumber in Excel

Delimit values with Ascii 29 character

Creating a custom round function

Creating a custom average function (that excludes outlyers from the calculation)

MS ExceI: Asc Function (VBA onIy)

n Excel, the Asc function returns the ASCII vaIue of a character or the first character in a string.
%he syntax for the Asc function is:
Asc( string )
string is the specified character to retrieve the ASC value for. f there is more than one character, the function will
return the ASC value for the first character and ignore all of the characters after the first.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Asc (W) would reLurn 87
Asc (Wednesday) would reLurn 87
Asc (x) would reLurn 120

VBA Code
%he Asc function can only be used in VBA code. For example:
Dim LResuIt As Integer
LResuIt = Asc ("W")
n this example, the variable called LResult would now contain the value 87.
MS ExceI: Char Function

n Excel, the Char function returns the character based on the ASCII vaIue.
%he syntax for the Char function is:
Char( ascii_vaIue )
,scii_v,:0 is the ASC value used to retrieve the character.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
Char(A1) ould return "v"
Char(A2) ould return ""
Char(72) ould return "H"
Char(109) ould return "m"
MS ExceI: Chr Function (VBA onIy)

n Excel, the Chr function returns the character based on the ASCII vaIue.
%he syntax for the Chr function is:
Chr( ascii_vaIue )
,scii_v,:0 is the ASC value used to retrieve the character.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
(87) would reLurn W
(10S) would reLurn l

VBA Code
%he Chr function can only be used in VBA code. For example:
Dim LResuIt As String
LResuIt = Chr(87)
n this example, the variable called LResult would now contain the value "W".
MS ExceI: CIean Function

n Excel, the CIean function removes all nonprintable characters from a string.
%he syntax for the CIean function is:
CIean( text )
t0t is the value that has all nonprintable characters removed from.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
Clean(A1) ould return "hi there"
Clean(A2) ould return '"this is a test"
MS ExceI: Code Function

n Excel, the Code function returns the ASCII vaIue of a character or the first character in a cell.
%he syntax for the Code function is:
Code( text )
t0t is the specified character to retrieve the ASC value for. f there is more than one character, the function will
return the ASC value for the first character and ignore all of the characters after the first.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
Code(A1) ould return 116
Code(A2) ould return 84
Code(A3) ould return 84
MS ExceI: Concatenate Function

n Excel, the Concatenate function allows you to join 2 or more strings together.
%he syntax for the Concatenate function is:
Concatenate( text1, text2, ... text_n )
%here can be up to 30 strings that are joined together.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
Concatenate(A1, A2) ould return "Alphabet"
Concatenate("Tech on the ", "Net") ould return "Tech on the et"
Concatenate(A1, "bet soup") ould return "Alphabet soup"
MS ExceI: Concatenate with &

%o concatenate multiple strings into a single string in Excel, you can use the "&" operator to separate the string
values.
string_1 & string_2 & string_n

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
A1A2 would reLurn AlphabeL
1ec on te Net would reLurn 1ech on Lhe neL
(A1bet soup) would reLurn AlphabeL soup

VBA Code
%he "&" operator can be used to concatenate strings in VBA code. For example:
Dim LVaIue As String
LVaIue = "AIpha" & "bet"
MS ExceI: Abs Function

n Excel, the Abs function returns the absolute value of a number.
%he syntax for the Abs function is:
Abs( number )
n:2-0r is a numeric value.

AppIies To:
O Excel 2007, Excel 2003, Excel XP, Excel 2000

For exampIe:
Let's take a look at an example:

Based on the Excel spreadsheet above:
Abs(A1) would reLurn 21067
Abs(A2) would reLurn 29
Abs(A3) would reLurn 3
Abs(4S) would reLurn 43

VBA Code
%he Abs function can also be used in VBA code. For example:
Dim LNumber As DoubIe
LNumber = Abs (-210.6)
n this example, the variable called LNumber would now contain the value of 210.6.

Anda mungkin juga menyukai