There are total over 330 of the Excel worksheet functions. In this section, I will only show you most of the commonly used functions, with many useful examples of multi-nested functions in very complex situations. I have excluded the engineering and financial functions.

Database functions
External functions
Date and time functions
Text functions
Information functions
Logical functions
Lookup and reference functions
Math and trigonometry functions
Statistical functions
Financial functions
Engineering functions
Tips: If you perform arithmetic operation on a text data, you can use implicit type conversion or coercion. See these examples:

--A1,A1^1,A1*1,A1/1, A1+0, A1-0

 

Database functions
 

Function

Description

DCOUNT Counts the cells that contain numbers in a database
DCOUNTA Counts nonblank cells in a database
DMAX Returns the maximum value from selected database entries
DMIN Returns the minimum value from selected database entries
DSUM Adds the numbers in the field column of records in the database that match the criteria
DPRODUCT Multiplies the values in a particular field of records that match the criteria in a database
DAVERAGE Returns the average of selected database entries
DSTDEV Estimates the standard deviation based on a sample of selected database entries
DSTDEVP Calculates the standard deviation based on the entire population of selected database entries
DVAR Estimates variance based on a sample from selected database entries
DVARP Calculates variance based on the entire population of selected database entries
DGET Extracts from a database a single record that matches the specified criteria

 

External function
  
Function

Description

SQL.REQUEST Connects with an external data source and runs a query from a worksheet, then returns the
result as an array without the need for macro programming

Return To Top

Date and Time functions
  
Function

Description

DATE Returns the serial number of a particular date
DATEVALUE Converts a date in the form of text to a serial number
DAY Converts a serial number to a day of the month
DAYS360 Calculates the number of days between two dates based on a 360-day year
EDATE Returns the serial number of the date that is the indicated number of months before or after the start date
EOMONTH Returns the serial number of the last day of the month before or after a specified number of months
HOUR Converts a serial number to an hour
MINUTE Converts a serial number to a minute
MONTH Converts a serial number to a month
NETWORKDAYS Returns the number of whole workdays between two dates
NOW Returns the serial number of the current date and time
SECOND Converts a serial number to a second
TIME Returns the serial number of a particular time
TIMEVALUE Converts a time in the form of text to a serial number
TODAY Returns the serial number of today's date
WEEKDAY Converts a serial number to a day of the week
WEEKNUM Converts a serial number to a number representing where the week falls numerically with a year
WORKDAY Returns the serial number of the date before or after a specified number of workdays
YEAR Converts a serial number to a year
YEARFRAC Returns the year fraction representing the number of whole days between start_date and end_date

Return To Top

Text functions
  
Function

Description

ASC Changes full-width (double-byte) English letters or katakana within a character string to half-width
  (single-byte) characters
BAHTTEXT Converts a number to text, using the ß (baht) currency format
CHAR Returns the character specified by the code number
CLEAN Removes all nonprintable characters from text
CODE Returns a numeric code for the first character in a text string
CONCATENATE Joins several text items into one text item
DOLLAR Converts a number to text, using the $ (dollar) currency format
EXACT Checks to see if two text values are identical
FIND Finds one text value within another (case-sensitive)
FIXED Formats a number as text with a fixed number of decimals
JIS Changes half-width (single-byte) English letters or katakana within a character string to full-width
  (double-byte) characters
LEFT Returns the leftmost characters from a text value
LEN Returns the number of characters in a text string
LOWER Converts text to lowercase
MID Returns a specific number of characters from a text string starting at the position you specify
PHONETIC Extracts the phonetic (furigana) characters from a text string
PROPER Capitalizes the first letter in each word of a text value
REPLACE Replaces characters within text
REPT Repeats text a given number of times
RIGHT Returns the rightmost characters from a text value
SEARCH Finds one text value within another (not case-sensitive)
SUBSTITUTE Substitutes new text for old text in a text string
T Converts its arguments to text
TEXT Formats a number and converts it to text
TRIM Removes spaces from text
UPPER Converts text to uppercase
VALUE Converts a text argument to a number

Return To Top

Information functions
  
Function

Description

CELL Returns information about the formatting, location, or contents of a cell
ERROR.TYPE Returns a number corresponding to an error type
INFO Returns information about the current operating environment
ISBLANK Returns TRUE if the value is blank
ISERR Returns TRUE if the value is any error value except #N/A
ISERROR Returns TRUE if the value is any error value
ISEVEN Returns TRUE if the number is even
ISLOGICAL Returns TRUE if the value is a logical value
ISNA Returns TRUE if the value is the #N/A error value
ISNONTEXT Returns TRUE if the value is not text
ISNUMBER Returns TRUE if the value is a number
ISODD Returns TRUE if the number is odd
ISREF Returns TRUE if the value is a reference
ISTEXT Returns TRUE if the value is text
N Returns a value converted to a number
NA Returns the error value #N/A
TYPE Returns a number indicating the data type of a value

Return To Top

Logical functions
  
Function

Description

AND Returns TRUE if all of its arguments are TRUE
FALSE Returns the logical value FALSE
IF Specifies a logical test to perform
NOT Reverses the logic of its argument
OR Returns TRUE if any argument is TRUE
TRUE Returns the logical value TRUE

Return To Top

Lookup and Reference functions
  
Function

Description

ADDRESS Returns a reference as text to a single cell in a worksheet
AREAS Returns the number of areas in a reference
CHOOSE Chooses a value from a list of values
COLUMN Returns the column number of a reference
COLUMNS Returns the number of columns in a reference
GETPIVOTDATA Returns data stored in a PivotTable
HLOOKUP Looks in the top row of an array and returns the value of the indicated cell
HYPERLINK Creates a shortcut or jump that opens a document stored on a network server, an intranet, or the Internet
INDEX Uses an index to choose a value from a reference or array
INDIRECT Returns a reference indicated by a text value
LOOKUP Looks up values in a vector or array
MATCH Looks up values in a reference or array
OFFSET Returns a reference offset from a given reference
ROW Returns the row number of a reference
ROWS Returns the number of rows in a reference
RTD Retrieves real-time data from a program that supports COM automation (Automation: A way to work with
  an application's objects from another application or development tool. Formerly called OLE Automation,
  Automation is an industry standard and a feature of the Component Object Model (COM).)
TRANSPOSE Returns the transpose of an array
VLOOKUP Looks in the first column of an array and moves across the row to return the value of a cell

Return To Top

Math and Trigonometry functions
  
Function

Description

ABS Returns the absolute value of a number
ACOS Returns the arccosine of a number
ACOSH Returns the inverse hyperbolic cosine of a number
ASIN Returns the arcsine of a number
ASINH Returns the inverse hyperbolic sine of a number
ATAN Returns the arctangent of a number
ATAN2 Returns the arctangent from x- and y-coordinates
ATANH Returns the inverse hyperbolic tangent of a number
CEILING Rounds a number to the nearest integer or to the nearest multiple of significance
COMBIN Returns the number of combinations for a given number of objects
COS Returns the cosine of a number
COSH Returns the hyperbolic cosine of a number
DEGREES Converts radians to degrees
EVEN Rounds a number up to the nearest even integer
EXP Returns e raised to the power of a given number
FACT Returns the factorial of a number
FACTDOUBLE Returns the double factorial of a number
FLOOR Rounds a number down, toward zero
GCD Returns the greatest common divisor
INT Rounds a number down to the nearest integer
LCM Returns the least common multiple
LN Returns the natural logarithm of a number
LOG Returns the logarithm of a number to a specified base
LOG10 Returns the base-10 logarithm of a number
MDETERM Returns the matrix determinant of an array
MINVERSE Returns the matrix inverse of an array
MMULT Returns the matrix product of two arrays
MOD Returns the remainder from division
MROUND Returns a number rounded to the desired multiple
MULTINOMIAL Returns the multinomial of a set of numbers
ODD Rounds a number up to the nearest odd integer
PI Returns the value of pi
POWER Returns the result of a number raised to a power
PRODUCT Multiplies its arguments
QUOTIENT Returns the integer portion of a division
RADIANS Converts degrees to radians
RAND Returns a random number between 0 and 1
RANDBETWEEN Returns a random number between the numbers you specify
ROMAN Converts an arabic numeral to roman, as text
ROUND Rounds a number to a specified number of digits
ROUNDDOWN Rounds a number down, toward zero
ROUNDUP Rounds a number up, away from zero
SERIESSUM Returns the sum of a power series based on the formula
SIGN Returns the sign of a number
SIN Returns the sine of the given angle
SINH Returns the hyperbolic sine of a number
SQRT Returns a positive square root
SQRTPI Returns the square root of (number * pi)
SUBTOTAL Returns a subtotal in a list or database
SUM Adds its arguments
SUMIF Adds the cells specified by a given criteria
SUMPRODUCT Returns the sum of the products of corresponding array components
SUMSQ Returns the sum of the squares of the arguments
SUMX2MY2 Returns the sum of the difference of squares of corresponding values in two arrays
SUMX2PY2 Returns the sum of the sum of squares of corresponding values in two arrays
SUMXMY2 Returns the sum of squares of differences of corresponding values in two arrays
TAN Returns the tangent of a number
TANH Returns the hyperbolic tangent of a number
TRUNC Truncates a number to an integer

