Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mohan
 
Posts: n/a
Default 3 data validations

Hi
I have data in column A, B and C (these are account numbers). I need to
prevent
a) duplicate entries - which is working fine with "COUNTIF($A:$C,A2)<2"
formula in custom data validation

I also need to add two more validations
b) only numbers are allowed (no letters or characters)
c) the lenght must be 8

Can some one help me with a formula for all 3 of them or is there a better
way of doing this in VBA (instead of data validation)

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default 3 data validations

=AND(COUNTIF(:A:$C,A2)<2,ISNUMBER(A2),LEN(A2)=8)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mohan" wrote in message
...
Hi
I have data in column A, B and C (these are account numbers). I need to
prevent
a) duplicate entries - which is working fine with "COUNTIF($A:$C,A2)<2"
formula in custom data validation

I also need to add two more validations
b) only numbers are allowed (no letters or characters)
c) the lenght must be 8

Can some one help me with a formula for all 3 of them or is there a better
way of doing this in VBA (instead of data validation)

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mohan
 
Posts: n/a
Default 3 data validations

Thanks.. It worked perfectly! (just a typo on :A.. s/b $A)

"Bob Phillips" wrote:

=AND(COUNTIF(:A:$C,A2)<2,ISNUMBER(A2),LEN(A2)=8)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Mohan" wrote in message
...
Hi
I have data in column A, B and C (these are account numbers). I need to
prevent
a) duplicate entries - which is working fine with "COUNTIF($A:$C,A2)<2"
formula in custom data validation

I also need to add two more validations
b) only numbers are allowed (no letters or characters)
c) the lenght must be 8

Can some one help me with a formula for all 3 of them or is there a better
way of doing this in VBA (instead of data validation)

Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Data Jillian Excel Worksheet Functions 9 December 23rd 05 12:45 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Saving data in a worksheet within a workbook Homeuser Excel Discussion (Misc queries) 2 August 21st 05 10:49 PM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM


All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"