Determine if first character in string is greater than zero

BillTony

Board Regular
Joined
May 3, 2017
Messages
70
I have a dataset with numerous combinations of alpha and numeric values in a given column.

I need to do TWO things.

1) Determine if the 1st character is numeric - if so, the initial condition is met.

2) If numeric, is the character between 1 and 9 (greater than 0) - if so, the final condition is met and the record receives a "Pass."

I'm supplying 2 lines of code that seem to work equally well at handling the initial condition.

It's the final condition that's giving me pain...

Thanks in advance!

Code:
=IF(ISERR(LEFT(AO3,1)*1),"ERROR","OK")

=IF(ISNUMBER(VALUE(LEFT(AO3,1))),"OK","ERROR")
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Perhaps this:

=IF(ISNUMBER(LEFT(AO3,1)*1),IF(LEFT(AO3,1)*1>0,"OK","ERROR"),"ERROR")

Or

=IF(AND(ISNUMBER(LEFT(AO3,1)*1),LEFT(AO3,1)*1>0),"OK","ERROR")
 
Last edited:
Upvote 0
Similarly,

A​
B​
C​
1​
123​
OKB1: =IF((LEFT(A1) >= "1") * (LEFT(A1) <= "9"), "OK", "Error")
2​
ABCDEError
3​
012Error
 
Upvote 0
Or ...

A​
B​
C​
1​
123​
OKB1: =IF(MEDIAN(49, CODE(A1), 57) = CODE(A1), "OK", "Error")
2​
ABCDEError
3​
012Error
 
Upvote 0
I know I am late to the party, but here is one more formula that you can consider...

=IF(0+LEFT(A1)>0,"OK","Error")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

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