Return To Top

Statistical functions
  
Function

Description

AVEDEV Returns the average of the absolute deviations of data points from their mean
AVERAGE Returns the average of its arguments
AVERAGEA Returns the average of its arguments, including numbers, text, and logical values
BETADIST Returns the beta cumulative distribution function
BETAINV Returns the inverse of the cumulative distribution function for a specified beta distribution
BINOMDIST Returns the individual term binomial distribution probability
CHIDIST Returns the one-tailed probability of the chi-squared distribution
CHIINV Returns the inverse of the one-tailed probability of the chi-squared distribution
CHITEST Returns the test for independence
CONFIDENCE Returns the confidence interval for a population mean
CORREL Returns the correlation coefficient between two data sets
COUNT Counts how many numbers are in the list of arguments
COUNTA Counts how many values are in the list of arguments
COUNTBLANK Counts the number of blank cells within a range
COUNTIF Counts the number of nonblank cells within a range that meet the given criteria
COVAR Returns covariance, the average of the products of paired deviations
CRITBINOM Returns the smallest value for which the cumulative binomial distribution is less than or equal to a
  criterion value
DEVSQ Returns the sum of squares of deviations
EXPONDIST Returns the exponential distribution
FDIST Returns the F probability distribution
FINV Returns the inverse of the F probability distribution
FISHER Returns the Fisher transformation
FISHERINV Returns the inverse of the Fisher transformation
FORECAST Returns a value along a linear trend
FREQUENCY Returns a frequency distribution as a vertical array
FTEST Returns the result of an F-test
GAMMADIST Returns the gamma distribution
GAMMAINV Returns the inverse of the gamma cumulative distribution
GAMMALN Returns the natural logarithm of the gamma function, Γ(x)
GEOMEAN Returns the geometric mean
GROWTH Returns values along an exponential trend
HARMEAN Returns the harmonic mean
HYPGEOMDIST Returns the hypergeometric distribution
INTERCEPT Returns the intercept of the linear regression line
KURT Returns the kurtosis of a data set
LARGE Returns the k-th largest value in a data set
LINEST Returns the parameters of a linear trend
LOGEST Returns the parameters of an exponential trend
LOGINV Returns the inverse of the lognormal distribution
LOGNORMDIST Returns the cumulative lognormal distribution
MAX Returns the maximum value in a list of arguments
MAXA Returns the maximum value in a list of arguments, including numbers, text, and logical values
MEDIAN Returns the median of the given numbers
MIN Returns the minimum value in a list of arguments
MINA Returns the smallest value in a list of arguments, including numbers, text, and logical values
MODE Returns the most common value in a data set
NEGBINOMDIST Returns the negative binomial distribution
NORMDIST Returns the normal cumulative distribution
NORMINV Returns the inverse of the normal cumulative distribution
NORMSDIST Returns the standard normal cumulative distribution
NORMSINV Returns the inverse of the standard normal cumulative distribution
PEARSON Returns the Pearson product moment correlation coefficient
PERCENTILE Returns the k-th percentile of values in a range
PERCENTRANK Returns the percentage rank of a value in a data set
PERMUT Returns the number of permutations for a given number of objects
POISSON Returns the Poisson distribution
PROB Returns the probability that values in a range are between two limits
QUARTILE Returns the quartile of a data set
RANK Returns the rank of a number in a list of numbers
RSQ Returns the square of the Pearson product moment correlation coefficient
SKEW Returns the skewness of a distribution
SLOPE Returns the slope of the linear regression line
SMALL Returns the k-th smallest value in a data set
STANDARDIZE Returns a normalized value
STDEV Estimates standard deviation based on a sample
STDEVA Estimates standard deviation based on a sample, including numbers, text, and logical values
STDEVP Calculates standard deviation based on the entire population
STDEVPA Calculates standard deviation based on the entire population, including numbers, text, and logical values
STEYX Returns the standard error of the predicted y-value for each x in the regression
TDIST Returns the Student's t-distribution
TINV Returns the inverse of the Student's t-distribution
TREND Returns values along a linear trend
TRIMMEAN Returns the mean of the interior of a data set
TTEST Returns the probability associated with a Student's t-test
VAR Estimates variance based on a sample
VARA Estimates variance based on a sample, including numbers, text, and logical values
VARP Calculates variance based on the entire population
VARPA Calculates variance based on the entire population, including numbers, text, and logical values
WEIBULL Returns the Weibull distribution
ZTEST Returns the one-tailed probability-value of a z-test

Return To Top

DCOUNT, DCOUNTA, DSUM, DPRODUCT, DMAX, DMIN, DAVERAGE, DSTDEV, DSTDEVP,
DVAR, DVARP, DGET

These are the more complex versions of the basic functions like sum, product, max, min, average, count, counta, and are known as database functions. These functions are used to interrogate lists of data held on a worksheet. For selected rows of data, these functions will perform their processing only on records which meet specified criteria.

