# How to check if text is all uppercase in Excel

Compare the text with its uppercase version using EXACT: =EXACT(A2,UPPER(A2)) returns TRUE when every letter is a capital.

**Excel:** `=EXACT(A2,UPPER(A2))` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| State code | All caps? |
| MN |  |
| Wi |  |
| ND |  |
| sd |  |
| IA |  |
| Il |  |

Formula in B2, filled to B7: `=EXACT(A2,UPPER(A2))`

Result: TRUE; FALSE; TRUE; FALSE; TRUE; FALSE

## How it works

UPPER(A2) is what the text would look like in all caps. If the text is already in all caps, the two are identical and EXACT returns TRUE. EXACT is needed because the = sign ignores case: `A2=UPPER(A2)` is always TRUE.

## Other ways

- `=IF(EXACT(A2,UPPER(A2)),"OK","Fix case")`: A label for a review column. (Shows "OK" or "Fix case".)
- `=REGEXMATCH(A2,"^[A-Z]+$")`: Google Sheets: true only when the text is capital letters A to Z and nothing else.

## Common mistakes

- Text with no letters, like "123", counts as uppercase, because UPPER doesn't change it.
- Using = instead of EXACT makes every row TRUE.

## Questions

**How do I check for all lowercase?**

Compare with LOWER: `=EXACT(A2,LOWER(A2))`.

**How do I count the cells that aren't in capitals?**

Use `=SUMPRODUCT(--NOT(EXACT(A2:A7,UPPER(A2:A7))))`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/check-if-text-is-all-uppercase
