Microsoft Office Forum [ www.Office-Fragen.de ] >> READONLY <<
Microsoft Office 2003-2019 => Excel => Thema gestartet von: Fish-o-mat am Oktober 02, 2017, 16:17:36 Nachmittag
-
Hallo,
folgedes Problem: Ich möchte Differenz zweier Zahlen aus Spalte A bilden, unter einer Bedingung, dass in Spalte B eine 1 steht. In Spalte C soll dann die Differenz stehen.
Spalte A Spalte B Spalte C
1 1
2
4 1 3
6
8
9 1 5
10
11 1 2
12
14
15 1 4
z.B. In Zelle C6 wird die Differenz aus A6 und A3 gebildet, da B6 und B3 jeweils eine 1 enthalten. Weiß jemand Rat?
Viele Grüße
-
Fisch-o-mat,
=WENNFEHLER(WENN(B1;A1-INDEX(A:A;AGGREGAT(15;6;ZEILE($B$1:$B$11)/($B$1:$B$11=1);ZÄHLENWENN(B$1:B1;1)-1));"");"")
-
C2: =B2*(A2-VERWEIS(2;1/B$1:B1;A$1:A1))
Sub Formeldemo(): Workbooks.Add xlWorksheet
[B:C].NumberFormat = "0;;"
[A1:B1] = 1
[A2:A20] = "=R[-1]C+TRUNC(RAND()*3+1)"
[B2:B20] = "=TRUNC(RAND()*1.25)"
[C2:C20] = "=RC[-1]*(RC[-2]-LOOKUP(2,1/R1C[-1]:R[-1]C[-1],R1C[-2]:R[-1]C[-2]))"
End Sub
-
Woran liegt es, dass die hier nur gefühlte 20% beträgt, anderswo hingegen eher 60%?