View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Data Validation Problem Work-Around needed

I think I'd use an adjacent column (D?) and put a formula like:
=IF(COUNTIF(C:C,C1)1,"Warning","ok")



" wrote:

I am struggling with the following problem.

I have multiple groups of numerical information. Each group has 3
columns - which I will call column A, column B and column C. The user
inputs column A and column B - column C simply adds column A and
column B. If the result of adding column A and column B is the same
as a previous result in that same group, then I want to alert the user
that the data input may be incorrect. It could be correct, but they
should double-check to be certain, as it is probably incorrect.

If the result of adding the two numbers created a duplicate in column
C, the message would state something like "CAUTION - you may have
entered the correct data, but double-check" and then give the option
to accept the data or make the correction, as in conventional data
validation.

I need the solution to be in real time, so I think VBA is out, as I
want the entry of the data to trigger the caution note within a few
seconds, and I do not know a way to trigger a Macro that is column-
specific. Also, once the data involved in a specific entry has been
examined and found to be OK, I do not want to force the user to re-
examine that data again.

Data validation would work perfectly for this problem if it could be
used on cells that are calculated, but of course, it cannot. I know
logically that there is a way to use data validation to do this by
examining the data calculated thus far, and then comparing this to the
entry the user makes in column A and alerting him if the entry he
makes in column B would cause an answer in column C that already
exists. But the programming to do this by brute force would be
extensive, if I could even figure it out and I am not sure, but
perhaps there are even internal limits in Excel that would prevent
adding up to 30 variables to the list to search from. Since I will
have about 90 lists, each with 30 sets of data, on a given
spreadsheet, it seems that brute force, while it might work, may be
hugely memory intensive.

However, since there is a logical answer, there must be a progamming
answer?? I just do not have enough knowledge to figure it out. Can
anyone help me?

Here is a brief example of how brute force might work logically;

A B C

2 7 9 (User enters the 2 and the 7 - Excel calculates 2
+ 7 = 9
3 (Progam now calculates that adding a 6 in
column B would create a duplicate in column C, so validation would
display a message if and only if a 6 was added in column B).
Say the user added a 5 - then we would have

A B C

2 7 9
3 5 8
4 (Program now calculates that adding a 4 in coluimn
B would create a duplicate (8) or adding a 5 in column B would also
create a duplicate in column C (9), so validation would display a
message if a 4 or 5 were added in column B).

I may be able to reduce the lists from 30 sets of data to around 10
sets of data, as that would work for most users - the 30 sets of data,
however, cover every possible need, if that would help.

Is there someone that can guide me in an efficient way to solve this
problem? I thank you very much in advance...


--

Dave Peterson