Skip to main content

How to exactly compare two strings (case sensitive) in Excel?

Author Siluvia Last modified

When working with Excel, you may encounter situations where you need to compare two strings while considering case sensitivity. Excel’s default behavior is to compare strings without distinguishing between uppercase and lowercase letters. For instance, "Excel" and "EXCEL" are treated as equal when using standard comparison operators. This article provides a comprehensive guide on how to perform case-sensitive string comparisons in Excel

Exactly compare two strings (case sensitive) with formula

Exactly compare two strings (case sensitive) and highlight the differences by Kutools


Exactly compare two strings (case sensitive) with formula

As below screenshot shown, you need to compare strings in column A and B considering case sensitive in Excel. Please do as follows.

sample data

The EXACT function is specifically designed for case-sensitive comparisons. It returns TRUE if two strings are exactly the same (including case) and FALSE otherwise.

1. Select the blank cell C2, enter the below formula into the Formula Bar, then press the Enter key. See screenshot:

=EXACT(A2, B2)

compare two strings with formula

2. Keep selecting cell C2, drag the Fill Handle down to the cells to get all results.

drag the Fill Handle down to the cells to get all results

Notes:

1. If the cell returns the TRUE result, it means that the compared strings are exactly matched. Otherwise, they are different.

2. If you want to generate your own results such as Yes and No instead of TRUE and FALSE. Please apply the following formula. See screenshot:

=IF(EXACT(A2,B2),"Yes","No")

display the results as Yes or No


Exactly compare two strings (case sensitive) and highlight the differences with Kutools

Need to compare two strings in Excel with case-sensitive precision and highlight the differences? Kutools for Excel offers a quick and effortless solution to ensure your data matches exactly as intended. Whether you're validating passwords, checking codes, or ensuring data accuracy, Kutools simplifies the process, saving you time and effort.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please click "Kutools" > "Range" > "Compare Cells" to go to the "Compare Cells" feature.

In the "Compare Cells" dialog box, specify the following operations:

  1. Select the two comparing ranges separately in the "Find values in" box and "According to" box;
  2. Select "Different cells" from the "Find" section;
  3. Specify the background color or font color to fill the different cells;
  4. Check "Case sensitive" option;
  5. Finally, click OK button.
    specify the options in the dialog box

Result: Kutools will instantly compare the strings and highlight any differences with case sensitive. See screenshot:
compare two strings by kutools

Selecting and highlighting row differences in Excel can be achieved through multiple methods,by following the steps and best practices outlined in this guide, you can optimize your workflow and handle this task with ease and efficiency. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials to help you master Excel.


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!