A B C D E F G H I J
1 Part Number Gross Revenue$ Sales Price$ Order Type Total Qty Issued     Year Month Day
2 =AA123 >1200 >300 TPM       2007 2 15
3 =AA127     I&W       17:34.59 05:34:59 PM  
4               17 34 59
5 Part Number Customer back lot Sales Price$ Order Date Qty Ordered Issued Date Qty Issued Total Qty Issued Order Type Gross Revenue$
6 AA123 2 299.94 1/13/2007 10 2/15/2007 4 13 I&W  $   1,199.76
7 AA123 1 299.94 5/21/2007 7 5/23/2007 5   I&W  $   1,499.70
8 AA128   299.94 9/3/2006 1 9/18/2006 1 1 SALES  $      299.94
9 AB126 1 561.86 7/14/2007 4 8/28/2007 2 2 TPM  $   1,123.72
10 AA127 1 608.96 7/10/2006 3 7/11/2006 1 12 I&W  $      608.96
11 AA127 3 608.96 3/25/2005 7 3/30/2005 6   TPM  $   3,653.76
12 AA123 1 427.68 2/5/2006 2 2/9/2006 3 13 SALES  $   1,283.04
13 AA123 XYZ 397.34 12/2/2007 1 12/26/2007 1   TPM  $      397.34
14 AA127 4 387.66 9/13/2007 9 10/16/2007 4 12 I&W  $   1,550.64
15 AA127 2 302.50 4/14/2007 1 5/15/2007 1   I&W  $      302.50
16                    
17 2 ' it counts how many Part Number AA123 has gross revenue >$1200
=DCOUNT(A5:J15,"Gross Revenue$",A1:B2)
18 1 ' it counts how many Part Number AA123 has Sales Price >$300 and gross revenue >$1200
=DCOUNT(A5:J15,"Sales Price$",A1:C2)
19 3 ' it counts how many of Part Number AA123 which has Sales Price >$300, gross revenue >$1200, is "TPM" order, and together how many of Part Number AA127 which is an "I&W" order, that have qty issued.
=DCOUNTA(A5:J15,"Total Qty Issued",A1:E3)
20 3653.76 ' it returns the maximum gross revenue$ of  Part Number AA123 and Part Number AA127
=DMAX(A5:J15,"Gross Revenue$",A1:A3)
21 302.5 ' it returns the minimum gross revenue$ of  Part Number AA123 and Part Number AA127
=DMIN(A5:J15,"Gross Revenue$",A1:A3)
22 10495.7 ' it returns the sum of gross revenue$ of Part Number AA123 and Part Number AA127
=DSUM(A5:J15,"Gross Revenue$",A1:A3)
23 1191.94 ' it returns the average sum of the gross revenue$ of all Part Numbers (column 10 is Gross Revenue)
=DAVERAGE(A5:J15,10,A5:J15)
24 48 ' it returns the product of Customer back lot of Part Number AA123 and AA127
=DPRODUCT(A5:B15,"Customer back lot",A1:A3)
25 1064.99 ' it returns the estimated standard deviation in the gross revenue from part number AA123 and AA127, if the data in the database is only a sample of the total parts population.
=DSTDEV(A5:J15,"Gross Revenue$",A1:A3)
26 996.21 ' it returns the true standard deviation in the gross revenue from part number AA123 and AA127, if the data in the database is the entire parts population.
=DSTDEVP(A5:J15,"Gross Revenue$",A1:A3)
27 1134202.2 ' it returns the estimated variance in the gross revenue from part number AA123 and AA127, if the data in the database is only a sample of the total parts population.
=DVAR(A5:J15,"Gross Revenue$",A1:A3)
28 992426.89 ' it returns the true variance in the gross revenue from part number AA123 and AA127, if the data in the database is the entire parts population.
=DVARP(A5:J15,"Gross Revenue$",A1:A3)
29 #NUM! ' it returns #NUM! error value because more than one record meets the criteria (ie. having customer back lot)
=DGET(A5:B15,"Customer back lot",A1:A3)
30 2/15/07 ' syntax is DATE(year,month,day).
=DATE(H2,I2,J2)
31 39128 ' To view the number as a serial number, right-click on the cell, select Format Cells... ,select General in the Category box. 2005, Feb 15 is serial number 38398 because it is 38,398 days after 1900, January 1.
=DATE(2007,2,15)
32 15 ' Same as =DAY(39128). The day is an integer ranging from 1 to 31. Date 2007,2,15 is day 15 of the month.
=DAY(DATE(2007,2,15))
33 23 ' Cell F7 date of 5/23/2007 is day 23 of the month.
=DAY(F7)
34 23 ' same result as above formula, i.e. day 23 of the month in cell F7.
=DAY("5/23/2007")
35 6/20/2007 ' it returns a serial number date 20 workdays from 5/23/2007. You have to format the calculated cell(s) to a date format
=WORKDAY("5/23/2007",20)
36 21 ' it returns the number workdays between a start date and an end date (it counts also the start date)
=NETWORKDAYS("5/23/2007","6/20/2007")
37 21 ' it returns a week number that falls numerically within a year, with week begins on Monday (return_type =2)
=WEEKNUM("5/27/2007",2)
38 22 ' it returns a week number that falls numerically within a year, with week begins on Sunday (return_type =1)
=WEEKNUM("5/27/2007",1)
39 7 ' Return_type =1 or omitted, it returns numbers 1 (Sunday) through 7 (Saturday). Return_type =2, it returns numbers 1 (Sunday) through 7 (Saturday). Return_type =3, it returns numbers 0 (Monday) through 6 (Sunday).
=WEEKDAY("5/27/2007",2)
40 5 ' The month is given as an integer, ranging from 1 (January) to 12 (December). Alternatively, you can use either of these formulas =MONTH(F7) , or =MONTH("5/23/2007")
=MONTH(DATE(2007,5,23))
41 2007 ' either of these formulas gives the same year.
=YEAR(F7)   or   =YEAR(DATE(2007,5,23))   or   =YEAR(39225)   or   =YEAR("5/23/2007")
42 17 ' the formula is equal to =HOUR(391280.732627314814815) which actually means 391280 days after 1900, January 1, whereas 0.732627314814815 of a day is exactly the time 17:34:59. Another way of saying, 0.732627314814815 Day is equivalent of 17.5830555555556 Hours (0.732627314814815*24), or 1054.98333333333 Minutes (0.732627314814815*24*60), or 63299 Seconds (0.732627314814815*24*60*60).
=HOUR(DATE(H2,I2,J2)&H3)
43 1.875 ' it returns 1.875 years between 3/30/2005 and 2/15/2007.
=YEARFRAC(F11,F6)
44 34 ' the formulas is the same as =MINUTE("5:34:59 PM").
=MINUTE(I3)
45 39128 ' it returns a serial number of the text date which is, =Text("02/15/2007"), using the 1900 date system.
=DATEVALUE(TEXT(F6,"mm/dd/yyyy"))
46 59 ' it returns the seconds of a date and time value
=SECOND(DATEVALUE(TEXT(F6,"mm/dd/yyyy"))&H3)
47 0.732627314814815 ' The syntax is TIME(hour,minute,second). It returns a decimal number ranging from 0 to 0.99999999, represents the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.). The cell format has to be "General".
=TIME(H4,I4,J4)   or simply, =TIME(17,34,59)
48 0.732627314814815 ' The syntax is TIMEVALUE(time_text). It returns the decimal number of the time represented by a text string. The decimal number is a value ranging from 0 to 0.99999999. The cell format has to be "General".
=TIMEVALUE(TEXT(TIME(H4,I4,J4),"h:mm:ss"))
49 0.732627314814815 ' The following ways return the same time value as the above formula
=TIMEVALUE("15-Feb-2007 5:34:59 PM")    or simply type as,     =TIMEVALUE("5:34:59 PM")
50 MMM-DD,YYYY
hh:mm:ss am/pm
' this returns today's date and the time now (your system time). Format as wrap text.
=TEXT(TODAY(),"mmm-dd,yyyy")&CHAR(10)&TEXT(NOW(),"hh:mm:ss am/pm")

Return To Top

 

Functions of SUMPRODUCT, SUMIF, COUNIF, SUBTOTAL, ROUND, ROUNDUP, ROUNDDOWN, ABS, INT

SUMPRODUCT(array1,array2,array3, ...)

Array1, array2, array3, ... are 2 to 30 arrays whose components you want to multiply and then add.

Syntax are:
SUMPRODUCT((array1=condition1)*(array2=condition2)*(array3)) ,or
SUMPRODUCT((array1=condition1)*(array2=condition2),(array3))
SUMIF(range,criteria,sum_range)
COUNTIF(range,criteria)
SUBTOTAL(function_num, ref1, ref2, ...)


General Array Formula Rules
Array formula must be entered using CTRL+SHIFT+ENTER. The parentheses {} must not be entered manually.
You cannot create or use an array that uses a whole column of cells.
Array formulas cannot handle arrays with more than two dimensions.
Some worksheet functions cannot accept array data types within certain parameters. Examples include COUNTIF(), SUMIF(), COUNTBLANK(), CONCATENATE() and database functions. Only certain functions can aggregate arrays: these include SUM(), COUNT(), AVERAGE(), MAX(), MIN(), PRODUCT(), and TRANSPOSE().
You cannot share an Excel workbook that contains a Array formula that is linked to another workbook.
You cannot create more than 65,472 Array formulas that refer to another worksheet.
You cannot enter an Array formula into a cell if it has already been merged.
SUMPRODUCT() and LOOKUP() are able to convert references to arrays without the need for CTRL+SHIFT+ENTER.

Array Ranges Rules
You have to select the range of cells to hold your results before you input the Array formula.
You cannot change the contents of an individual cell in an array range.
You cannot move or delete part of an array range.
You cannot insert blank cells into an array range.
An array range cannot contain merged cells.

Advantages Of Working With Array Formulas
Array Formulas can perform complex calculations which are not possible with standard formulas.
Array Formulas condense multiple calculations into ONLY ONE CELL thereby reducing the size of a workbook.
A range array calculates more quickly than using individual formulas in each cell inside the range.

Disadvantages Of Working With Array Formulas
Using too many array formulas will reduce the calculation speed of the application.
▪ Other database functions and pivot tables can be your alternatives.

 

Here is one example [see SAMPLE] of nested SUMPRODUCT function I used together with IF, MID, FIND, LEFT, COUNTIF and so on. It finds the quantities by differentiated categories, multiply them by unit costs, then make a summary in just ONLY one cell. Why need so many columns to calculate your result, and wasting time?  DOWNLOAD to see it and learn it.


The following table of data is what I am gonna go through with you on the many examples of SUMPRODUCT, SUMIF AND COUNTIF. You can also DOWNLOAD this worksheet with all the formulas.

  A B C D E F G H J K L M N O P Q R
