Formula or Macro to count non-matching values

  • Thread starter Thread starter dkenebre
  • Start date Start date
D

dkenebre

How do I create a formula, that acts as counter,
if the value in BK493 does not match either value in AF495, AG495 o
AH495,
then BK497, counts the number BK cells that this statement was tru
until it matches.
But if BK493 matches match either value in AF495, AG495 or AH495, the
BK497 equals "#".
If it does match, the BK cell that does not match restart the count o
non-matching BK cells.

example
BK493=1,,,,,,,,,,,,,,,,,,,Answer
AF590:AH590=0,2,1,,,,,,,,,BK590=#
AF591:AH591=0,7,3,,,,,,,,,BK591=1
AF592:AH592=6,1,1,,,,,,,,,BK592=#
AF593:AH593=1,7,9,,,,,,,,,BK593=#
AF594:AH594=3,5,5,,,,,,,,,BK594=1
AF595:AH595=3,5,8,,,,,,,,,BK595=2
AF596:AH596=2,6,1,,,,,,,,,BK595=3

If this has to be a macro then I need only to match/compare the BK cel
with the AF:AH cells which have orange background.
Thank
 
dkenebre

In BK590, put this formula

=IF(OR($BK$493=AF590,$BK$493=AG590,$BK$493=AH590),"#",IF(BK589="#",1,BK589+1
))

and fill down as necessary.

It looks like the last line of your example should be #, unless I'm missing
something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top