Excel Tutorial

Excel Functions



Excel has many built-in functions which can be used in Worksheet and VBA. Worksheet functions are those built-in functions which can be used as part of a formula in a cell, whereas VBA functions are those built-in functions which can be used in Excel's programming environment called Visual Basic for Applications (VBA).

Below is the list of Excel functions, sorted by category. In the tables below, a function can be of type: WS (Worksheet function), VBA (VBA function) or both.


Search Excel Function:

(Enter a function name in the field above to quickly find it in the tables below)

Lookup and Reference Functions

FunctionTypeDescription
ADDRESSWSReturns a text representation of a cell address
AREASWSReturns the number of ranges in a reference
CHOOSEWS, VBAReturns a value from a list of values based on a given position
COLUMNWSReturns the column number of a cell reference
COLUMNSWSReturns the number of columns in a cell reference
HLOOKUPWSPerforms a horizontal lookup by searching for a value in the top row of the table and returning the value in the same column based on the index_number
HYPERLINKWSCreates a shortcut to a file or Internet address
INDEXWSReturns either the value or the reference to a value from a table or range
INDIRECTWSReturns the reference to a cell based on its string representation
LOOKUPWSReturns a value from a range (one row or one column) or from an array
MATCHWSSearches for a value in an array and returns the relative position of that item
OFFSETWSReturns a reference to a range that is offset a number of rows and columns
ROWWSReturns the row number of a cell reference
ROWSWSReturns the number of rows in a cell reference
TRANSPOSEWSReturns a transposed range of cells
VLOOKUPWSPerforms a vertical lookup by searching for a value in the first column of a table and returning the value in the same row in the index_number position
XLOOKUPWSPerforms a lookup (either vertical or horizontal)

String/Text Functions

FunctionTypeDescription
ASCVBAReturns ASCII value of a character
BAHTTEXTWSReturns the number in Thai text
CHARWSReturns the character based on the ASCII value
CHRVBAReturns the character based on the ASCII value
CLEANWSRemoves all nonprintable characters from a string
CODEWSReturns the ASCII value of a character or the first character in a cell
CONCATWSUsed to join 2 or more strings together
CONCATENATEWSUsed to join 2 or more strings together (replaced by CONCAT Function)
CONCATENATE with &WS, VBAUsed to join 2 or more strings together using the & operator
DOLLARWSConverts a number to text, using a currency format
EXACTWSCompares two strings and returns TRUE if both values are the same
FINDWSReturns the location of a substring in a string (case-sensitive)
FIXEDWSReturns a text representation of a number rounded to a specified number of decimal places
FORMAT STRINGSVBATakes a string expression and returns it as a formatted string
INSTRVBAReturns the position of the first occurrence of a substring in a string
INSTRREVVBAReturns the position of the first occurrence of a string in another string, starting from the end of the string
LCASEVBAConverts a string to lowercase
LEFTWS, VBAExtract a substring from a string, starting from the left-most character
LENWS, VBAReturns the length of the specified string
LOWERWSConverts all letters in the specified string to lowercase
LTRIMVBARemoves leading spaces from a string
MIDWS, VBAExtracts a substring from a string (starting at any position)
NUMBERVALUEWSReturns a text to a number specifying the decimal and group separators
PROPERWSSets the first character in each word to uppercase and the rest to lowercase
REPLACEWSReplaces a sequence of characters in a string with another set of characters
REPLACEVBAReplaces a sequence of characters in a string with another set of characters
REPTWSReturns a repeated text value a specified number of times
RIGHTWS, VBAExtracts a substring from a string starting from the right-most character
RTRIMVBARemoves trailing spaces from a string
SEARCHWSReturns the location of a substring in a string
SPACEVBAReturns a string with a specified number of spaces
SPLITVBAUsed to split a string into substrings based on a delimiter
STRVBAReturns a string representation of a number
STRCOMPVBAReturns an integer value representing the result of a string comparison
STRCONVVBAReturns a string converted to uppercase, lowercase, proper case or Unicode
STRREVERSEVBAReturns a string whose characters are in reverse order
SUBSTITUTEWSReplaces a set of characters with another
TWSReturns the text referred to by a value
TEXTWSReturns a value converted to text with a specified format
TEXTJOINWSUsed to join 2 or more strings together separated by a delimiter
TRIMWS, VBAReturns a text value with the leading and trailing spaces removed
UCASEVBAConverts a string to all uppercase
UNICHARWSReturns the Unicode character based on the Unicode number provided
UNICODEWSReturns the Unicode number of a character or the first character in a string
UPPERWSConvert text to all uppercase
VALVBAReturns the numbers found in a string
VALUEWSConverts a text value that represents a number to a number