1 Part Number Customer back lot Sales Price Order Date Qty Ordered Issued Date Qty Issued Total Qty Issued Order Type Discount Disc % Gross Revenue Find PN duplicate Find unique PN Get rid of Dup Find duplicate - by Part Number & Order Type Total Qty Ordered - by Part Number & Order Type
2 AA123 2 $299.94 1/13/2007 10 2/15/2007 4 8 I&W NO 10 $1,199.76 AA123 Dup uniq -DUP- no dup 17
3 AA123 1 $299.94 5/21/2007 7 5/23/2007 3   I&W NO 15 $899.82 AA127 Dup   -DUP-    
4 AA123   $299.94 9/3/2006 1 9/18/2006 1   SALES YES 10 $299.94 8/1/2006 Dup   -DUP- no dup 1
5 AB126 1 $561.86 7/14/2007 4 8/28/2007 2 2 TPM YES 15 $1,123.72     uniq no dup no dup 4
6 AA127 1 $608.96 7/10/2006 3 7/11/2006 1 7 I&W NO 30 $608.96   Dup uniq -DUP- no dup 3
7 AA127 3 $608.96 3/25/2005 7 3/30/2005 6   TPM YES 12 $3,653.76   Dup   -DUP- no dup 7
8 AC129 1 $427.68 2/5/2006 2 2/9/2006 2 2 SALES NO 5 $855.36     uniq no dup no dup 2
9 AA130 XYZ $397.34 12/2/2007 1 12/26/2007 1 1 SALES YES 5 $397.34     uniq no dup no dup 1
10 AA131 4 $387.66 9/13/2007 9 10/16/2007 4 5 TPM NO 50 $1,550.64     uniq no dup no dup 9
11 AA131W 2 $302.50 4/14/2007 1 5/15/2007 1 1 SALES YES 15 $302.50     uniq no dup no dup 1
12                                    
13 Part
Number

STO

STO
Item #
Schedule
Line#
Order
Qty
Requested
Date
Open
Qty
QOH Committed
 Qty
Commit
 Date
  Total
 Ordered
 Qty
Total
 Open
 Qty
         
14 2344-A 4201234 00010 00010 16 11/17/2006 7 1 7 11/19/2006   16 16          
15 2344-A 4201234 00010 00020 16 11/26/2006 5 4 5 11/26/2006                
16 2344-A 4201234 00010 00030 16 1/18/2007 4 3 4 02/02/2007                
17 2344-F 4201765 00010 00010 18 11/24/2006 1 15 1 11/24/2006   18 18          
18 2344-F 4201765 00020 00020 18 12/8/2006 7 15 7 12/13/2006   18            
19 2344-F 4201765 00030 00030 18 1/24/2007 10 15 10 01/25/2007   18            
20 1234-B 4201666 00010 00010 10 10/8/2006 4 12 4 10/08/2006   10 4          
21 1235-C 4201666 00010 00010 10 11/12/2006 10 9 10 11/14/2006   10 10          
22 7234-C 4201555 00010 00010 16 11/12/2006 13 22 13 11/12/2006   16 13          
23 2234-C 4201555 00020 00010 16 12/3/2006 9 20 9 12/03/2006   16 9          
24 415712 4201789 00010 00078 9 10/2/2007 9 0 0 12/17/2007   9 18          
25 415712 4201789 00010 00079 9 11/8/2007 0 0 0 12/17/2007                
26 415712 4201789 00020 00140 9 10/9/2007 9 0 0 12/28/2007   9            
27 415712 4201789 00020 00150 9 11/8/2007 0 0 0 12/28/2007                

To perform an Array Formula, press F2, then press Ctrl+Shift+Enter. The braces {} will be then entered automatically.

SUMPRODUCT((array1="criteria1")*(array2="criteria2")*(array3)) returns the sum of the data in the array3 where the crietria in arrays one and two are met. This can be expanded further.

Having invalid information (eg text) in the array can be ignored using the double unary operator:
SUMPRODUCT(--(array1="criteria1")*(array2="criteria2")*(array3))
.

We can coerce boolean values into 1/0 integers such as : --FALSE = 0 and --TRUE = 1 and these are often used with SUMPRODUCT (i.e. TRUE = 1, FALSE = 0) Arrays must be the same dimensions. Arrays cannot be a whole column, but can be a whole row.

The multiplication operator ' * ' mimics AND. To mimic OR you need the addition operator ' + '. The ' * ' operator won't work on a single array. You can use many variations: '1*', '*1', '^1', '+0' or '--'

Return To Top

NoteFormula result with { } means it is a array formula, and must be entered with pressing Ctrl+Shift+Enter

