If the first 3 characters are alpha, then return true

HockeyDiablo

Board Regular
Joined
Apr 1, 2016
Messages
182
Looking for a formula to check the first 3 characters of a string and return TRUE if all three are "A-Z only"

=IF(ISNUMBER(VALUE(LEFT(J6,3)))=FALSE,TRUE,FALSE)

abc123 = true
123abc = false
a1b2c3 = false
 
Here's sort of a brute force approach:

=AND(UPPER(MID(A1,ROW($1:$3),1))>="A",UPPER(MID(A1,ROW($1:$3),1))<="Z")
Confirmed with Control+Shift+Enter.

It should work if you don't insert any rows before 4.
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi Eric

If you use a constant array, the formula is not a formula array. Also, the string comparison is case insensitive

"b">"a"
"b">"A"
"B">"a"
"B">"A"

Using your formula:

=AND(MID(A1,{1,2,3},1)>="A",MID(A1,{1,2,3},1)<="Z")
 
Upvote 0
Thank you gentlemen, this is working great now. Appreciate all of the help. Saved my neck for sure.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,762
Messages
6,132,574
Members
449,737
Latest member
naes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top