Date and Time Functions

FunctionTypeDescription
DATEWSReturns the serial date value for a date
DATEVBAReturns the current system date
DATEADDVBAReturns a date after which a certain time/date interval has been added
DATEDIFWSReturns the difference between two date values, based on the interval specified
DATEDIFFVBAReturns the difference between two date values, based on the interval specified
DATEPARTVBAReturns a specified part of a given date
DATESERIALVBAReturns a date given a year, month, and day value
DATEVALUEWS, VBAReturns the serial number of a date
DAYWS, VBAReturns the day of the month (a number from 1 to 31) given a date value
DAYSWSReturns the number of days between 2 dates
DAYS360WSReturns the number of days between two dates based on a 360-day year
EDATEWSAdds a specified number of months to a date and returns the result as a serial date
EOMONTHWSCalculates the last day of the month after adding a specified number of months to a date
FORMAT DATESVBATakes a date expression and returns it as a formatted string
HOURWS, VBAReturns the hours (a number from 0 to 23) from a time value
ISOWEEKNUMWSReturns the ISO week number for a date
MINUTEWS, VBAReturns the minutes (a number from 0 to 59) from a time value
MONTHWS, VBAReturns the month (a number from 1 to 12) given a date value
MONTHNAMEVBAReturns a string representing the month given a number from 1 to 12
NETWORKDAYSWSReturns the number of work days between 2 dates, excluding weekends and holidays
NETWORKDAYS.INTLWSReturns the number of work days between 2 dates, excluding weekends and holidays
NOWWS, VBAReturns the current system date and time
SECONDWSReturns the seconds (a number from 0 to 59) from a time value
TIMEWSReturns a decimal number given an hour, minute and second value
TIMESERIALVBAReturns a time given an hour, minute, and second value
TIMEVALUEWS, VBAReturns the serial number of a time
TODAYWSReturns the current system date
WEEKDAYWS, VBAReturns a number representing the day of the week, given a date value
WEEKDAYNAMEVBAReturns a string representing the day of the week given a number from 1 to 7
WEEKNUMWSReturns the week number for a date
WORKDAYWSAdds a specified number of work days to a date and returns the result as a serial date
WORKDAY.INTLWSAdds a specified number of work days to a date and returns the result as a serial date (customizable weekends)
YEARWS, VBAReturns a four-digit year (a number from 1900 to 9999) given a date value
YEARFRACWSReturns the number of days between 2 dates as a year fraction

Math and Trigonometry Functions

