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
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
istext, good Lord I am glad its friday....

however, I am getting TRUE for this: "a 12345"
 
Last edited:
Upvote 0
Try:
Code:
=IF(AND(ISERROR(VALUE(MID(A1,1,1))),ISERROR(VALUE(MID(A1,2,1))),ISERROR(VALUE(MID(A1,3,1)))),TRUE,FALSE)
 
Upvote 0
then how about a formula spread into 3 columns?:

=if
Col"A" first 3 are Letters
Col"B" first 3 are Numbers
Col"C" first 3 are Letters
------------------------------
=True


Anyway to not pick up symbols? Only if they are A-Z should the Letters be True
 
Last edited:
Upvote 0
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
I think this may work...

=AND(A1>="AAA",LEFT(A1,3)<="ZZZ",FIND(" ",A1&" ")>3)
 
Last edited:
Upvote 0
Hi Rick

Since strings compare left to right, "B#$" > "AAA"

I think you have to test the characters separately.
 
Upvote 0

Forum statistics

Threads
1,215,611
Messages
6,125,829
Members
449,266
Latest member
davinroach

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