Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 14:29 
Stellt euch bitte eine Tabelle mit 2 Spalten vor. In der 1.Spalte steht irgendein Integer-Wert und in der 2.Spalte stehen verschiedene Buchstaben. A,B,C und D. Nun brauche ich eine Prüfung/Funktion/Irgendwas, was mir alle Integer-Werte aus Spalte 1 addiert, wenn in Spalte 2 ein A steht. Dann sollen alle Werte in Spalte 1 addiert werden, wenn der Buchstabe B dazu gefunden wurde. Und so weiter...

Habt Ihr einen Lösungsvorschlag oder ein Suchbegriff für Google?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 16.08.06 14:32 
bau dir doch einfach dahinter jeweils summenspalten, die dann über wenn-dann formeln prüfen,was für ein buchstabe gefragt ist, und wenn's der richtige ist zur zeile drüber den wert aus dem ersten feld dazuaddiert...ganz unten hast du dann den richtigen wert...

verständlich, was ich meine?!
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 14:40 
Nein, so richtig nicht. Bedenke bitte, dass beide Spalteninhalte Variabel sind. Ich habe mal eine Beispieltabelle beigelegt. Bitte veranschauliche Deine Idee daran.
Einloggen, um Attachments anzusehen!
_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 16.08.06 14:46 
sry, die kann ich mir gerade nicht anschauen, bin auffer arbeit,da is das mitm runterladen von dateien immer so ne sache...
aber hier mal ein beispiel:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
spalte1   spalte2   summe a   summe b   summe c
                    0         0         0
1         a         1         0         0
2         b         1         2         0 
3         c         1         2         3
4         a         5         2         3
5         b         5         7         3
6         c         5         7         9
7         a         12        7         9
8         b         12        15        9
9         c         12        15        18


die formel für summe a wäre dann: =WENN(spalte2="a";spalte1+summe a aus zeile-1;summe a aus zeile-1)

jetzt klar?
oder hab ich dich schon ganz falsch verstanden?
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 14:50 
Ich glaube Du hast mich richtig verstanden, aber ich habe noch ein paar Fragen. Woher nimmst Du die Werte aus Spalte a-b? Wozu das -1 in der Formel?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 16.08.06 14:54 
wie jetzt, werte aus spalte a-b?
in den ersten beiden die werte hab ich mir anhand deiner erläuterungen spontan aus den fingern gesogen.
das minus eins in der formel ganz einfach: du rechnest, wenn in spalte2 ein "a" steht, zu der zelle über der aktuellen (also in "summe a", aber eine zeile drüber) den wert aus spalte1 dazu, bzw. wenn kein "a" da ist, dann übernimmst du nur den alten wert, ohne etwas dazu zu addieren...
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 14:56 
user profile iconMiri hat folgendes geschrieben:
wie jetzt, werte aus spalte a-b?
in den ersten beiden die werte hab ich mir anhand deiner erläuterungen spontan aus den fingern gesogen.


In meiner Erläuterung steht etwas von Spalte 1 und 2. Spalte a und b kommen von Dir, aber woher die Werte? :gruebel:

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 16.08.06 14:58 
ja, die nimmst du dir quasi als hilfs-spalten dazu. damit berechnest du dann bis zur aktuellen zeile die summen.
ganz unten hast du dann die werte für die gesamte tabelle. in zeile 5 zum beispiel hast du dann die summen von zeile 1 bis zeile 5.
klar soweit?!
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 15:17 
Ahhh, THX! Ich habs verstanden. Anbei die Beispiel-Tabelle für zukünftige, die das selbe Problem haben.
Einloggen, um Attachments anzusehen!
_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Mi 16.08.06 15:19 
freut mich, wenns klappt :-)

LG
Miri
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mi 16.08.06 15:56 
Hallo,

das geht besser mit der Formel-Funktion =SUMMEWENN(...)
siehe Anhang.
Einloggen, um Attachments anzusehen!
_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mi 16.08.06 15:59 
Stimmt, super Lösung. Aber die Formel war mir einfach unbekannt. Miri war aber auch super. Hat sich viel Mühe gegeben. Ich danke euch beiden.

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 17.08.06 08:12 
SUMMEWENN kannte ich auch noch nicht!
Danke, Lannes :-)