FunctionTypeDescription
ABSWS, VBAReturns the absolute value of a number
ACOSWSReturns the arccosine (in radians) of a number
ACOSHWSReturns the inverse hyperbolic cosine of a number
AGGREGATEWSApply functions such AVERAGE, SUM, COUNT, MAX or MIN and ignore errors or hidden rows
ASINWSReturns the arcsine (in radians) of a number
ASINHWSReturns the inverse hyperbolic sine of a number
ATANWSReturns the arctangent (in radians) of a number
ATAN2WSReturns the arctangent (in radians) of (x, y) coordinates
ATANHWSReturns the inverse hyperbolic tangent of a number
ATNVBAReturns the arctangent of a number
CEILINGWSReturns a number rounded up based on a multiple of significance
CEILING.PRECISEWSReturns a number rounded up to the nearest integer or to the nearest multiple of significance
COMBINWSReturns the number of combinations for a specified number of items
COMBINAWSReturns the number of combinations for a specified number of items and includes repetitions
COSWS, VBAReturns the trigonometric cosine of an angle
COSHWSReturns the hyperbolic cosine of a number
COTWSReturns the trigonometric cotangent of an angle
CSCWSReturns the trigonometric cosecant of an angle
DEGREESWSConverts angles expressed in radians into degrees
EVENWSRounds a number up to the nearest even integer
EXPWS, VBAReturns e raised to the nth power
FACTWSReturns the factorial of a number
FIXVBAReturns the integer portion of a number
FLOORWSReturns a number rounded down based on a multiple of significance
FORMAT NUMBERSVBATakes a numeric expression and returns it as a formatted string
INTWS, VBAReturns the integer portion of a number
LNWSReturns the natural logarithm of a number
LOGWSReturns the logarithm of a number to a specified base
LOGVBAReturns the natural logarithm of a number
LOG10WSReturns the base-10 logarithm of a number
MDETERMWSReturns the matrix determinant of an array
MINVERSEWSReturns the inverse matrix for a given matrix
MMULTWSReturns the matrix product of two arrays
MODWSReturns the remainder after a number is divided by a divisor
MODVBAReturns the remainder after a number is divided by a divisor
ODDWSRounds a number up to the nearest odd integer
PIWSReturns the mathematical constant called pi
POWERWSReturns the result of a number raised to a given power
PRODUCTWSMultiplies the numbers and returns the product
RADIANSWSConverts angles expressed in degrees into radians
RANDWSReturns a random number that is greater than or equal to 0 and less than 1
RANDBETWEENWSReturns a random number that is between a bottom and top range
RANDOMIZEVBAUsed to change the seed value used by the random number generator for the RND function
RNDVBAUsed to generate a random number (integer value)
ROMANWSConverts a number to roman numeral
ROUNDWSReturns a number rounded to a specified number of digits
ROUNDVBAReturns a number rounded to a specified number of digits
ROUNDDOWNWSReturns a number rounded down to a specified number of digits
ROUNDUPWSReturns a number rounded up to a specified number of digits
SGNVBAReturns the sign of a number
SIGNWSReturns the sign of a number
SECWSReturns the trigonometric secant of an angle
SINWS, VBAReturns the trigonometric sine of an angle
SINHWSReturns the hyperbolic sine of a number
SQRVBAReturns the square root of a number
SQRTWSReturns the square root of a number
SUBTOTALWSReturns the subtotal of the numbers in a column in a list or database
SUMWSAdds all numbers in a range of cells
SUMIFWSAdds all numbers in a range of cells based on one criteria
SUMIFSWSAdds all numbers in a range of cells, based on a single or multiple criteria
SUMPRODUCTWSMultiplies the corresponding items in the arrays and returns the sum of the results
SUMSQWSReturns the sum of the squares of a series of values
SUMX2MY2WSReturns the sum of the difference of squares between two arrays
SUMX2PY2WSReturns the sum of the squares of corresponding items in the arrays
SUMXMY2WSReturns the sum of the squares of the differences between corresponding items in the arrays
TANWS, VBAReturns the trigonometric tangent of an angle
TANHWSReturns the hyperbolic tangent of a number
TRUNCWSReturns a number truncated to a specified number of digits

Statistical Functions

