# How to check if a cell starts with specific text in Excel

Compare the first characters with the prefix: =LEFT(A2,LEN($E$1))=$E$1 returns TRUE when A2 starts with the text in E1.

**Excel:** `=LEFT(A2,LEN($E$1))=$E$1` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| SKU | Furniture? |  | Starts with | FUR- |
| FUR-1042 |  |  |  |  |
| ELE-2087 |  |  |  |  |
| FUR-0031 |  |  |  |  |
| OFF-7710 |  |  |  |  |
| fur-0450 |  |  |  |  |
| ELE-FUR-12 |  |  |  |  |

Formula in B2, filled to B7: `=LEFT(A2,LEN($E$1))=$E$1`

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

## How it works

LEN($E$1) is the length of the prefix, so LEFT takes exactly that many characters from the start of the SKU. If they equal the prefix, the SKU starts with it. "ELE-FUR-12" contains "FUR-" but doesn't start with it, so it's FALSE. The = comparison ignores case, so "fur-0450" counts.

## Other ways

- `=COUNTIF(A2,$E$1&"*")>0`: A wildcard version: "FUR-*" means "FUR- followed by anything". Handy because the same pattern works in COUNTIF over a whole range.
- `=EXACT(LEFT(A2,LEN($E$1)),$E$1)`: Case-sensitive. ("fur-0450" is FALSE.)

## Common mistakes

- Hard-coding `LEFT(A2,4)` breaks when the prefix changes length. Use LEN of the prefix cell.
- A leading space in the data makes the comparison fail. TRIM imported values first.
- `A2="FUR-*"` doesn't work: = doesn't understand wildcards. Compare with LEFT as here, or use COUNTIF, which does.

## Questions

**How do I count the cells that start with the text?**

Use `=COUNTIF(A2:A7,$E$1&"*")`.

**How do I list only the matching rows?**

Filter them: `=FILTER(A2:A7,LEFT(A2:A7,LEN($E$1))=$E$1)`.

**How do I show Yes or a blank instead of TRUE or FALSE?**

Wrap the test in IF: `=IF(LEFT(A2,LEN($E$1))=$E$1,"Yes","")`.

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-cell-starts-with-specific-text
