30 Advanced Excel Tips for 2026

Excel Champs / Excel Formulas List / Check IF a Cell Value Starts with a Text or a Number (Formula in Excel)
By Puneet Gogia (Microsoft MVP)

Check IF a Cell Value Starts with a Text or a Number (Formula in Excel)

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

To check whether a cell starts with specific text, compare the first characters with LEFT: =IF(LEFT(A2,3)="LXI","Yes","No") tests the first three. The number in LEFT must match the length of the text you’re testing for.

This comparison is not case-sensitive, so “lxi” also returns Yes — use =IF(EXACT(LEFT(A2,3),"LXI"),"Yes","No") when case matters. To check whether a cell starts with a number, test just the first character: =IF(ISNUMBER(VALUE(LEFT(A2,1))),"Yes","No").

To count how many cells start with something, COUNTIF with a trailing wildcard is simpler than an array formula: =COUNTIF(A2:A10,"LXI*"). And to take the text from a cell rather than typing it in, =IF(LEFT(A2,LEN(C1))=C1,"Yes","No") adapts to whatever length C1 happens to be.

In Excel, while working with data there might be a situation when you need to check if the value in a cell starts with a particular text or if the starting part of that value is a number or not.  In this tutorial, we will learn to write a formula to text both conditions.

IF a Cell Value Starts with a Particular Text

In the following example, you need to check if the starting three characters of the cell are equal to LXI. For this, you need to use the IF and LEFT.

if-cell-value-starts-with-a-particular-text

You can use the below steps to write this formula:

  1. First, enter the IF function in a cell.
  2. After that, enter the LEFT function in the first argument of the IF, and refer to the cell A2 where you have the value, in the second argument, use 3 for the num_digit.
  3. Next, use the equal sign and enter the value (using double quotation marks) that you want to test.
  4. Now, in the second argument, enter “Yes”.
  5. And in the third argument, enter “No”.
  6. In the end, enter closing parentheses and hit enter to get the result.
enter-if-and-left-function

As you can see below, for all the values where we have the value “LXI” at the start of the value, it returns Yes, else No.

result-will-be-yes-or-no
=IF(LEFT(A2,3)="LXI","Yes","No")
[thrive_leads id=’112075′]

Count IF the Cells Start With

Use the below formula if you want to count the number of cells which starts with a particular value.

use-sumproduct-to-count-the-result
=SUMPRODUCT(--(LEFT(A2:A10,3)="LXI"))

To learn more about this, you can learn about using SUMPRODUCT with a Condition.

If a Cell Value Starts with a Number

In the same way, you can write a formula to check if a cell starts with a number.

formula-to-find-if-cell-value-starts-with-number
=IF(ISNUMBER(VALUE(LEFT(A2,2))), "Yes","No")

In this formula, we have used the VALUE function around the LEFT. When you get a value by using the LEFT, it returns that value as a text, even if that value is a number.

That’s why to convert a number into a number we need to use the VALUE. After that, we used ISNUMBER to test the value returned by the LEFT. If that value is a number, the condition is TRUE, and IF returns YES, else No.

Get the Excel File

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

Leave a Comment