Serving the Quantitative Finance Community

 
User avatar
mit
Topic Author
Posts: 0
Joined: February 5th, 2005, 4:52 pm

Excel question

December 17th, 2009, 4:11 am

say I am creating a column called Invoice No. and dont wanna allow any repeated entries in that column. How can I use data validation to achieve this?
 
User avatar
rmax
Posts: 374
Joined: December 8th, 2005, 9:31 am

Excel question

December 17th, 2009, 7:49 am

Don't think you can. Excel is not very good at handling Primary Key like problems. Your best bet would be to use List validation, but I don't know how long a list can. You then reference a seperate table of available invoice numbers. Even this means you will still get duplicates, but at least they are consistent! You would then need to perform some other validation routine.To be honest build it in a database would be better. Even if you don't have MS Access / can't afford Access then you could build a DB in MYSQL and use Excel as the front end through ADO.
 
User avatar
Marine
Posts: 0
Joined: July 17th, 2003, 7:56 am

Excel question

December 17th, 2009, 10:09 am

Maybe have a column right next to the "Invoice No." column which does a lookup of past values to see if the value you just entered is a duplicate and if so flag it. Just an idea ...
 
User avatar
jpsnj
Posts: 0
Joined: February 12th, 2008, 2:42 pm

Excel question

December 17th, 2009, 12:17 pm

Enter this in the data validation formula (Data/Validation/Custom/Formula) in cell A1 and copy all the way down.=COUNTIF(A:A,A1)=1
 
User avatar
Padawan
Posts: 0
Joined: October 27th, 2009, 10:15 am

Excel question

December 17th, 2009, 12:19 pm

Suppose you want to validate column AAdd to A1 the validation:Allow: CustomFormula: =countif(A:A,A1)<=1Click OKNow select the whole column A, go to Data -> Validation and click "Yes" when asked if you want to expand validation to all the cells in the range.
 
User avatar
Padawan
Posts: 0
Joined: October 27th, 2009, 10:15 am

Excel question

December 17th, 2009, 12:19 pm

jpsnj was faster...