Another useful top-level object to know about is the WorksheetFunction
object. That object provides the functions from the Excel formula bar to your Visual Basic code. Some of these members
are redundant with those provided by the VBA object library, however, others provide very useful (and advanced) analytical and statistical functions, as described in Table 4-8.
Table 4-8. Members of the WorksheetFunction object
Member |
Description |
---|---|
|
Returns the arccosine, or inverse cosine, of a number. The arccosine is the angle whose cosine is a number. The returned angle is given in radians in the range 0 to π. |
|
Returns the inverse hyperbolic cosine of a number. |
|
The same as the Visual Basic |
|
Converts double-byte characters to single-byte characters. |
|
Returns the arcsine, or inverse sine, of a number. The arcsine is the angle whose sine is the given number. The returned angle is given in radians in the range −π/2 to π/2. |
|
Returns the inverse hyperbolic sine of a number. |
|
Returns the arctangent, or inverse tangent, of the specified x- and y-coordinates. |
|
Returns the inverse hyperbolic tangent of a number. |
|
Returns the average of the absolute deviations of data points from their mean. |
|
Returns the average (arithmetic mean) of the arguments. |
|
Returns the beta cumulative distribution function. |
|
Returns the inverse of the cumulative distribution function for a specified beta distribution. |
|
Returns the individual term binomial distribution probability. |
|
Returns a number rounded up, away from 0, to the nearest multiple of significance. |
|
Returns the one-tailed probability of the chi-squared distribution. |
|
Returns the inverse of the one-tailed probability of the chi-squared distribution. |
|
Returns the test for independence. Determines whether hypothesized results are verified by an experiment. |
|
Uses an index to return a value from the list of value arguments. |
|
Removes all nonprintable characters from text. |
|
Returns the number of combinations for a given number of items. |
|
Returns a value that you can use to construct a confidence interval for a population mean. |
|
Returns the correlation coefficient of two cell ranges. |
|
Returns the hyperbolic cosine of a number. |
|
Counts the number of cells that contain numbers and also numbers within the list of arguments. |
|
Counts the number of cells that are not empty and the values within the list of arguments. |
|
Counts empty cells in a specified range of cells. |
|
Counts the number of cells within a range that meet the given criteria. |
|
Returns covariance, the average of the products of deviations for each data point pair. |
|
Returns the smallest value for which the cumulative binomial distribution is greater than or equal to a criterion value. |
|
Averages the values in a column of a list or database that match conditions you specify. |
|
Returns the number of days between two dates based on a 360-day year (12 30-day months), which is used in some accounting calculations. |
|
Returns the depreciation of an asset for a specified period using the fixed-declining-balance method. |
|
Counts the cells that contain numbers in a column of a list or database that match conditions you specify. |
|
Counts the nonblank cells in a column of a list or database that match specified conditions. |
|
Returns the depreciation of an asset for a specified period using the double-declining-balance method or some other method you specify. |
|
Converts radians into degrees. |
|
Returns the sum of squares of deviations of data points from their sample mean. |
|
Extracts a single value from a column of a list or database that matches specified conditions. |
|
Returns the largest number in a column of a list or database that matches specified conditions. |
|
Returns the smallest number in a column of a list or database that matches specified conditions. |
|
Formats a number as currency using the local currency symbol. |
|
Multiplies the values in a column of a list or database that match conditions you specify. |
|
Estimates the standard deviation of a population based on a sample by using the numbers in a column of a list or database that match specified conditions. |
|
Calculates the standard deviation of a population based on the entire population, using the numbers in a column of a list or database that match specified conditions. |
|
Adds the numbers in a column of a list or database that match specified conditions. |
|
Estimates the variance of a population based on a sample by using the numbers in a column of a list or database that match conditions you specify. |
|
Calculates the variance of a population based on the entire population by using the numbers in a column of a list or database that match specified conditions. |
|
Returns a number rounded up to the nearest even integer. |
|
Returns the exponential distribution. |
|
Returns the factorial of a number. |
|
Returns the F probability distribution. |
|
Finds the location of one string within another (similar to |
|
Finds the location of one double-byte string within another (similar to |
|
Returns the inverse of the F probability distribution. |
|
Returns the Fisher transformation at x. This transformation produces a function that is normally distributed rather than skewed. |
|
Returns the inverse of the Fisher transformation. Use this transformation when analyzing correlations between ranges or arrays of data. |
|
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. |
|
Rounds a number down, toward 0, to the nearest multiple of significance. |
|
Calculates, or predicts, a future value by using existing values. |
|
Calculates how often values occur within a range of values and then returns a vertical array of numbers. |
|
Returns the result of an F-test. An F-test returns the one-tailed probability that the variances in |
|
Returns the future value of an investment based on periodic, constant payments and a constant interest rate. |
|
Returns the gamma distribution. You can use this function to study variables that may have a skewed distribution. The gamma distribution is commonly used in queuing analysis. |
|
Returns the inverse of the gamma cumulative distribution. |
|
Returns the natural logarithm of the gamma function (x). |
|
Returns the geometric mean of an array or range of positive data. For example, you can use |
|
Calculates predicted exponential growth by using existing data. |
|
Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the arithmetic mean of reciprocals. |
|
Searches for a value in the top row of a table or an array of values and then returns a value in the same column from a row you specify in the table or array. |
|
Returns the hypergeometric distribution. Hypergeometric distribution is the probability of a given number of sample successes, given the sample size, population successes, and population size. |
|
Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values. The intercept point is based on a best-fit regression line plotted through the known x-values and known y-values. |
|
Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. |
|
Returns the internal rate of return for a series of cash flows represented by the numbers in values. |
|
Returns True if a cell contains an error other than |
|
Returns True if a cell contains an error. |
|
Returns True if a cell contains a Boolean value. |
|
Returns True if a cell contains the |
|
Returns True if a cell does not contain text. |
|
Returns True if a cell contains a numeric value. |
|
Calculates the interest paid during a specific period of an investment. |
|
Returns True if a cell contains a string. |
|
Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness or flatness of a distribution compared with the normal distribution. |
|
Returns the kth largest value in a data set. You can use this function to select a value based on its relative standing. |
|
Calculates the statistics for a line by using the least-squares method to calculate a straight line that best fits your data, and returns an array that describes the line. |
|
Returns the natural logarithm of a number. |
|
Returns the logarithm of a number to the specified base. |
|
Returns the base-10 logarithm of a number. |
|
Calculates an exponential curve that fits your data and returns an array of values that describes the curve. Returns an array of values. |
|
Returns the inverse of the lognormal cumulative distribution function of x, where |
|
Returns the cumulative lognormal distribution of x, where |
|
Finds a value in an array and returns that value. For two-dimensional arrays, it is better to use |
|
Returns the relative position of an item in an array that matches a specified value in a specified order. |
|
Returns the largest value in a set of values. |
|
Returns the matrix determinant of an array. |
|
Returns the median of the given numbers. |
|
Returns the smallest number in a set of values. |
|
Returns the inverse matrix for the matrix stored in an array. |
|
Returns the modified internal rate of return for a series of periodic cash flows. |
|
Returns the matrix product of two arrays. The result is an array with the same number of rows as |
|
Returns the most frequently occurring, or repetitive, value in an array or range of data. |
|
Returns the negative binomial distribution. |
|
Returns the normal distribution for the specified mean and standard deviation. This function has a wide range of applications in statistics, including hypothesis testing. |
|
Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation. |
|
Returns the standard normal cumulative distribution function. The distribution has a mean of 0 and a standard deviation of 1. Use this function in place of a table of standard normal curve areas. |
|
Returns the inverse of the standard normal cumulative distribution. The distribution has a mean of 0 and a standard deviation of 1. |
|
Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate. |
|
Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values). |
|
Returns a number rounded up to the nearest odd integer. |
|
The same as the Visual Basic |
|
Returns the parent object for the specified object. |
|
Returns the Pearson product moment correlation coefficient, r, a dimensionless index that ranges from -1.0 to 1.0 inclusive and reflects the extent of a linear relationship between two data sets. |
|
Returns the kth percentile of values in a range. You can use this function to establish a threshold of acceptance. For example, you can decide to examine candidates who score above the 90th percentile. |
|
Returns the rank of a value in a data set as a percentage of the data set. |
|
Returns the number of permutations for a given number of objects that can be selected from number objects. A permutation is any set or subset of objects or events in which internal order is significant. |
|
Extracts the phonetic (furigana) characters from a text string. |
|
Returns the number 3.14159265358979, the mathematical constant π, accurate to 15 digits. |
|
Calculates the payment for a loan based on constant payments and a constant interest rate. |
|
Returns the Poisson distribution. A common application of the Poisson distribution is predicting the number of events over a specific time, such as the number of cars arriving at a toll plaza in one minute. |
|
Returns the result of a number raised to a power. |
|
Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate. |
|
Returns the probability that values in a range are between two limits. If |
|
Multiplies all the numbers given as arguments and returns the product. |
|
Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase letters. |
|
Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender. |
|
Returns the quartile of a data set. Quartiles often are used in sales and survey data to divide populations into groups. |
|
Converts degrees to radians. |
|
Returns the rank of a number in a list of numbers. If you sort a list, the rank of the number is its position in the list. |
|
Returns the interest rate per period of an annuity. |
|
Replaces part of one string with another. |
|
Replaces part of one double-byte string with another. |
|
Repeats text a given number of times. |
|
Formats an Arabic numeral as a Roman numeral. |
|
Rounds a number to a specified number of digits. |
|
Rounds a number down, toward 0. |
|
Rounds a number up, away from 0. |
|
Returns the square of the Pearson product moment correlation coefficient through data points in |
|
Retrieves real-time data from a program that supports automation. |
|
Finds the location of one string within another (similar to |
|
Finds the location of one double-byte string within another (similar to |
|
Returns the hyperbolic sine of a number. |
|
Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry of a distribution around its mean. |
|
Returns the straight-line depreciation of an asset for one period. |
|
Returns the slope of the linear regression line through data points in |
|
Returns the kth smallest value in a data set. Use this function to return values with a particular relative standing in a data set. |
|
Returns a normalized value from a distribution characterized by mean and standard deviation. |
|
Estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value (the mean). |
|
Calculates standard deviation based on the entire population given as arguments. The standard deviation is a measure of how widely values are dispersed from the average value (the mean). |
|
Returns the standard error of the predicted y-value for each x in the regression. The standard error is a measure of the amount of error in the prediction of y for an individual x. |
|
Substitutes |
|
Returns a subtotal in a list or database. |
|
Adds all the numbers in a range of cells. |
|
Adds cells that meet specified criteria. |
|
Multiplies corresponding components in the given arrays and returns the sum of those products. |
|
Returns the sum of the squares of the arguments. |
|
Returns the sum of the difference of squares of corresponding values in two arrays. |
|
Returns the sum of the sum of squares of corresponding values in two arrays. The sum of the sum of squares is a common term in many statistical calculations. |
|
Returns the sum of squares of differences of corresponding values in two arrays. |
|
Returns the sum-of-years digits depreciation of an asset for a specified period. |
|
Returns the hyperbolic tangent of a number. |
|
Returns the percentage points (probability) for the student t-distribution where a numeric value (x) is a calculated value of t for which the percentage points are to be computed. The t-distribution is used in the hypothesis testing of small sample data sets. |
|
Converts a value to text in a specific number format. |
|
Returns the t-value of the student t-distribution as a function of the probability and the degrees of freedom. |
|
Returns a vertical range of cells as a horizontal range or vice versa. |
|
Returns values along a linear trend. Fits a straight line (using the method of least squares) to the arrays |
|
Removes all spaces from text except for single spaces between words. |
|
Returns the mean of the interior of a data set. |
|
Returns the probability associated with a student t-test. Use |
|
Formats a number as U.S. currency. |
|
Estimates variance based on a sample. |
|
Calculates variance based on the entire population. |
|
Returns the depreciation of an asset for any period you specify, including partial periods, using the double-declining-balance method or some other method you specify. VDB stands for variable declining balance. |
|
Searches for a value in the leftmost column of a table and then returns a value in the same row from a column you specify in the table. |
|
Returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default. |
|
Returns the Weibull distribution. Use this distribution in reliability analysis, such as calculating a device’s mean time to failure. |
|
Returns the one-tailed probability-value of a z-test. For a given hypothesized population mean, that is, the observed sample mean. |
There is no Help for members in Table 4-8 from Visual Basic, but you can look up these functions in the Excel Help file as shown in Figure 4-21.
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.