OK- it seems that Excel interprets the letter e when preceded and followed by a number as an exponent [could conceivably be useful to know :-) ]
Change the 'big formula' above to the following (new bit in red) and it should cater for that situation:
=AND(OR(AND(CODE(LOWER(LEFT(B3,1)))>=97,CODE(LOWER(LEFT(B3,1)))<=122),AND(CODE(LEFT(B3,1))>=65,CODE( LEFT(B3,1))<=90)),OR(AND(CODE(LOWER(MID(B3,2,1)))>=97,CODE(LOWER(MID(B3,2,1)))<=122),AND(CODE(MID(B3,2,1))>=65,CODE(MID(B3,2,1))<=90)),OR(AND(CODE(LOWER(RIGHT(B3,1)))>=97,CODE(LOWER(RIGHT(B3,1)))<=122 ),AND(CODE(RIGHT(B3,1))>=65,CODE(RIGHT(B3,1))<=90)),ISERROR(FIND("e",MID(B3,3,6))),ISNUMBER((1*MID(B3,3,6))))
Excel 2003 user (and starting to warm to Excel 2007)
Appreciate this was resolved but just came across in a Search... and on the off chance you were still looking to do without helpers... and to help enforce Upper Case...
presumably the above fails re:
and also the issue of E within MID(B3,3,6) ?Originally Posted by DaveM13
If so then this validation rule can be adapted accordingly... first create a named range of the permissable last letters, eg:
Sheet1!Z1 contains string: A,B,C,D,F,M
Named Range: =_lastletters
RefersTo: =Sheet1!$Z$1
(you don't need to use a Named Range per se but using a Named Range does permit you to store the string of interest on a sheet other than that on which the validation is being applied)
Your B3 Validation then becomes (incorporating issue of E):
If you wish to make case insensitive then encase all initial string references within UPPER functions - that being said your earlier post would imply you specifically want to enforce Upper Case - this should be catered for via the Validation as Lower Case letters will not be accepted.=AND(AND(CODE(LEFT(B3,1))>=65,CODE(LEFT(B3,1))<=90),AND(CODE(MID(B3,2,1))>=65,CODE(MID(B3,2,1))<=90),ISNUMBER(FIND(RIGHT(B3,1),_lastletters)),ISNUMBER(0+SUBSTITUTE(UPPER(MID(B3,3,6)),"E","Z")))
Last edited by DonkeyOte; 07-16-2009 at 03:17 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks