Functions

A listing, by category, of the functions in Google Sheets. We explain how they work and when you may want to use them.

NamePurposeCategoryInputs
DBreturns one period of accelerated depreciationFinancialcost, salvage value, life, period, [month]
DDBreturns one period of accelerated depreciationFinancialcost, salvage value, life, period, [factor]
SLNreturns one period of straight-line depreciationFinancialcost, salvage value, life
SYDreturns one period of accelerated depreciationFinancialcost, salvage value, life, period
FILTERreturns filtered lines from a tableFilterrange,condition1,[condition2…]
SORTreturns a sorted tableFilterrange,sort_column,is_ascending,[sort_column2, is_acending2,…]
SORTNreturns n sorted lines from a table
Filterrange,[n],[display_ties_mode],[sort_column1, is_acending1],…
UNIQUEreturns a table without duplicate linesFilterrange
ARRAYFORMULArepeats non-array formulasGooglearray_formula
IMAGEinserts an image into a cellGoogleURL, mode, [height], [width]
SPARKLINEinserts a miniature chart into a cellGoogledata, [options]
QUERYuses SQL-like syntax to analyze data returned as a new tableGoogledata, query, [headers]
TYPEreturns an integer indicating the data typeInfovalue
COUNTIFcounts cells that match a criteriaMathvalues
COUNTIFScounts cells that meet multiple conditionsMathvalues
COUNTUNIQUEcounts the number of unique valuesMathvalues
SUBTOTALperforms a variety of functions based on the function numberMathfunction number, numbers
SUMadds numbersMathnumbers
SUMIFadds numbers that meet a conditionMathnumbers, criterion, [criterion range]
SUMIFSadds numbers that meet multiple conditionsMathnumbers, criteria, [criteria range]
AVERAGEcalculates the mean of a set of numbersStatisticalnumbers
AVERAGEAcalculates the mean of a set of numbers, text, and boolean valuesStatisticalvalues
COUNTcounts the numeric values in a data setStatisticalnumbers
COUNTAcounts the non-blank values in a data setStatisticalvalues
DATEreturns the inputs as a dateTime and Dateyear, month, day
DATEDIFreturns the number of days, months, or years between two daysTime and Datestart date, end date, unit
DATEVALUEreturns a serial number from any valid dateTime and Datedate in text format
DAYreturns a date’s day’s value as a numberTime and Datedate
DAYSreturns the number of days between two datesTime and Dateend date, start date
DAYS360returns the difference between two dates using the 360-day methodTime and Datestart date, end date, [method]
EDATEadds or subtracts months from a dateTime and Datestart date, # of months
EOMONTHreturns end date of a month x months away from a dateTime and Datestart date, # of months
HOURreturns a time’s hour value as a numberTime and Datetime
ISOWEEKNUMreturns the ISO week number of a given dateTime and Datedate
MINUTEreturns a time’s minute value as a numberTime and Datetime
MONTHreturns a date’s month value as a numberTime and Datedate
NETWORKDAYScalculates the number of working days between two datesTime and Datestart date, end date, [holidays]
NETWORKDAYS.INTLcalculates the number of working days between two datesTime and Datestart date, end date, [holidays], [weekends]
NOWreturns the current date and timeTime and Datenone
SECONDreturns a time’s second value as a numberTime and Datetime
TIMEturns three numbers into a timeTime and Datehour, minute, second
TIMEVALUEconverts time to a fraction of oneTime and Datetime
TODAYreturns the current dateTime and Datenone
WEEKDAYreturns the day number of a dateTime and Datedate, [type]
WEEKNUMreturns the week number of a dayTime and Datedate, [type]
WORKDAYcalculates the workday a number of days awayTime and Datestart date, # of days, [holidays]
WORKDAY.INTLcalculates the workday a number of days awayTime and Datestart date, # of days, [holidays], [weekends]
YEARreturns the date’s year value as a numberTime and Datetime
YEARFRACcalculates the number of years, including fractions between two datesTime and Datestart date, end date, [day count convention]
IMPORTRANGEImports data from another spreadsheetWebspreadsheet URL, range string
IMPORTXMLImports XML data from the webWebURL, XPath_query, [locale]