Excel Function: EXACT

Purpose

The EXACT function compares two text values and returns the logical value TRUE if they are identical, or FALSE if they are different. If EXACT is supplied with non-text values then it converts them into text before comparing them to each other. Because of this and as example 11 demonstrates, the EXACT function can return unexpected results when it operates on non-text values.

Invocations of the EXACT function take the form:

EXACT(text1,text2)

Arguments

ArgumentArgument typeDescription
text1MandatoryA text value which will be compared to the value supplied to the text2 argument.
text2MandatoryA text value which will be compared to the value supplied to the text1 argument.

Error Conditions

Error valueCondition typeCondition
#CALC!Bad argumentA value of type currency, geography or stock was supplied to the text1 argument.
#CALC!Bad argumentA value of type currency, geography or stock was supplied to the text2 argument.
#CALC!Bad argumentValues of type currency, geography or stock were supplied to the text1 and text2 arguments.

Examples

ExampleFormulaResultDescription
1=EXACT("a","a")TRUEApply the EXACT function to 2 identical text values.
  • The result is TRUE since the values being compared are identical.
2=EXACT("a","b")FALSEApply the EXACT function to 2 different text values.
  • The result is FALSE since the values being compared are different.
3=EXACT(1,1)TRUEApply the EXACT function to 2 identical numeric values.
  • The result is TRUE since the values being compared are identical.
4=EXACT(1,2)FALSEApply the EXACT function to 2 different numeric values.
  • The result is FALSE since the values being compared are different.
5=EXACT(DATE(2023,1,1),DATE(2023,1,1))TRUEApply the EXACT function to 2 identical date values.
  • The result is TRUE since the values being compared are identical.
6=EXACT(DATE(2023,1,2),DATE(2023,1,1))FALSEApply the EXACT function to 2 different date values.
  • The result is FALSE since the values being compared are different.
7=EXACT(FALSE,FALSE)TRUEApply the EXACT function to 2 identical logical values.
  • The result is TRUE since the values being compared are identical.
8=EXACT(TRUE,FALSE)FALSEApply the EXACT function to 2 different logical values.
  • The result is FALSE since the values being compared are different.
9=EXACT(TIME(2,2,2),TIME(2,2,2))TRUEApply the EXACT function to 2 identical time values.
  • The result is TRUE since the values being compared are identical.
10=EXACT(TIME(2,2,2),TIME(2,2,3))FALSEApply the EXACT function to 2 different time values returns FALSE.
  • The result is FALSE since the values being compared are different.
11=EXACT(DATE(2021,1,1),"44197")TRUEApply the EXACT function to 1 date and 1 text value.
  • Excel represents the 1st of January, 2021 with the number 44197.
  • 1st of January, 2021 is transformed into the text value "44197".
  • The result is TRUE because both text1 & text2 hold the value "44197".