$1,485.8 ' 10*1199.76 + 7*899.82…etc, to calculate the Weighted Average of the Gross Revenue (i.e., normal Average is affecting each qty ordered).
{=SUMPRODUCT(L2:L11,E2:E11)/SUM(E2:E11)}
93 ' 2*10 + 1*7…etc
{=SUMPRODUCT(B2:B11,E2:E11)}
8 ' total 8 cells are meeting the two criteria
{=SUMPRODUCT(--(LEFT(A2:A11,1)="A"),--(MID(A2:A11,2,1)="A"))}
255 ' the 1st two criteria are TRUE, then perform 3rd array function
{=SUMPRODUCT(--(LEFT(A2:A11,1)="A"),--(MID(A2:A11,2,1)<>"A"),--MID(A2:A11,3,3))}
1139 {=SUMPRODUCT(--RIGHT(A2:A10,3))}          or simply as    {=SUM(--RIGHT(A2:A10,3))}
1016 {=SUMPRODUCT(--(B2:B10>0),--RIGHT(A2:A10,3))}
3 {=SUMPRODUCT((I2:I11="SALES")*(L2:L11>300))}
4 {=SUMPRODUCT((J2:J11="YES")*(C2:C11>300))}
2 {=SUMPRODUCT((A2:A11="AA123")*(G2:G11>1))}
7 {=SUMPRODUCT((A2:A11<>"")/COUNTIF(A2:A11,A2:A11&""))}      ' count the no. of unique data
$9,036.66 {=SUMPRODUCT(((I2:I11="I&W")+(I2:I11="TPM"))*(C2:C11)*(G2:G11))}
$2,767.32 {=SUMPRODUCT((((I2:I11="I&W")+(I2:I11="TPM"))>0)*C2:C11)}
$2,767.32 {=SUM(SUMIF(I2:I11,{"TPM","I&W"},C2:C11))}
$10,891.80 {=SUMPRODUCT((C2:C11)*(G2:G11))}
$10,891.80 {=SUM((C2:C11)*(G2:G11))}          or simply as   {=SUM((C2:C11)*(G2:G11))}
$1,608.74 {=SUMPRODUCT((G2:G11=1)*(LEFT(A2:A11,2)="AA")*C2:C11)}
$4,650.00 {=SUMPRODUCT((F2:F11>=M4)*(LEFT(A2:A11,2)="AA")*L2:L11)}
$3,374.20 {=SUMPRODUCT((F2:F11>=M4)*(C2:C11>300),L2:L11)}
$6,662.24 {=SUMPRODUCT((A2:A11=M2)*(L2:L11))+SUMPRODUCT((A2:A11=M3)*(L2:L11))}
$6,662.24 {=SUMIF(A2:A11,M2,L2:L11)+SUMIF(A2:A11,M3,L2:L11)}
$5,773.72 {=SUMIF(F2:F11,">"&DATE(2006,8,1),L2:L11)}
$5,076.44 {=SUMIF(F2:F11,"<"&DATE(2007,12,1),L2:L11)-SUMIF(F2:F11,"<"&DATE(2006,12,31),L2:L11)}
$9,662.56 {=SUMPRODUCT((F2:F11<DATE(2007,12,1))*(L2:L11-(L2:L11/K2:K11)))}
$4,770.38 {=SUMPRODUCT((F2:F11<DATE(2007,12,1))*(L2:L11-(L2:L11/K2:K11)))-SUMPRODUCT((F2:F11
<DATE(2006,12,31))*(L2:L11-(L2:L11/K2:K11)))}
$5,358.20 {=SUMPRODUCT((F2:F11>M4)*(L2:L11-(L2:L11/K2:K11)))}
($7,888.30) {=SUMPRODUCT((G2:G11*C2:C11)-(E2:E11*C2:C11))}
$8,183.26 {=SUM(L2:L11*((I2:I11="SALES")+(I2:I11="TPM")))}
$18,780.10 {=SUM(C2:C11*E2:E11)}         ' (C2*E2)+C3*E3)+…C11*E11) which is the same result as  SUMPRODUCT((C2:C11),(E2:E11))
70 {=SUM({1;2;3;4}*{5;6;7;8})}      ' (1*5)+(2*6)+…(4*8) which is has the same result as  SUMPRODUCT({1;2;3;4},{5;6;7;8})
11 =SUMIF(I2:I11,"SALES",B2:B11)+SUMIF(I2:I11,"TPM",B2:B11)       ' back lot for SALES & TPM
11 {=SUM(IF(ISNUMBER(B2:B11),(B2:B11)*((I2:I11="SALES")+(I2:I11="TPM"))))}          ' back lot for SALES & TPM
Note: without using IF and ISNUMBER, you will get #VALUE!  This is because of cell XYZ is non-numeric or the blank cell may be just an invisible cell with memory space
8 ' the same formula for cell H2, total the sum of qty issued base on criteria cell $M$2
{=IF(A2=A1,"",SUMPRODUCT(($A$2:$A$11=$M$2)*($G$2:$G$11)))}
8 ' the same formula for cell H2, total the sum of qty issued base on criteria cell $A2
{=IF(A2=A1,"",IF(ISERROR(SUMPRODUCT(($A$2:$A$11=$A2)*($G$2:$G$11))),0,SUMPRODUCT(($A$2:$A$11=$A2)*($G$2:$G$11)))
+IF(ISERROR(SUMPRODUCT(($A$2:$A$11=$A2&"W")*($G$2:$G$11))),0,SUMPRODUCT(($A$2:$A$11=$A2&"W")*($G$2:$G$11))))}
8 ' the same formula for cell H2
{=IF(SUBSTITUTE(A1,"W","")=SUBSTITUTE(A2,"W",""),"", SUMIF($A$2:$A$11,LEFT(A2,5)&"*",$G$2:$G$11))}
8 ' the same formula for cell H2
{=IF(SUBSTITUTE(A2,"W","")=SUBSTITUTE(A1,"W",""),"", SUMPRODUCT(--(SUBSTITUTE($A$2:$A$11,"W","")=SUBSTITUTE(A2,"W","")),--(LEN($E$2:$E$11)>0),($G$2:$G$11)))}
duplicate (AA123, I&W) ' find the duplicates
{=IF(SUMPRODUCT(($A$2:$A$11=A2)*($I$2:$I$11=I2))>1,"duplicate ("&A2&", "&I2&")","")}
47% {=SUMPRODUCT(((J2:J11="YES")*(C2:C11>300)),K2:K11/100)}
4 ' count the number of order type "SALES"
{=COUNTIF(I2:I11,"SALES")}
Dup ' to find all duplicate part numbers in column 1, copy this formula from N2 to N11
=IF(A2="","",IF(COUNTIF($A$2:$A$11,A2) <=1,"","Dup"))
uniq ' to list out all unique part numbers, and include only single incident of duplicates PN, copy this from cell O2 to O11
=IF(COUNTIF($A$2:A2,A2)>1,"","uniq")
-DUP- ' to list out all purely unique part numbers, copy this down from cell P2 to P11
=IF(COUNTIF($A$2:$A$11,A2) >1,"-DUP-","no dup")
8 ' it counts how many numbers are in the list of arguments B2:B11
=COUNT(B2:B11)
9 ' it counts how many values are in the list of arguments B2:B11
=COUNTA(B2:B11)
1 ' it counts the number of blank cells within the range B2:B11
=COUNTBLANK(B2:B11)
no dup ' copy from Q2 down, to find non-duplicate occurrences by "Part Number" and by "Order Type"
{=IF(AND(A2=A1,I2=I1),"",IF(SUMPRODUCT(($A$2:A11=A2),($I$2:I11=I2))>1,"","no dup"))}
17 ' copy down from R2, to get Total Qty Ordered - by non-repeated occurrences of Part Number & Order Type
{=IF(AND(A2=A1,I2=I1),"",SUMPRODUCT(($A$2:A11=A2)*($I$2:I11=I2),($E$2:E11)))}
16 ' formula for cell M14, total sum of "Total OpenQty" base on criteria cell $A14
{=IF(A14=A13,"",SUMPRODUCT(($A$14:$A$27=$A14)*($G$14:$G$27)))}
16 ' formula for cell L14, total sum of "Total OrderQty" base on criteria cell $A14, $B14, $A14, and another elseIf condition
{=IF(SUMPRODUCT(--($A$13:$A$27=$A14),--($B$13:$B$27=$B14),--($C$13:$C$27=$C14))=1,$E14,IF(AND($C14<>$C13,$L13<>$E14),$E14,""))}
16 ' same as above, the formula for cell L14, total sum of "Total OrderQty" base on criteria cell $A14, $B14, $A14, and another elseIf condition
{=IF(SUMPRODUCT(--($A$13:$A$27=$A14),--($B$13:$B$27=$B14),--($C$13:$C$27=$C14))=1,$E14,IF(OR($B14<>$B13,$C14<>$C13,$E14<>$E13),$E14,""))}
419.478 SUBTOTAL(function_num, ref1, ref2, ...). Function_num is the number 1 to 11 (includes hidden values) that specifies
which function to use in calculating subtotals within a list.
=SUBTOTAL(1,C2:C11)    ' to calculate the Average of the range C2:C11
8 =SUBTOTAL(2,B2:B11)    ' to count how many numbers are in the arguments C2:C11
9 =SUBTOTAL(3,B2:B11)    ' to count how many values are in the arguments C2:C11
4 =SUBTOTAL(4,B2:B11)    ' to return the Maximum value in the arguments C2:C11
1 =SUBTOTAL(5,B2:B11)    ' to return the Minimum value in the arguments C2:C11
6720 =PRODUCT(SUBTOTAL(6,G2:G5),SUBTOTAL(6,E2:E5))      ' SUBTOTAL(6,ref1) is to return the Product, ie. to multiply its arguments
3.472111109 =SUBTOTAL(7,E2:E11)    ' to estimate the Standard Deviation base on the sample argument E2:E11
3.293933818 =SUBTOTAL(8,E2:E11)    ' to calculate the Standard Deviation base on the entire population E2:E11
15 =SUBTOTAL(9,B2:B11)    ' to return the SUM of its arguments B2:B11
12.05555556 =SUBTOTAL(10,E2:E11)     ' to estimate the Variance base on the sample argument E2:E11
10.85 =SUBTOTAL(11,E2:E11)    ' to calculate the Variance base on the entire population E2:E11
$1,199.80 =ROUNDUP(L2,1)    ' it rounds the number in L2 up to one decimal place
$1,199.00 =ROUNDDOWN(L2,0)    ' it rounds the number in L2 down to zero decimal places
$1,200.00 =ROUND(L2,-2)     ' it rounds $1,199.76 to one decimal place to the left of the decimal point
$1,200.00 =ROUNDUP(L2,-1)    ' it rounds $1,199.76 to one decimal place to the left of the decimal point
8 =ABS(B2-E2)    ' it returns the absolute value of a number (2-10)
12345 =INT(12345.6789)    ' it rounds a number down to the nearest integer

Return To Top

Format of SUMPRODUCT

This syntax is what we first learnt of:
=SUMPRODUCT((array1=condition1)*(array2=condition2)*(array3))

But, we could also use this:
=SUMPRODUCT((array1=condition1)*(array2=condition2),(array3))
which works as the '*' operator is only required to coerce the conditional arrays that resolve to TRUE/FALSE into 1/0 integers.

As it the use of a arithmetic operator that coreces the TRUE/FALSE values to 1/0, we could use many different operators and achieve
the same result. Thus, it is also possible to coerce each of the conditional arrays individually by multiplying them by 1.
=SUMPRODUCT((array1=condition1)*1,(array2=condition2)*1,(array3))
or
=SUMPRODUCT(1*(array1=condition1),1*(array2=condition2),(array3))
or by raising to the power of 1,
=SUMPRODUCT((array1=condition1)^1,(array2=condition2)^1,(array3))
or by adding 0,
=SUMPRODUCT((array1=condition1)+0,(array2=condition2)+0,(array3))
or
=SUMPRODUCT(0+(array1=condition1),0+(array2=condition2),(array3))
or even by using the N function,
=SUMPRODUCT(N(array1=condition1),N(array2=condition2),(array3))

To preserve SUMPRODUCT arrays with multiple conditions that are separated by the comma, you can use -- on both conditions like:
=SUMPRODUCT(--(B2:B11>0),--RIGHT(A2:A11,3))

If you multiply two arrays of TRUE/FALSE, that would coerce to 1/0 values which are then summed, and you could then use the ' * '
=SUMPRODUCT((I2:I11="SALES")*(L2:L11>300))

Any further, final, array of values can use the same operator, or could revert to comma. So your formula can be written as:
=SUMPRODUCT(--(LEFT(A2:A11,1)="A"),--(MID(A2:A11,2,1)<>"A"),MID(A2:A11,3,3)*1)
or
=SUMPRODUCT(--(LEFT(A2:A11,1)="A"),--(MID(A2:A11,2,1)<>"A"),--MID(A2:A11,3,3))
or
=SUMPRODUCT((B2:B11>1)*(E2:E11>2)*(C2:C11))
or
=SUMPRODUCT((B2:B11>1)*(E2:E11>2),(C2:C11))

Return To Top

 

IF, ISNUMBER, AND, OR, NOT, SEARCH, FIND, MID, LEFT, RIGHT, LEN, MAX,
SUBSTITUTE, REPLACE, TEXT, TRIM, CONCATENATE, LOWER, UPPER, PROPER,
CHAR, CODE, VALUE, EXACT, DOLLAR, T, FIXED


