Closest

  • Scroll to top of this topic Scroll to Top of Page

  • Print the current topic Print Topic

  • No expanding elements on this page Show/Hide Expanders

Closest(TestValue, Value1, Value2, ...) returns the index of whichever of the Value1, Value2, ... values is closest to TestValue. For example, Closest(2.7, 1, 3, 5) would return 2 because 2.7 is closer to 3 than to any of the other values and 3 is the second value in the list of values to which TestValue will be compared. If two or more values are equally far away from TestValue, the index of whichever is first in the list will be returned.