HOW TO COMPARE TWO TEXT STRINGS IN EXCEL

INTRODUCTION

Whenever we prepare any report in excel, we have two constituents in any report.

The Text portion and the Numerical portion.

But just storing the text and numbers doesn’t make the super reports. Many times we need to automate the process in the reports to minimize the effort and improve the accuracy.

Many functions are provided by the Excel which work on Text and give us the useful output as well. But few problems are still left on which we need to apply some tricks with the available tools.

In this articles , we are going to find out the way to compare the two text strings in Excel.

The text string can be checked for the content only or content and case both.

For example,

What and What are exactly same in which the content and the case of both the words are exactly same.

If the words being compared are WHAT and What, the content of the words is same but the case is not same. We’ll discuss both the cases in this article.

HOW TEXT IS HANDLED IN EXCEL?

TEXT is simply the group of characters and strings of characters which convey the information about the different data and numbers in Excel. Every character is connected with a code [ANSI].

Text comprises of the individual entity character which is the smallest bit which would be found in Excel.

We can perform the operations on the strings[Text] or the characters.

Characters are not limited to A to Z or a to z but many symbols are also included in this which we would see in the later part of the article. 

TEXT IS AN INACTIVE NUMBER TYPE[FORMAT] IN EXCEL. ANYTHING STORED AS TEXT [NUMBER OR DATE] WON’T RESPOND TO ANY STANDARD FORMULAS OR FUNCTIONS BUT SPECIALLY DESIGNED TEXT FUNCTIONS. [EXCEPTIONS DO OCCUR IN CASE OF NUMBERS]

If we need to make anything inactive, such as Date to be non responding to the calculation, we put it as a text. Similarly if we want to avoid any calculations for a number it needs to be put as a text.

COMPARE TWO TEXT STRINGS IN EXCEL

This situation can occur when we want to create some logical condition and check whether the two text strings are same or not.

Now the same can have two meanings.

1.Just the content is same. For example “TEXT” and “text”.

2. Exactly same [ Content is same and case is same]. For example, “teXT” and “teXT”

STEPS TO COMPARE THE TEXT FOR THE CONTENT:

  •  We are going to compare just the content and not the case.
  • This can be used simply in Excel.
  •  We can simply compare the cells by using the formula =Cell 1 containing text=cell 2 containing text.
  • This formula will return TRUE if the content is same [ignoring the case] and false if content is not the same.
TEXT COMPARISON [ONLY CONTENT NOT CASE] IN EXCEL

STEPS TO COMPARE THE TEXT FOR THE EXACT CONTENT [CONTENT AND CASE]:

  •  We are going to compare the two text strings exactly for the content and the case.
  • This is also not difficult.
  • We will make use of the function called EXACT(text 1, text 2). It compares the text to be exactly same and returns true if the texts have same content and same case. [EXACT TAKES ONLY TWO TEXT AT A TIME].
  •  We can simply compare the cells by using the formula =EXACT(Cell 1 containing text,cell 2 containing text]
  • The formula will return TRUE if both the text strings are same otherwsie FALSE.
EXACT TEXT COMPARISON IN EXCEL