Compare two cells with case sensitivity
=EXACT(A2,B2)Excel · result on the sample sheet: 5 rows (C2:C6)
Describe what you need and get a working EXACT formula for Excel and Google Sheets, tested on real data before you copy it. EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case.
Each formula below was calculated on its own sample sheet. Open one to see the sheet, why it works, and to try it yourself.
=EXACT(A2,B2)Excel · result on the sample sheet: 5 rows (C2:C6)
=TRIM(A2)=TRIM(B2)Excel · result on the sample sheet: 6 rows (C2:C7)
=SUMPRODUCT(--EXACT(B2:B10,E1))Excel · result on the sample sheet: 3
=IF(EXACT(B2,$F$1),"Valid","Invalid")Excel · result on the sample sheet: 6 rows (C2:C7)
=SUMPRODUCT(--EXACT(A2:A8,D1))Excel · result on the sample sheet: 3
=SUMPRODUCT(EXACT(A2:A8,E1)*B2:B8)Excel · result on the sample sheet: 185
=EXACT(A2,UPPER(A2))Excel · result on the sample sheet: 6 rows (B2:B7)
=LEFT(A2,LEN($E$1))=$E$1Excel · result on the sample sheet: 6 rows (B2:B7)
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.
EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case.
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.