我有一組電子表格,它們定義了一組業務規則。這些業務規則然後由我們的系統處理。通過對數據進行分組來減少行數
創建電子表格的用戶做得太天真了,我發現通過將行間數據分解 - 從而減少規則數量 - 極大地提高了系統的性能。
其中的「天真」結構化的電子表格可能是這樣的:
+-----------+------------+------------+------------+------------+--------+
| Rule Name | Criteron 1 | Criteron 2 | Criteron 3 | Criteron 4 | Accept |
+-----------+------------+------------+------------+------------+--------+
| Rule 1 | A | B | C | | Yes |
| Rule 2 | A | C | C | | Yes |
| Rule 3 | A | D | C | | Yes |
| Rule 4 | A | E | C | | Yes |
| Rule 5 | A | F | C | | Yes |
| Rule 6 | A | B | D | | Yes |
| Rule 7 | A | C | D | | Yes |
| Rule 8 | A | D | D | | Yes |
| Rule 9 | A | E | D | | Yes |
| Rule 10 | A | F | D | | Yes |
| Rule 11 | A | B | E | | Yes |
| Rule 12 | A | C | E | | Yes |
| Rule 13 | A | D | E | | Yes |
| Rule 14 | A | E | E | | Yes |
| Rule 15 | A | F | E | | Yes |
| Rule 16 | | | | G | Yes |
| Rule 17 | | | | H | Yes |
| Rule 18 | | | | I | Yes |
| Rule 19 | | | | J | Yes |
| Rule 20 | | | | K | Yes |
| Rule 21 | | | | L | Yes |
| Rule 22 | | | | M | Yes |
| Rule 23 | | | | N | No |
| Rule 24 | | | | O | No |
| Rule 25 | | | | P | No |
| Rule 26 | | | | Q | No |
| Rule 27 | | | | R | No |
| Rule 28 | | | | S | No |
| Rule 29 | A | J | F | | No |
| Rule 30 | A | K | F | | No |
+-----------+------------+------------+------------+------------+--------+
作爲一個例子,第1條將被評估爲:
IF (Criterion 1 == A) AND (Criterion 2 == B) AND (Criterion 3 == C) THEN Accept
必須思考和假設我們可以在我們的列中使用OR條件,上面的可以簡化爲:
+-----------+------------+------------+------------+-------------+--------+
| Rule Name | Criteron 1 | Criteron 2 | Criteron 3 | Criteron 4 | Accept |
+-----------+------------+------------+------------+-------------+--------+
| Rule 1 | A | B,C,D,E,F | C,D,E | | Yes |
| Rule 2 | | | |G,H,I,J,K,L,M| Yes |
| Rule 3 | | | |N,O,P,Q,R,S | No |
| Rule 4 | A | J,K | F | | No |
+-----------+------------+------------+------------+-------------+--------+
規則1現在是評估如下:
IF (Criterion 1 == A) AND
(Criterion 2 == B OR Criterion 2 == C OR...) AND
(Criterion 3 == C OR Criterion 3 == D OR...) THEN Accept
現在,我已經做了這個手動。我想知道的是:Excel是否具有內置功能來爲我進行這種分組。如果沒有,任何人都可以指向我的算法的方向,這將有助於我有效地實現這一點?
您可能需要更好地描述您在縮減輸出中將規則1到規則1中的規則1到規則15組合使用的邏輯,因爲我沒有關注爲什麼這15個「規則」全部歸結爲輸出中的一條規則。如果你能做到這一點,這肯定可以用一些VBA來完成。 – 2013-04-09 14:06:03
請告訴我們您使用的規則/標準 – 2013-04-09 14:22:04
@DavidZemens,我已經添加到我的問題 - 希望現在更清楚。 – Griffin 2013-04-09 14:42:15