View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default validation with two specific formats

Try something like this:

Select the cells to be impacted, with A1 as the active cell

From the Excel main menu:
<data<validation
Allow: Custom
Formula: =AND(COUNTIF(A1,"R??????"),MOD(RIGHT(A1,6),1)=0,--RIGHT(A1,6)=0)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Aline Yiu" wrote:

Hi there,

How do you make sure certain character will be showing up on Excel cell,
e.g. R123456. The first letter must be S and followed by 6 numbers?

I have come up with formula: =AND(LEFT(A1, 1)="R", LEN(A1)=7), which is not
perfect because it will accept, e.g. R65432S.

Any advice?

--
Aline Yiu