FunctionTypeDescription
AVEDEVWSReturns the average of the absolute deviations of the numbers provided
AVERAGEWSReturns the average of the numbers provided
AVERAGEAWSReturns the average of the numbers provided and treats TRUE as 1 and FALSE as 0
AVERAGEIFWSReturns the average of all numbers in a range of cells, based on a given criteria
AVERAGEIFSWSReturns the average of all numbers in a range of cells, based on multiple criteria
BETA.DISTWSReturns the beta distribution
BETA.INVWSReturns the inverse of the cumulative beta probability density function
BETADISTWSReturns the cumulative beta probability density function
BETAINVWSReturns the inverse of the cumulative beta probability density function
BINOM.DISTWSReturns the individual term binomial distribution probability
BINOM.INVWSReturns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion
BINOMDISTWSReturns the individual term binomial distribution probability
CHIDISTWSReturns the one-tailed probability of the chi-squared distribution
CHIINVWSReturns the inverse of the one-tailed probability of the chi-squared distribution
CHITESTWSReturns the value from the chi-squared distribution
COUNTWSCounts the number of cells that contain numbers as well as the number of arguments that contain numbers
COUNTAWSCounts the number of cells that are not empty as well as the number of value arguments provided
COUNTBLANKWSCounts the number of empty cells in a range
COUNTIFWSCounts the number of cells in a range, that meets a given criteria
COUNTIFSWSCounts the number of cells in a range, that meets a single or multiple criteria
COVARWSReturns the covariance, the average of the products of deviations for two data sets
FORECASTWSReturns a prediction of a future value based on existing values provided
FREQUENCYWSReturns how often values occur within a set of data. It returns a vertical array of numbers
GROWTHWSReturns the predicted exponential growth based on existing values provided
INTERCEPTWSReturns the y-axis intersection point of a line using x-axis values and y-axis values
LARGEWSReturns the nth largest value from a set of values
LINESTWSUses the least squares method to calculate the statistics for a straight line and returns an array describing that line
MAXWSReturns the largest value from the numbers provided
MAXAWSReturns the largest value from the values provided (numbers, text and logical values)
MAXIFSWSReturns the largest value in a range, that meets a single or multiple criteria
MEDIANWSReturns the median of the numbers provided
MINWSReturns the smallest value from the numbers provided
MINAWSReturns the smallest value from the values provided (numbers, text and logical values)
MINIFSWSReturns the smallest value in a range, that meets a single or multiple criteria
MODEWSReturns most frequently occurring number
MODE.MULTWSReturns a vertical array of the most frequently occurring numbers
MODE.SNGLWSReturns most frequently occurring number
PERCENTILEWSReturns the nth percentile from a set of values
PERCENTRANKWSReturns the nth percentile from a set of values
PERMUTWSReturns the number of permutations for a specified number of items
QUARTILEWSReturns the quartile from a set of values
RANKWSReturns the rank of a number within a set of numbers
SLOPEWSReturns the slope of a regression line based on the data points identified by known_y_values and known_x_values
SMALLWSReturns the nth smallest value from a set of values
STDEVWSReturns the standard deviation of a population based on a sample of numbers
STDEVAWSReturns the standard deviation of a population based on a sample of numbers, text, and logical values
STDEVPWSReturns the standard deviation of a population based on an entire population of numbers
STDEVPAWSReturns the standard deviation of a population based on an entire population of numbers, text, and logical values
VARWSReturns the variance of a population based on a sample of numbers
VARAWSReturns the variance of a population based on a sample of numbers, text, and logical values
VARPWSReturns the variance of a population based on an entire population of numbers
VARPAWSReturns the variance of a population based on an entire population of numbers, text, and logical values

Logical Functions

FunctionTypeDescription
ANDWSReturns TRUE if all conditions are TRUE
ANDVBAReturns TRUE if all conditions are TRUE
CASEVBAHas the functionality of an IF-THEN-ELSE statement
FALSEWSReturns a logical value of FALSE
FOR...NEXTVBAUsed to create a FOR LOOP
IFWSReturns one value if the condition is TRUE or another value if the condition is FALSE
IF (more than 7)WSNest more than 7 IF functions
IF (up to 7)WSNest up to 7 IF functions
IF-THEN-ELSEVBAReturns a value if a specified condition evaluates to TRUE or another value if it evaluates to FALSE
IFERRORWSUsed to return an alternate value if a formula results in an error
IFNAWSUsed to return an alternate value if a formula results in #N/A error
IFSWSSpecify multiple IF conditions within 1 function
NOTWSReturns the reversed logical value
ORWSReturns TRUE if any of the conditions are TRUE
ORVBAReturns TRUE if any of the conditions are TRUE
SWITCHWSCompares an expression to a list of values and returns the corresponding result
SWITCHVBAEvaluates a list of expressions and returns the corresponding value for the first expression in the list that is TRUE
TRUEWSReturns a logical value of TRUE
WHILE...WENDVBAUsed to create a WHILE LOOP

Information Functions

FunctionTypeDescription
CELLWSUsed to retrieve information about a cell such as contents, formatting, size, etc.
ENVIRONVBAReturns the value of an operating system environment variable
ERROR.TYPEWSReturns the numeric representation of an Excel error
INFOWSReturns information about the operating environment
ISBLANKWSUsed to check for blank or null values
ISDATEVBAReturns TRUE if the expression is a valid date
ISEMPTYVBAUsed to check for blank cells or uninitialized variables
ISERRWSUsed to check for error values except #N/A
ISERRORWS, VBAUsed to check for error values
ISLOGICALWSUsed to check for a logical value (TRUE or FALSE)
ISNAWSUsed to check for #N/A error
ISNONTEXTWSUsed to check for a value that is not text
ISNULLVBAUsed to check for a NULL value
ISNUMBERWSUsed to check for a numeric value
ISNUMERICVBAUsed to check for a numeric value
ISREFWSUsed to check for a reference
ISTEXTWSUsed to check for a text value
NWSConverts a value to a number
NAWSReturns the #N/A error value
TYPEWSReturns the type of a value

