COMPARE
Description
Compares two matrices, returning an integer representing the comparative relationship
of two values. If the values match, the function returns null. Optionally, you can
set a difference percentage so that if two values are within a certain percentage of
each other, the function considers them to be the same.
Syntax
COMPARE(
value1
,
value2
, [
mode
], [
percentage
])
- value1: The first value to compare.
- value2: The second value to compare.
- mode: Specifies the result to return. Ifdifference, then return the difference. (Ifvalue2is greater thanvalue1, the return value is positive; otherwise it's negative.) Ifchanged, then the function returnsvalue2. The default ischanged.
- percentage: Specifies a percentage allowance of difference where the function should consider the two values to be the same. The two values are equal if they are within value1*percentage of each other.
Example
Formula | Result |
|---|---|
=COMPARE(B2,B3,"changed",0.01) where B2 contains 15 and B3 contains 18. | 18 |
Related Functions
ARRAYAREA
MINUS