Calc CLOSEST function

The CLOSEST function returns the value from a list that is closest to a specified target value.

Help CentreFunctions & 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

FormulaDescriptionResult
=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.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.