FIND(find_text,within_text,start_num)
    
 start_num specifies the character at which to start the search. The first character in within_text is character number 1
SEARCH(find_text,within_text,start_num)
     
start_num is the character number in within_text at which you want to start searching.
SUBSTITUTE(text,old_text,new_text,instance_num)
     
Instance_num specifies which occurrence of old_text you want to replace with new_text
REPLACE(old_text,start_num,num_chars,new_text)

  A B C D E F G H I J K L M N O
1 Ship Date Assembly ID Part ID Purch Req. Qty (PR) Target Safety Stock Level (TSS) Qty On-
Hand (OH)
Open Purch Order Qty (PO) Open Sales Order Qty (SO) In-
Transit Qty  (IT)
QOH /TSL Local MOU Unit Cost    Remark

Extended Cost

 
2 3/26/06 20163R01-DC-PROJ 20163 1 2 2 0 5 1 0.5 0 1426.12 4  $5,704.48 3 1/2
3 7/28/04 P833R02-PE-PROJ P833 5 6 1 5 0 0 0.2 0 29319 just nice!  $0.00 7.25%
4 4/12/05 CA78R05-DC-PROJ CA78 3 3 3 1 1 2 1.0 0 5445 IT_excess 1  $5,445.00 25-Dec-2006
5 12/8/03 9267R2-PROJ 9267 6 3 3 1 1 1 1.0 0 2222.09 just nice!  $0.00 TRUE
6 5/22/02 L514R1-WA-PROJ L514 11 3 4 0 0 0 1.3 0 3025.62 OH_excess 1  $3,025.62 FALSE
7 6/26/07 9895-PROJ 9895 1 3 3 0 0 2 1.0 9 3446.37 IT_excess 2  $6,892.74  
8 1/11/03 20207-DELTA-RPD 20207 1 3 1 0 2 0 0.3 3 13885.96 4  $55,543.84  
9 7/28/06 P853-PROJ P853 1 3 0 0 0 0 0.0 0 32663.95 3  $97,991.85  
10 6/22/02 802982-PE-PROJ 802982 1 3 2 0 0 0 0.7 2 30250 1  $30,250.00  
11 3/15/06 CA66R-PROJ CA66 60 3 5 0 0 0 1.7 12 29959.6 OH_excess 2  $59,919.20  
12 2/25/04 320164R-XC-PROJ 320164 1 3 5 1 0 1 1.7 11 32391.7 OH_excess 3  $97,175.10  
13 11/1/05 W824 W824 1 3 4 0 0 0 1.3 11 30552.5 OH_excess 1  $30,552.50  
14 6/1/06 QX1124 QX1124 1 3 0 0 0 0 0 0 13278.2 3  $39,834.60  
15 4/17/07 319212RR04-DP-PROJ 319212 8 3 2 3 0 3 0.7 5 29959.6 PO_excess 2  $59,919.20  
16 2/13/05 414262R1-WK-PROJ 414262 2 3 7 2 2 0 2.3 7 28435.6 OH_excess 4  $113,742.40  
17   AMSEA6563117000                          
18   ("\Applied -Materials/"")                          

Return To Top

Note: when using SEARCH or FIND to obtain True (found) or False (not found) it will be necessary to test for ISNUMBER to eliminate the return of "#VALUE!" if not found.

You can also DOWNLOAD this demo worksheet here.

20163 This formula extracts part ID from the text string of Assembly ID in column B
=IF(AND(NOT(ISNUMBER(--MID(B2,FIND("-",B2)-1,1))),ISNUMBER(--MID(B2,FIND("-",B2)-3,2))),LEFT(B2,FIND("-",B2)-2),IF(AND(ISNUMBER(VALUE(MID(B2,FIND("-",B2)-2,2))--MID(B2,FIND("-",B2)-4,1)),NOT(ISNUMBER(--MID(B2,FIND("-",B2)-3,1)))), LEFT(B2,FIND("-",B2)-4),IF(AND(ISNUMBER(--MID(B2,FIND("-",B2)-1,1)--MID(B2,FIND("-",B2)-3,1)),NOT(ISNUMBER(--MID(B2, FIND("-",B2)-2,1)))),LEFT(B2,FIND("-",B2)-3),IF(ISNUMBER(--MID(B2,FIND("-",B2)-3,3)),LEFT(B2,FIND("-",B2)-1),IF(ISNUMBER( --RIGHT(B2,3)),MID(B2,1,LEN(B2)),IF(ISNUMBER(--(LEFT(B2,6))),LEFT(B2,6),B2))))))
 $  5,704.48 Extract number from column 'Remark', multiply it by Unit Cost
=IF(ISNUMBER(M2),M2*L2,IF(MID(M2,3,1)="_",MID(M2,SEARCH(" ",M2)+1,LEN(M2))*L2,0))
TRUE If the string extracted from cell B8 from position 1 to 5 (which is 20207) is numeric, it gives a TRUE statement
=ISNUMBER(N(MID(B8,1,FIND("-",B8)-1)))
TRUE Same as above. ISNONTEXT is the equivalent of ISNUMBER
=ISNONTEXT(N(MID(B8,1,FIND("-",B8)-1)))
TRUE If the string extracted from cell B8, from position 6 onward (which is -DELTA-RPD) is a text, it gives TRUE statement
=ISTEXT(MID(B8,FIND("-",B8),LEN(B8)))
there's no Ship Date If cell A17 is blank, offset from C17 to A1 gives you the content in cell A1. Use the "&" Operator to join the strings
=IF(ISBLANK(A17),"there's no "&OFFSET(C17,-16,-2,1,1))

9895-PROJ has found no match

Cell B7 lookup value gives #N/A error, concatenate strings using & operator.
=IF(ISNA(VLOOKUP(B7,C:M,11,FALSE)),B7&" has found no match")

A2-B2 gives #VALUE!

Cell A2 is date, B2 is text, substracting B2 from A2 gives you #VALUE! error
=IF(ISERR(A2-B2),"A2-B2 gives #VALUE!")
TRUE ISERROR function take care of #DIV/0! (A2/0), #VALUE! (A2-B2), #N/A and #REF! errors
=ISERROR(OR(A2/0,A2-B2,MATCH("Part*",B2:B3,0),VLOOKUP(B13,C:D,4,FALSE)))
TRUE ISLOGICAL returns a boolean statement TRUE if the preceding cell 30 value is also TRUE
=ISLOGICAL(ISERROR(OR(A2/0,A2-B2,MATCH("Part*",B2:B3,0),VLOOKUP(B13,C:D,4,FALSE))))

20164

If in cell C2, its 1st position is an Even number and its last is an ODD number, then add the whole number by 1
=IF(AND(ISODD(--RIGHT(C2,1)),ISEVEN(--LEFT(C2,1))),MID(C2,1,LEN(C2)-1)&RIGHT(C2,1)+1)
4 'Populate Column M under header "Remark", base on data range from column E to I. Note the use of AND, OR, NOT operators
in combination with nested IF (total 14 in this example) which Excel spreadsheet only allow you maximum of 7 nested IF.
=IF(AND((F2+MAX(G2,I2))=(E2+H2),I2<=G2),"just nice!",IF(AND(OR((F2+MAX(G2,I2))>(E2+H2),(F2+I2)=(E2+H2)),I2>G2),"IT_excess "&(F2+I2)-(E2+H2),IF(AND((F2+MAX(G2,I2))>(E2+H2),G2>=F2),"PO_excess "&(F2+MAX(G2,I2))-(E2+H2),IF(AND((F2+MAX(G2,I2))>(E2+H2),F2>G2,F2>I2),"OH_excess "&(F2+MAX(G2,I2))-(E2+H2),IF(AND((E2+H2)>(F2+MAX(G2,I2)),I2<=G2),(E2+H2)-(F2+G2),IF(NOT(AND((E2+H2)>(F2+G2),I2<=G2)),(E2+H2)-(F2+I2),"please check!"))))))
3.5
0.0725
39076
1
0
=N(O2)    ' converts numeric entry 3 1/2 to its mathematical value.
=N(O3)    ' converts numeric entry 7.25% to its mathematical value.
=N(O4)    ' converts numeric entry 3 1/2 to its mathematical value.
=N(O5)    ' converts TRUE to its mathematical value.
=N(O6)    ' converts FALSE to its mathematical value.
#N/A
  
=IF(ISBLANK(O1),NA(),C7)     ' NA() is a place marker used to indicate that required information is Not Available.
  
AMSEA:
65-6311-7000
Using Left/Mid/Right to concatenate string in cell B17 to telephone no. format as AMSEA: XX-XXXX-XXXX
=LEFT(B17,5)&": "&CHAR(10)&MID(B17,6,2)&"-"&MID(B17,8,4)&"-"&RIGHT(B17,4)
11 =FIND("-",B15)
319212RR04 Extract a string from cell B15, starting from position 1 to 10
=MID(B15,1,FIND("-",B15)-1)
319212RS04 Substitutes the second instance of "R" with "S" from the extracted string in B15
=SUBSTITUTE(MID(B15,1,FIND("-",B15)-1),"R","S",2)
Applied Materials =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(BC18,"(",""),")",""),"-",""),"""",""),"/",""),"\","")
AMSEA DID: 63117000 Replaces 2 characters with " DID: ", starting with the 6th character
=REPLACE(B17,6,2," DID: ")
  
$29,319 The # placeholder displays a number or nothing if it is an insignificant zero. We then have the thousand separator (,), followed
by two further placeholders for numbers which will not show insignificant zeros, (##). If you use =TEXT(1*L3,"$#,###.00") the
answer will be $29,319.00

=TEXT(1*L3,"$#,###.##")
$2,852.24 The # placeholder displays a number or nothing if it is an insignificant zero. The next placeholder is a zero (0), this will
show either the number entered or an insignificant zero. We have a further two place holders (00), that will show two
decimal places or insignificant zeros if there is no entry.

=TEXT(F2*L2,"$#,###.00")
16.7% =TEXT(F3/E3,"##.#%")
 
02:4:18 Calculate the number of years, months and days between the two dates
=TEXT(A2-A5,"y:m:d")
Ship Date,Assembly-ID Joinning Cell A1 and B1 with characters "," and "-"
=CONCATENATE(A1,",",MID(B1,1,FIND(" ",B1)-1),"-"&RIGHT(B1,2))
PART ID It removes all spaces from a string text except for single spaces between words.
=TRIM(" Part ID ")
Remark It remove spaces from the beginning and end of Cell M1
=TRIM(M1)
ship date
SHIP DATE
Ship Date
Changing the Cases of text. Format your cell with wrap text.
=LOWER(A1)&CHAR(10)&UPPER(A1)&CHAR(10)&PROPER(LOWER(A1))
  
P-ART The function CHAR() returns the character specified by the ASCII code number. CHAR(45) returns "-"
=LEFT(C1)&CHAR(45)&UPPER(MID(C1,2,3))                               Download 255 Excel Characters Code
WilliamTan It removes any non-printable characters from text, so that it reads as WiliamTan.
Suppose the non-printable characters are in a cell, in that case you simply include that cell. Eg., CLEAN(A2)

=CLEAN("WilliamYTan")
45 Display the numeric code for "-"
=CODE("-")
606 It converts a text string that represents a number to a number. 38802 is 3/26/2006, 38196 is 7/28/04. 606 is the days
difference between the two dates.

=VALUE(A2)-VALUE(A3)
TRUE Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise. EXACT is case-sensitive.
=EXACT(RIGHT(B1,2),RIGHT(C1,2))
$1,426.120
$1,400
Ihe syntax is DOLLAR(number,decimals). Decimals is the number of digits to the right of the decimal point.
If decimals is negative, number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.

=DOLLAR(L2, 3)
=DOLLAR(L2, -2)
20163R01-DC-PROJ T(Value) returns the text referred to by value. If the value is a number or date format, T returns "" (empty text) as in
this example
=T(C2). However, =T(B2) will show its text value as 20163R01-DC-PROJ
1,426.1
1,430
1,400
It rounds a number to the specified number of decimals, formats the number in decimal format using a period and
commas, and returns the result as text.

=FIXED(L2, 1)
=FIXED(L2, -1)
=FIXED(L2, -2)
2
3
4
5
6
7
=ERROR.TYPE(H2/H3)                       ' as (H2/H3) gives error value #DIV/0! and it returns 2
=ERROR.TYPE(A2/B2)                       ' as (A2/B2) gives error value #VALUE! And it returns 3
=ERROR.TYPE(sheetA!A2)                ' as sheetA!A2 gives error value #REF! And it returns 4
=ERROR.TYPECELLS(A2+B2)                                ' as CELLS(A2+B2) gives error value #NAME? And it returns 5
=ERROR.TYPE(RATE(100,25.25,60)*12)                ' as RATE(100,25.25,60)*12 gives error value #NUM! And it returns 6
=ERROR.TYPE(vlookup(A1,B2:N16,14,false)          ' as (A2/B2) gives error value #N/A And it returns 7
1
2
4
16
64
=TYPE(O2)      ' returns 1 if value type is number
=TYPE(N1)      ' returns 2 if value type is text
=TYPE(O5)     ' returns 4 if value type is a logical value
=TYPE(O7)     ' returns 16 if value type is an error value
=TYPE({1,2,3;4,5,6})     ' returns 64 if value type is an Array

$A$2
5
3
v
38802
"
1
0
1
20
D:\MyData\MySheet
D4
 
CELL(info_type,reference) returns information about the formatting, location, or contents of the cell.
=CELL("address",A2)      ' returns cell address
=CELL("row",C5)             ' returns row number
=CELL("row",C5)             ' returns column number
=CELL("type",A2)             ' returns type of data in cell A2 is "v", a value
=CELL("contents",A2)     ' returns actual value of cell A2 which is a date; so it returns a serial number of the text date, using 1900 data system.
=CELL("prefix",D1)          ' returns alignment of the cell: ' for left, ^ for centre, " for right whereas nothing is shown for numeric entries.
=CELL("protect",A2)        ' returns 0 if the cell is not locked, and 1 if the cell is locked.
=CELL("parentheses",N2)     ' returns 1 if the cell is formatted with parentheses for positive or all values; otherwise returns 0.
=CELL("color",N2)            ' returns 1 if the cell is formatted in color for negative values; otherwise returns 0.
=CELL("width",A2)           ' returns width of the cell.
=CELL("filename",A2)     ' returns filename (including full path) of the file that contains reference; returns empty if worksheet not yet saved.
=CELL("format",A2)        ' returns "-" at the end of the text value if the cell is formatted in color for negative values. Returns "()" at the end of the
text value if the cell is formatted with parentheses for positive or all values.

Return To Top

The following list describes the text values CELL returns when info_type is "format", and reference is a cell formatted with a built-in number format.

Numeric Format   Code
General    G
0   F0
#,##0    ,0
0.00   F2
#,##0.00    ,2
$#,##0_);($#,##0)    C0
$#,##0_);[Red]($#,##0)    C0-
$#,##0.00_);($#,##0.00)   C2
$#,##0.00_);[Red]($#,##0.00)  C2-
0%   P0
0.00%   P2
0.00E+00   S2
# ?/? or # ??/??   G
m/d/yy or m/d/yy h:mm or mm/dd/yy. D4
d-mmm-yy or dd-mmm-yy   D1
d-mmm or dd-mmm   D2
mmm-yy    D3
mm/dd   D5
h:mm AM/PM    D7
h:mm:ss AM/PM    D6
h:mm    D9
h:mm:ss    D8

 


      MATCH, OFFSET, INDIRECT, VLOOKUP, ROWS, MOD, ROW, INT,

MATCH(lookup_value,lookup_array,match_type)

    
 Returns the relative position of an item in an array that matches a specified value in a specified order.
          If match_type is 1, MATCH finds the largest value that is <= lookup_value. Lookup_array must be in ascending order.
          If match_type is 0, MATCH finds the first value that is exactly equal to lookup_value. Lookup_array can be in any order.
          If match_type is -1, MATCH finds the smallest value that is >= lookup_value. Lookup_array must be in descending order.
          If match_type is omitted, it is assumed to be 1.

OFFSET(reference, rows, cols, height, width)

      Reference is where you want to base the offset. Reference must refer to a cell or range of cells (otherwise it returns #VALUE!)
      Rows is the number of rows, up or down, that you want the Reference to point to.
      Cols is the number of columns, left or right, that you want the Reference to point to.
      Height=no. of rows you want the returned reference (must be +ve)
      Width=no. of columns you want the returned reference (must be +ve)

INDEX(reference,row_num,column_num,area_num)
      Returns the reference of the cell at the intersection of a particular row and column.
      Row_num is the number of the row in reference from which to return a reference.
      Column_num is the number of the column in reference from which to return a reference.
      Area_num selects a range in reference from which to return the intersection of row_num and column_num.
         The first area selected or entered is numbered 1, the second is 2, and so on. If area_num is omitted, INDEX uses area 1.

VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
      Lookup_value - the value to search in the first column of the table array.
      Table_array - two or more columns of data.
      Col_index_num - the column number in table_array from which the matching value must be returned.
      Range_lookup - a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match:
           a) If TRUE or omitted, an exact or approximate match is returned.
           b) If an exact match is not found, the next largest value that is less than lookup_value is returned.
               (the values in the first column of table_array must be placed in ascending sort order).
           c) If FALSE, VLOOKUP will only find an exact match. In this case, the values in the first column of table_array do not need to be sorted.
               If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used.
               If an exact match is not found, the error value #N/A is returned.

ADDRESS(row_num,column_num,abs_num,a1,sheet_text)
      Creates a cell address as text, given specified row and column numbers.
      Row_num is the row number to use in the cell reference.
      Column_num is the column number to use in the cell reference.
      Abs_num Returns this type of reference
          1 or omitted Absolute
          2 Absolute row; relative column
          3 Relative row; absolute column
          4 Relative
      A1 is a logical value, If a1 is TRUE or omitted, ADDRESS returns an A1-style reference; if FALSE, ADDRESS returns an R1C1-style reference.
      Sheet_text is text specifying the name of the worksheet to be used as the external reference. If sheet_text is omitted, no sheet name is used.

ROWS(array)
      returns the number of rows in a reference or array.

MOD(number,divisor)
      returns the remainder after number is divided by divisor. The result has the same sign as divisor.

ROW(reference)
      returns the row number of a reference.

INT(number)
      rounds a number down to the nearest integer.


You can DOWNLOAD this demo worksheet.

Return To Top

Sheet1   Sheet2
  A B C D E F G H   A B C D E F
1 SN Part ID Part ID Unit Cost$ Q3 Revenue $ mth-3 Total Used

Total Used

  1 Part ID mth-3 mth-2 mth-1 Total Used
2 1 00020163 20163 1426.12 16652.7 0 0 0   2 P833 4 3 4 11  
3 2 P833 P833 29319 13877.4 6 21 21   3 P833W 2   8 10  
4 3 CA78 CA78 5445 12931.2 0 0 0   4 9895 8   1 9  
5 4 00009267 9267 2222.09 95449.1 0 0 0   5 802982     6 6  
6 5 L514 L514 3025.62 8665.5 0 0 0   6 L512   5 1 6  
7 6 00009895 9895 3446.37 6326.3 8 9 9   7 P853 1 2 2 5  
8 7 00020207 20207 13885.96 6542.7 0 0 0   8 D4168   4   4  
9 8 P853 P853 32663.95 1203.8 1 5 5   9 C5895 2     2  
10 9 00802982 802982 30250 755.2 0 6 6   10            
11 10 CA66 CA66 29959.6 105.8 0 0 0                
12                                
1 =ROWS($A$2:$A2)  ' serializing from cell A2 down, starts with numeric 1
  2 =ROWS($A$2:$A3)  ' copy down serializing from cell A2 as above to A3
  11 =INT((ROW()-4)*1.1)   ' serializing starting with row 11
 
 
The formula applies cell shading to every other row in a range. First select your range, then in the Conditional Formatting dialog box, select "Formula Is" from the dropdown listbox, enter the following formula in text box, click "Format", then select the pattern color. Copy the formatted range to any other range. In this example, it shows the shaded yellow color in every alternate rows.
=MOD(ROW(),2)=0          '  change from 2 to 4 means it will copy your format to every alternate 4 rows.
  2 MOD function calculates the remainder after a number has been divided by another number. Row(A10) gives you 10, and 10/4 =2
=MOD(ROW(A10),4)
  1 =COLUMNS($C$1:C$1)     ' returns the number of columns in a reference or an array.
  11 To count the number of rows with data in column A. 9.999999999E+307 is the largest number excel can store in a cell. Often referred to as BigNum.
=MATCH(9.999999999999+307,A:A)
  3 Using 0 will look for an exact match. If no match is found the #NA error will be shown. Using 1 will look for an exact match, or the next lowest number if no exact match exists. ' If there is no match or next lowest number the error #NA is shown.
{=MATCH("Part ID",A1:H1,1)}
  2 {=MATCH("Part ID",A1:H1,-1)}
  2 For match_type is 0 and lookup_value is text: you can use a question mark to match any single character; or an asterisk to match any sequence of characters.
{=MATCH("Part*",A1:H1,0)}
  #N/A {=MATCH(1203.8,E2:E11,1)}   ' Returns #N/A because E2:E11 is not in ascending order
  #N/A {=MATCH("P834",C2:C11,0)}   ' Returns #N/A because no exact match of "P834" is found
  7 {=MATCH(5000,E2:E11,-1)}     ' The position of 7 in the range E2:E11 in descending order
  56 =SUM(OFFSET(B1,1,4,11,2))   ' sum of Month-2 to Month-3
  56 =SUM(OFFSET(B1:B11,1,4,11,2))   ' same as sum of Month-2 to Month-3
  76609.7 =SUM(E2:OFFSET(B1,11,3))   ' sum of revenue$
  8665.5 {=OFFSET(C1,MATCH(AVERAGE(E2:E11),E2:OFFSET(E12,-1,0),-1),2)}    ' average 7660.97 of revenue is in position 5
  802982 It finds the largest number (i.e., the largest numerical last cell) from last cell with numbers from column C.
9.999999999E+307 is the largest number excel can store in a cell.
=LOOKUP(9.9999999999999E+307,C:C)
  CA66 Using Horizontal Lookup value of CA78 in C4, for the value on the 8th position in the range from C4 to C11
=HLOOKUP(B4,C4:C11,8,FALSE)
  21 In cell G3, using VLOOKUP to look for total usage of ID P833 in Sheet2
=IF($B3="","",IF(ISERROR(VLOOKUP($B3,Sheet2!$A:$E,5,FALSE)),0,VLOOKUP($B3,Sheet2!$A:$E,5,FALSE))
+IF(ISERROR(VLOOKUP($B3&"W",Sheet2!$A:$E,5,FALSE)),0,VLOOKUP($B3&"W",Sheet2!$A:$E,5,FALSE)))
  21 In cell H3, using OFFSET & MATCH to look for total usage of ID P833 in Sheet2
=IF($C3="","",IF(ISERROR(OFFSET(Sheet2!$A$1,MATCH(Sheet1!$C3,Sheet2!$A$2:$A$200,0),4)),0,OFFSET(Sheet2!
$A$1,MATCH(Sheet1!$C3,Sheet2!$A$2:$A$200,0),4)) +IF(ISERROR(OFFSET(Sheet2!$A$1,MATCH(Sheet1!
$C3&"W",Sheet2!$A$2:$A$200,0),4)),0,OFFSET(Sheet2!$A$1,MATCH(Sheet1!$C3&"W",Sheet2!$A$2:$A$200,0),4)))
  20207 The intersection of the row 7 and column 3 in the range A2:C8, which is value of cell C8
=INDEX(A2:C8,7,3)
  755.2 The intersection of the row 4 and column 2 in the 3rd range area of D7:E11, which is value of 755.2 in cell E10
=INDEX((C2:E5,G2:H11,D7:E11),4,2,3)
  D4168 The intersection of the row 8 and column 1 in Sheet2 range area of $A$4:$A$9, which is D4168 in Sheet2 cell A8
=INDEX(Sheet2!$A$4:$A$9,ROWS($A$1:A3)+1)
  53 The sum of column 5 in Sheet2 in the first area range $A2:$E9, which is the sum of E2:E9 (=53)
Note: when you set row_num or column_num to 0 (zero), INDEX returns the reference for the entire column or row, respectively.
=SUM(INDEX(Sheet2!A2:E9,0,5,1))
  76609.7 The sum of the range starting at cell E2, and ending at the intersection of  row 10 and the column 5 of range A2:H11, which is the sum of E2:E11
=SUM(E2:INDEX(A2:H11,10,5))
  991,536.1 Sum of the product of "Unit Cost" range area D2:D11 and "TotalUsed" range area H2:H11
=SUMPRODUCT((D2:INDEX(A2:H11,10,4))*(H2:H11))
  SN =INDIRECT("A"&$F$9)    ' Value of a reference in cell F9 (1)
  16652.7 =INDIRECT(ADDRESS(2,5,2))   ' Indirect reference of the cell E2 in Absolute row; Relative column (E$2)
  ([Book1]Sheet1!R2C5) Absolute reference to this workbook and worksheet ([Book1]Sheet1!R2C5)
=ADDRESS(2,5,1,FALSE,"[Book1]Sheet1")

Return To Top

 

This site was created in February 2007
by William Tan