Die Excel-Matrixformel muss eine Matrix (einen Vektor) zurückgeben, gibt aber einen einzelnen (skalaren) Wert zurück

Die Excel-Matrixformel muss eine Matrix (einen Vektor) zurückgeben, gibt aber einen einzelnen (skalaren) Wert zurück

Ja ich lese:Excel: Matrixformel – Warum wird die Matrix (der Vektor) nicht zurückgegeben?aber das ist nicht dasselbe.

Im Grunde kann ich nicht herausfinden, warum die Formel so ist: {=MATCH({1,2,3},{1,2,3},0)}die normalerweise eine Matrix (einen Vektor) zurückgibt, {1,2,3}gibt einen einzelnen Wert zurück.

Betrachten Sie dieses Beispiel:
Hinweis: Es gibt eine sehr lange Einleitung – ein interessanter Teil beginnt unter dem fettgedruckten Text: „Bis jetzt funktioniert alles wie erwartet.“

Es gibt eine Tabelle mit Nameund Revision columns.

  • Ich möchte für jeden eindeutigen Namen eine eindeutige Ganzzahl haben GroupNo.
  • Dann addieren Sie zum GroupNoDezimalteil einen RevPartWert entsprechend der Revisionsnummer ( ""=0, "a"=0.01, ...)
  • GroupNo+RevPartwird genannt FullGroupNo( FGN)
  • FGNIch möchte das Maximum für jede Namensgruppe wissen : MaxInGroup( MIG)

Dies lässt sich leicht durch die Verwendung mehrerer Spalten in der Tabelle erreichen ( Table1):

GroupNo:     =MATCH([@Name],[Name],0)
RevPart:     =INDEX({0,1},MATCH([@Revision],{"","a"},0))/100
FullGroupNo: =[@GroupNo]+[@RevPart]
MaxInGroup: {=MAX(([@GroupNo]=[GroupNo])*[FullGroupNo])}

Table1
+------+----------+---------+---------+-------------+------------+
| Name | Revision | GroupNo | RevPart | FullGroupNo | MaxInGroup |
+------+----------+---------+---------+-------------+------------+
| A    | =""      |       1 |       0 |           1 |       1,01 |
| A    | a        |       1 |    0,01 |        1,01 |       1,01 |
| B    | =""      |       3 |       0 |           3 |          3 |
| C    | =""      |       4 |       0 |           4 |       4,01 |
| C    | a        |       4 |    0,01 |        4,01 |       4,01 |
+------+----------+---------+---------+-------------+------------+
Note: ="" means there is a blank string in the cell (formula ="")

Die FullGroupNo( FGN) können in einer Formel erhalten werden, die nur auf Nameund RevisionSpalten verweist.

FGN_2: {=(INDEX({0,1},MATCH([@Revision],{"","a"},0))/100+MATCH([@Name],[Name],0))}
FGN_2 is a new column in the table (Table1) above. It's matrix formula returns single (not-matrix) value.
 
Area under FGN (Matrix) is an ordinary worksheet range. This whole area contains return (matrix) value.
FGN (Matrix): {=INDEX({0,1},MATCH(Table1[Revision],"","a"},0))/100+MATCH(Table1[Name],Table1[Name],0))}

Table1     Just range
+-------+  +--------------+
| FGN_2 |  | FGN (Matrix) |
+-------+  +--------------+
|     1 |  |            1 |
|  1,01 |  |         1,01 |
|     3 |  |            3 |
|     4 |  |            4 |
|  4,01 |  |         4,01 |
+-------+  +--------------+

MaxInGroupJetzt habe ich versucht , es in einer einzigen Matrixformel zusammenzufassen .

Original MaxInGroup formula:
MaxInGroup:  {=MAX(([@GroupNo]=[GroupNo])*[FullGroupNo])}

Step1
- replace[@GroupNo] with matrix formula with reference only to Name and Revision columns
MIG_1:       {=MAX((MATCH([@Name],[Name],0)=[GroupNo])*[FullGroupNo])}

Step2
- Replace (matrix) [GroupNo] with matrix formula with reference to Name and revision columns
MIG_2:       {=MAX((MATCH([@Name],[Name],0)=MATCH([Name],[Name],0))*[FullGroupNo])}

Bis jetzt funktioniert alles wie erwartet.

Step3
- Replace (matrix) [FullGroupNo] in MIG_2 with matrix formula with reference to Name and Revidion columns
  (so, basicaly I need formula from FGN (Matrix) used before

MIG_3:  {=MAX((MATCH([@Name],[Name],0)=MATCH([Name],[Name],0))*(INDEX({0,1},MATCH([Revision],{"","a"},0))/100+MATCH([Name],[Name],0)))}
Note: MIG_3 is part of the Table1 so column names only are enough

So now we could have same values in MaxInGroup, MIG_1-3 columns. But no. We haven't.
The RevPart in MIG_3 depends only on the firs Revision value.

+------+----------+------------+-------+-------+-------+
| Name | Revision | MaxInGroup | MIG_1 | MIG_2 | MIG_3 |
+------+----------+------------+-------+-------+-------+
| A    | =""      |       1,01 |  1,01 |  1,01 |     1 |
| A    | a        |       1,01 |  1,01 |  1,01 |     1 |
| B    | =""      |          3 |     3 |     3 |     3 |
| C    | =""      |       4,01 |  4,01 |  4,01 |     4 |
| C    | a        |       4,01 |  4,01 |  4,01 |     4 |
+------+----------+------------+-------+-------+-------+
Versus
+------+----------+------------+-------+-------+-------+
| Name | Revision | MaxInGroup | MIG_1 | MIG_2 | MIG_3 |
+------+----------+------------+-------+-------+-------+
| A    | a        |       1,01 |  1,01 |  1,01 |  1,01 |
| A    | a        |       1,01 |  1,01 |  1,01 |  1,01 |
| B    | =""      |          3 |     3 |     3 |  3,01 |
| C    | =""      |       4,01 |  4,01 |  4,01 |  4,01 |
| C    | a        |       4,01 |  4,01 |  4,01 |  4,01 |
+------+----------+------------+-------+-------+-------+
Note: ="" means there is a blank string in the cell (formula ="")

verwandte Informationen