Skip to main content
Workday User Guide
Last Updated: 2023-06-23
COMPARE

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. If
    difference
    , then return the difference. (If
    value2
    is greater than
    value1
    , the return value is positive; otherwise it's negative.) If
    changed
    , then the function returns
    value2
    . The default is
    changed
    .
  • 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