Friday, July 30, 2010   
  Search   
 

Office 2010 - Launch Event

Register  Login  
Forums  
     Minimize  

Welcome to MeraWindows forums.

Thank you for being at the Microsoft Windows Community Site. You may have to register before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  
     Minimize  


     
  
 
Microsoft Windows ForumsMicrosoft Windows ForumsMicrosoft Offic...Microsoft Offic...Microsoft ExcelMicrosoft ExcelValidationValidation
Previous Previous
 
Next Next
New Post
 3/5/2010 2:02 PM
 

Hi Ashish,

I've been not active for some months after posting two questions whose answer were teriffic. Now i've one question regarding validation (actually a modified version of previous question regarding validation). Here is the table

A B C D
1 X/Y X/Y A B
2 Y A B C
3 X/Z X/Z A B
4 Z A B Y

now what I want is that duplication of X/Y and X/Z can be allowed in their respective rows for 1 time but duplication of other valueslike A,B,C, Z,Y and so on (Z, Y if exist alone) should not be allowed. Please tell how to applying validation without using any VBA code.

Thanks

New Post
 3/5/2010 2:32 PM
 

Hi,

I just do not understand the question. Kindly state very clearly.


For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

New Post
 3/5/2010 3:58 PM
 

Hi,

Suppose there are 5 persons whose names are ajay, sachin, sumit, sandy, gyan

I can make a combination of ajay with sachin and gyan not with others. So in some rows i can enter ajay/sachin (together with /) butnot more than two times while in some rows i can ajay/gyan but not than two times. Other name can't be repeated.

plz note that the number of people are can more than 5.

Hope this is more clear.

Regards,

New Post
 3/5/2010 9:57 PM
 

Hi,

I have come closer to the solution for the said problem.

A B C D
1 X/Y X/Y A B
2 Y A B C
3 X/Z X/Z A B
4 Z A B Y

I've input following formula in data validation

IF( OR(A1="X/Y",A1="X/Z"),OR( COUNTIF($A1:$D1,"=X/Y")<=2,COUNTIF($A1:$D1,"=X/Z")<=2),COUNTIF($A1:$D1,A1)=1). Copied the formula and Paste Special as validation in each Cell.

Now if I enter X/Y in two different cells of same row , it allows to enter; the same with X/Z also. But when i enter A or any other value two times in a particular row, it doesn't allow. This is what i wanted. But here comes one more problem if i'm entering X/Y and X/Z in same row suppose in cell A1 and B1, then also it allows to enter which i don't want. Plz see the formula and suggest what modification I should do?

Regards,

New Post
 3/7/2010 5:02 PM
 

Hi,

You may refer to my workaround - Question 13 at the following link - http://ashishmathur.com/knowledgebase...

Do let me know how this works for you.


For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

New Post
 3/7/2010 7:54 PM
 

Hi,

Thank u for solution. Your solution is reflection of your brilliancy. Still I've some queries as in last post i'd mentioned some names. Now i have around 40 names. But combination of two names will be only two say ajay/shyam and ajay/pankaj and rest 37 names will be entere only one time so how this can be extended. Also please clarify use of assigned scores and function SUMPRODUCT. One more thing, if a validation rule is more than 255 characters how we could manage if references are relative.

Regards,

New Post
 3/11/2010 4:47 PM
 
 Modified By Ashish Mathur  on 3/11/2010 4:50:43 PM

Hi,

You may try this approach. In cell H13, enter "Entries" (without quotes) and in cell I13, enter "frequency of entry per row" (without quotes). In H14:H20, enter X/Y,X/Z,a,b,c,y,z. In I14:I20, enter 2,2,1,1,1,1,1. Click on cell A4 and go to Data > Validation > List. In the Sourece box, enter =$H$14:$H$20. Copy this to the right (till where a user woudl be allowed to enter data). Now click on cell B4 and go to Home > Styles > Conditional formatting > New Rule > Use a formula to determine which cells to format. In the while box, which appears there, enter the following formula

=(OR(AND(ISNUMBER(SEARCH("/",B4)),SUMPRODUCT(1*(ISNUMBER(SEARCH("/",$A4:A4))))=0,COUNTIF($A4:B4,B4)<=VLOOKUP(B4,$H$14:$I$20,2,0)),AND(ISNUMBER(SEARCH("/",B4)),SUMPRODUCT(1*(ISNUMBER(SEARCH("/",$A4:A4))))=1,COUNTIF($A4:B4,B4)<=VLOOKUP(B4,$H$14:$I$20,2,0),COUNTIF($A4:A4,B4)=1),AND(ISERROR(SEARCH("/",B4)),(COUNTIF($A4:B4,B4)<=VLOOKUP(B4,$H$14:$I$20,2,0)))))=FALSE

Apply the format as Red font (or whatever you wish). Entries which do not specify the data entry rule will get coloured in red

If you are wondering why i have not entered this formula in Data > Validation > All > Custom, the reason is the length of thr formula. There is a limitation on the length of a formula which one can write in Data Validation.

Please keep in mind that you must enter data in in continuous cells from left to right i.e. enter data in A4, B4, C4, D4 etc. Do not enter data in A4, D4, B4 etc.

Hope this helps. Do let me know how this works.


For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

New Post
 3/12/2010 8:02 PM
 

Hi,

Thanks for solution. I am posting a new problem. Please see that.

Regards

Previous Previous
 
Next Next
Microsoft Windows ForumsMicrosoft Windows ForumsMicrosoft Offic...Microsoft Offic...Microsoft ExcelMicrosoft ExcelValidationValidation