Financial Functions

FunctionTypeDescription
ACCRINTWSReturns the accrued interest for a security that pays interest on a periodic basis
ACCRINTMWSReturns the accrued interest for a security that pays interest at maturity
AMORDEGRCWSReturns the linear depreciation of an asset for each accounting period, on a prorated basis
AMORLINCWSReturns the depreciation of an asset for each accounting period, on a prorated basis
DBWSReturns the depreciation of an asset based on the fixed-declining balance method
DDBWS, VBAReturns the depreciation of an asset based on the double-declining balance method
FVWS, VBAReturns the future value of an investment
IPMTWS, VBAReturns the interest payment for an investment
IRRWS, VBAReturns the internal rate of return for a series of cash flows
ISPMTWSReturns the interest payment for an investment
MIRRWS, VBAReturns the modified internal rate of return for a series of cash flows
NPERWS, VBAReturns the number of periods for an investment
NPVWS, VBAReturns the net present value of an investment
PMTWS, VBAReturns the payment amount for a loan
PPMTWS, VBAReturns the payment on the principal for a particular payment
PVWS, VBAReturns the present value of an investment
RATEWS, VBAReturns the interest rate for an annuity
SLNWS, VBAReturns the depreciation of an asset based on the straight-line depreciation method
SYDWS, VBAReturns the depreciation of an asset based on the sum-of-years' digits depreciation method
VDBWSReturns the depreciation of an asset based on a variable declining balance depreciation method
XIRRWSReturns the internal rate of return for a series of cash flows that may not be periodic

Database Functions

FunctionTypeDescription
DAVERAGEWSAverages all numbers in a column in a list or database, based on a given criteria
DCOUNTWSReturns the number of cells in a column or database that contains numeric values and meets a given criteria
DCOUNTAWSReturns the number of cells in a column or database that contains nonblank values and meets a given criteria
DGETWSRetrieves from a database a single record that matches a given criteria
DMAXWSReturns the largest number in a column in a list or database, based on a given criteria
DMINWSReturns the smallest number in a column in a list or database, based on a given criteria
DPRODUCTWSReturns the product of the numbers in a column in a list or database, based on a given criteria
DSTDEVWSReturns the standard deviation of a population based on a sample of numbers
DSTDEVPWSReturns the standard deviation of a population based on the entire population of numbers
DSUMWSSums the numbers in a column or database that meets a given criteria
DVARWSReturns the variance of a population based on a sample of numbers
DVARPWSReturns the variance of a population based on the entire population of numbers

Engineering Functions

FunctionTypeDescription
BIN2DECWSConverts a binary number to a decimal number
BIN2HEXWSConverts a binary number to a hexadecimal number
BIN2OCTWSConverts a binary number to an octal number
COMPLEXWSConverts coefficients (real and imaginary) into a complex number
CONVERTWSConvert a number from one measurement unit to another measurement unit

File/Directory Functions

FunctionTypeDescription
CHDIRVBAUsed to change the current directory or folder
CHDRIVEVBAUsed to change the current drive
CURDIRVBAReturns the current path
DIRVBAReturns the first filename that matches the pathname and attributes specified
FILEDATETIMEVBAReturns the date and time of when a file was created or last modified
FILELENVBAReturns the size of a file in bytes
GETATTRVBAReturns an integer that represents the attributes of a file, folder, or directory
MKDIRVBAUsed to create a new folder or directory
SETATTRVBAUsed to set the attributes of a file

Data Type Conv. Functions

FunctionTypeDescription
CBOOLVBAConverts a value to a boolean
CBYTEVBAConverts a value to a byte (ie: number between 0 and 255)
CCURVBAConverts a value to currency
CDATEVBAConverts a value to a date
CDBLVBAConverts a value to a double
CDECVBAConverts a value to a decimal number
CINTVBAConverts a value to an integer
CLNGVBAConverts a value to a long integer
CSNGVBAConverts a value to a single-precision number
CSTRVBAConverts a value to a string
CVARVBAConverts a value to a variant