Help Centre › Functions & Formulas
For a full list of available calculation functions, please read What calculation functions are supported.
This article describes the formula syntax and usage of the CLOSEST function.
Description
The CLOSEST function returns the value from a list that is closest to a specified target value.
Syntax
CLOSEST(target, value1, [value2], ...)
The CLOSEST function syntax has the following arguments:
- target - Required. The value you want to find the closest match for.
- value1 - Required. The first value in the list to compare against the target.
- [value2, ...] - Optional. Additional values in the list to compare against the target, up to a maximum of 255 values.
Examples
| Formula | Description | Result |
| =CLOSEST(10, 1, 5, 15, 20) | Finds the value closest to 10 from the list 1, 5, 15, and 20. | 15 |
| =CLOSEST(7, 3, 8, 12, 5) | Finds the value closest to 7 from the list 3, 8, 12, and 5. | 8 |
Errors
For a full list of formula errors, please read Formula errors.