Sauter des lignes vierges et faire des calculs sur des lignes non vierges subséquentes

Je suis donc intéressé à utiliser Excel pour parsingr un set de données. Les données sont définies comme ci-dessous

Color | WEIGHT ------ | ------ Blue | 1000 Blue | 2000 Blue | 3000 Red | 4225 Red | 5000 Red | 5750 Yellow | 6250 Red | 7220 Red | 9280 Blue | 9720 Blue | 11000 Blue | 12000 

J'aimerais alors find la quantité de poids obtenue, par exemple la valeur initiale bleue 1000 valeur finale 3000 changement de 2000. Et pour le rouge 5750-3000 = changement de 2750, je sais comment find quand un changement de couleur se produit par exemple. Si (A1 <> A2, A1,0). faire cela me donne une sortie comme

 Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Couleur | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 ------ Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Bleu | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 1000 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Bleu | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 2000 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Bleu | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 4225 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Rouge | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 4225 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 4225 Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Rouge | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 5000 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Rouge | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 5750 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Jaune | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 5750 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 5750 Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Jaune | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 7220 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Rouge | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 7220 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 7220 Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Rouge | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 9280 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Bleu | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 9280 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 9280 Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 Bleu | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 11000 | Color | WEIGHT ------ | ------ Blue | 1000 | 1000 Blue | 2000 | Blue | 4225 | Red | 4225 | 4225 Red | 5000 | Red | 5750 | Yellow | 5750 | 5750 Yellow | 7220 | Red | 7220 | 7220 Red | 9280 | Blue | 9280 | 9280 Blue | 11000 | Blue | 12000 | 1200 

Je voudrais faire une nouvelle table qui montre la couleur et le changement de poids. Avec des résultats similaires à ceux suivants

J'utilise la formule suivante pour get la sortie

 =IFERROR(MMULT(AGGREGATE({14,15},6,$B$1:$B$78/($A$1:$A$78=G2),1),{1;-1}),"") 

Crédit à @XOR LX pour la formule ci-dessus, où ma sélection de couleur est en G2 et mes données sont en A et B

En utilisant cette formule, je peux get une sortie comme

 Color|Change Blue | 11000 Red | 5055 Yellow| 970 Couleur | Changement Color|Change Blue | 11000 Red | 5055 Yellow| 970 Bleu | Color|Change Blue | 11000 Red | 5055 Yellow| 970 11000 Color|Change Blue | 11000 Red | 5055 Yellow| 970 Rouge | Color|Change Blue | 11000 Red | 5055 Yellow| 970 5055 Color|Change Blue | 11000 Red | 5055 Yellow| 970 

Au lieu de cela, je voudrais get une sortie comme la suivante.

 Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 Couleur | Changement Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 Bleu | Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 3225 par exemple (4225-1000) Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 Rouge | Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 1525 Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 Jaune | Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 1570 Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 Rouge | Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 2060 Color|Change Blue | 3225 eg (4225-1000) Red | 1525 Yellow| 1570 Red | 2060 Blue | 2720 

Formule de tableau ** :

=MMULT(INDEX(B:B,N(IF(1,SMALL(IF(MMULT(COUNTIF(E2,CHOOSE({1,2},A$1:A$14,A$2:A$15)),{1;1})=1,LOOKUP(ROW(A$2:A$15),ROW(A$2:A$14))),2*COUNTIF(E$2:E2,E2)-{1,0})))),{-1;1})

où on suppose que:

1) Vous avez Excel 2010 ou version ultérieure

2) Votre table est en A1:B14 (avec les en-têtes dans la rangée 1)

3) Votre couleur de choix, par exemple "Bleu", est en E2

Copier vers le bas pour donner des résultats similaires pour les colors dans E3 , E4 , etc.

Cordialement

** Les formules de tableau ne sont pas inputs de la même manière que les formules «standard». Au lieu de simplement appuyer sur ENTER, maintenez enfoncée la touche CTRL et SHIFT, puis appuyez sur ENTER. Si vous l'avez bien fait, vous remarquerez que Excel place les crochets {} autour de la formule (mais n'essayez pas de les insert manuellement).