The Google Sheets ERF function returns the integral of the Gauss error function over a given interval, and its syntax is ERF(lower_bound, [upper_bound]). If you only supply one argument, it returns the error function from 0 to that value; with two arguments, it returns the integral between the two bounds.
What the ERF Function Actually Does
The error function (often denoted as erf) is a special mathematical function used in probability, statistics, and partial differential equations. It is defined as the integral of a Gaussian (normal) distribution from 0 to a given value. In Google Sheets, ERF computes this integral numerically, so you don’t need to perform calculus by hand.
For example, ERF(1) returns approximately 0.84270079, which is the integral from 0 to 1 of the Gaussian curve. ERF(0, 1) returns the same value because the lower bound defaults to 0 when omitted. If you use ERF(-1, 1), it returns about 1.68269, which is the integral from -1 to 1.
Syntax and Arguments Explained
The function takes two arguments, but the second one is optional:
lower_bound(required) – the lower limit of the integration interval. Must be a number or a reference to a cell containing a number.upper_bound(optional) – the upper limit. If omitted, Sheets uses 0 as the lower bound and the givenlower_boundas the upper bound.
Both arguments can be negative, positive, or zero. If either argument is non-numeric, the function returns a #VALUE! error. If the upper bound is less than the lower bound, the result is negative (the integral reverses direction).
How to Use ERF in a Real Spreadsheet
Assume you have the following data in a Google Sheet:
- A1:
0.5(lower bound) - B1:
1.5(upper bound)
To get the integral from 0.5 to 1.5, enter in C1:
=ERF(A1, B1)
This returns approximately 0.44556. To get the integral from 0 to 0.5, you can use =ERF(A1) (since the lower bound defaults to 0), which returns about 0.52050.
You can also use the function directly with numbers: =ERF(0, 1) returns 0.84270.
Common Errors and How to Fix Them
Here are typical issues you might encounter:
- #VALUE! – Occurs if any argument is text or a cell containing text. Ensure both arguments are numeric.
- #NUM! – Rarely occurs, but can happen if the function cannot compute the integral (e.g., extremely large values). Check that your bounds are within a reasonable range.
- Wrong result – If you expect a value between 0 and 1 but get a larger number, you likely forgot that with two arguments you are computing the integral over a range, not the cumulative from 0. For example,
ERF(0, 2)returns 0.99532, which is correct for the interval 0 to 2.
ERF vs. ERFC: What’s the Difference?
Google Sheets also has an ERFC function, which returns the complementary error function, defined as 1 - ERF(x) for a single argument. The syntax is ERFC(x) or ERFC(lower_bound, [upper_bound]) in some versions, but the standard Google Sheets ERFC only takes one argument. Use ERFC when you need the tail probability of a normal distribution, while ERF gives the central area.
Practical Applications of ERF
The error function appears in several real-world contexts:
- Probability and statistics – Calculating cumulative probabilities for normal distributions without using the
NORM.DISTfunction directly. - Heat transfer and diffusion – Solving problems involving transient heat conduction or diffusion equations.
- Signal processing – Modeling step responses in systems with Gaussian noise.
- Quality control – Estimating defect rates in manufacturing processes.
For example, if you need the probability that a normally distributed variable falls within 1 standard deviation of the mean, you can use ERF(1/SQRT(2)) which returns approximately 0.68269, matching the well-known 68% rule.
Alternatives to ERF in Google Sheets
If you are working with normal distributions, you might prefer NORM.S.DIST or NORM.DIST because they directly return probabilities. For instance, NORM.S.DIST(1, TRUE) returns 0.84134, which is the cumulative probability up to 1. The relation is: ERF(x) = 2 * NORM.S.DIST(x * SQRT(2), TRUE) - 1. This can be useful if you need to convert between the two.
Frequently Asked Questions
Can ERF accept cell references? Yes, both arguments can be cell references. For example, if A1 contains 0 and B1 contains 2, =ERF(A1, B1) works fine.
What happens if I use only one argument? It treats that argument as the upper bound and uses 0 as the lower bound. So ERF(1) equals ERF(0,1).
Does ERF work with negative numbers? Yes. The error function is odd, meaning ERF(-x) = -ERF(x). So ERF(-1) returns -0.84270.
Why do I get a negative result when my upper bound is smaller? Because the integral is directional. If you swap the bounds, the sign flips. For example, ERF(1,0) returns -0.84270.
Is ERF available in Excel? Yes, Excel has an ERF function with the same syntax, but it may require the Analysis ToolPak add-in in older versions. In modern Excel (365), it is built-in.
Can I use ERF with array formulas? Yes, but you need to use ARRAYFORMULA in Google Sheets if you want to apply it to a range. For example, =ARRAYFORMULA(ERF(A1:A10)) will return an array of results.
Related
- Google Sheets Split Expenses Template: How to Use
- What Is a Data Entry Analyst? Role, Skills, Pay
- Standing Balance Scale Grades Explained
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Date in Google Sheets: Enter, Format, and CalculateTo enter a date in Google Sheets, type it into a cell in a format your spreadsheet recognizes,…
- CSV vs Excel: What’s the Difference?CSV is a plain-text format for storing rows of values, while Excel is spreadsheet software that can work…
- Delete Blank Rows in Excel All at OnceTo delete fully blank rows in Excel all at once, add a temporary helper column, mark rows with…
- Random Number 1-8: How to Pick One FairlyThe random number is 7. If you need a fair, unbiased pick between 1 and 8, use a…
- Snowflake SPLIT: How to Split Strings by DelimiterYes. In Snowflake, use SPLIT(string, delimiter) to divide a string wherever the exact delimiter occurs; it returns the…
- Select All Windows 10: How to Pick Everything FastThe short answer: there is no single “Select All” button that highlights every file, folder, or setting across…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.