ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Which criteria was matched? (https://www.excelbanter.com/excel-discussion-misc-queries/256687-criteria-matched.html)

Justin Larson[_2_]

Which criteria was matched?
 
On one sheet I've got a large dataset containing products with many fields.
On another sheet, I've got a list of criteria that the products cannot
violate.

Both the list of criteria and the product list is quite long, so I've set up
a DCOUNT formula in a field on the products list to evaluate each line to see
if it violates any rules from the criteria. Right now that field just reports
back a 1 or 0 (1 meaning it violated a rule and is disallowed).

What I'd like to do, is have it report back which criteria was matched. i.e.
the formula evalates the criteria as a whole, is there a way to evaluate the
line, one criteria at a time and report back the location of the rule (or
name) when it reaches one that matches?

VBA may be the most common answer, though I'm hoping for a magic formula
that I didn't think of.

Alternatively, based on this description, is there a better way to go about
evaluating if a product is allowed, based on a long list of criteria than
using a database function?


All times are GMT +1. The time now is 01:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com