# EXACT formula generator

> Describe what you need and get a EXACT formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested EXACT examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/exact · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case.

Describe the task at [EXACT formula generator](https://spreadsheetpractice.com/tools/formula-generator/exact) and get a EXACT formula for Excel and Google Sheets, tested on real data.

## Tested EXACT examples

### Compare two cells with case sensitivity

`=EXACT(A2,B2)`

Excel. Result on the sample sheet: 5 rows (C2:C6). [See it and try it](https://spreadsheetpractice.com/formulas/compare-two-cells-case-sensitive)

### Compare two columns ignoring extra spaces and case

`=TRIM(A2)=TRIM(B2)`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/compare-two-columns-ignoring-spaces)

### Do a case-sensitive count

`=SUMPRODUCT(--EXACT(B2:B10,E1))`

Excel. Result on the sample sheet: 3. [See it and try it](https://spreadsheetpractice.com/formulas/case-sensitive-count)

### Make an IF comparison case-sensitive

`=IF(EXACT(B2,$F$1),"Valid","Invalid")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/case-sensitive-if)

### Make COUNTIF case-sensitive

`=SUMPRODUCT(--EXACT(A2:A8,D1))`

Excel. Result on the sample sheet: 3. [See it and try it](https://spreadsheetpractice.com/formulas/case-sensitive-countif)

### Do a case-sensitive SUMIF

`=SUMPRODUCT(EXACT(A2:A8,E1)*B2:B8)`

Excel. Result on the sample sheet: 185. [See it and try it](https://spreadsheetpractice.com/formulas/case-sensitive-sumif)

### Check if text is all uppercase

`=EXACT(A2,UPPER(A2))`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-text-is-all-uppercase)

### Check if a cell starts with specific text

`=LEFT(A2,LEN($E$1))=$E$1`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-cell-starts-with-specific-text)

## Questions

### What does the EXACT formula generator do?

You describe the task in plain English, and it writes the formula, using EXACT where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does EXACT do?

EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case.

### Can I learn to write EXACT formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the EXACT function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
