Excel EXACT Function

Article byTanuj Kumar
Edited byAshish Kumar Srivastav
Reviewed byDheeraj Vaidya, CFA, FRM

EXACT Function in Excel

The EXACT function is a logical function in Excel used to compare two strings or data with each other. It shows whether both data are an exact match or not. Moreover, this function is logical, providing “TRUE” or “FALSE.” This function is a case-sensitive formula.

For example, suppose we have a dataset, and we need to match the cells A3 and B3. In such a scenario, we can use the Excel EXACT function to verify whether the two cells’ data are the same. If the strings match, it may return as “TRUE.” If it does not, it may return as “FALSE.”

Syntax

EXACT function excel (syntax)

Compulsory Parameter:

  • text1: It is the first string that we wish to compare.
  • text2:  It is the second text string.

–>> If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

How to Use the EXACT Function in Excel? (Examples)

You can download this EXACT Function Excel Template here – EXACT Function Excel Template

Example #1

In the first example, we compare the two strings in column text 1 and text 2 and apply the EXACT formula in the output column as shown in the function column. The output will be as shown in the below table. The EXACT function returns the “TRUE” where text 1 and text 2 are the same and “FALSE” where text 1 and text 2 values are not the same.

EXACT Example 1

Example #2

Suppose we wish that users of our worksheet insert data in the PROPER case in the “Proper text only” column. So we can achieve it by using a custom formula based on the EXACT formula and other functions.

Let us consider the below table, and we have to apply the restriction in the Proper text, the only column in the below table.

EXACT function excel Example 2

First, we must select the C18 cell, click on “Data Validation” under the “Data” tab and choose Data ValidationData ValidationThe data validation in excel helps control the kind of input entered by a user in the worksheet.read more. Change the validation criteria to custom and input the EXACT formula =AND(EXACT(D18,PROPER(D18)),ISTEXT(D18)).

 Now, if we type a NON PROPER word in the “Proper text only” column, it will show us an error message as follows:

EXACT Example 2-1

Example #3

The EXACT function is very useful when you have case-sensitive data.

In this example, we take a set of products where the case-sensitive products are available in the list.

EXACT function excel Example 3

There are four products of soft toys, two being in lowercase and others in uppercase. Here, we are looking for numeric values. SUMPRODUCT + EXACT is an exciting and flexible way to do a case-sensitive LOOKUP. We can use the EXACT Excel formula, as shown below:

=SUMPRODUCT(–(EXACT(G14,G3:G12)),H3:H12).

EXACT Example 3-1

The output is: 300

EXACT Example 3-2

EXACT Function in Excel used as a VBA function.

In VBA, we can compare two strings using the strcomp functionStrcomp FunctionVBA StrComp is a built-in function that determines whether two string values are the same or not. However, unlike in a worksheet, the results are not defaulted to TRUE or FALSE.read more; here is the example as follows:

Sub usefunction()

Dim Lresult as string  // declares the lresult as a string.

Lresult = StrComp (“Tanuj”, “tanuj”)

MsgBox(Lresult)  //Output will show in MsgBox

End sub”

The output will be 0 as String Tanuj and tanuj are not exactly matched.

This article has been a guide to the EXACT function in Excel. Here, we discuss the EXACT formula in Excel and how to use it, along with an Excel example and a downloadable template. You may also look at these useful functions in Excel: –