|
select "A",物品编号,AVG(单价) as 单价,SUM(数量) as 数量,sum(金额) as 金额 from [A单位$a2:d] GROUP BY 物品编号 union all
select "B",货品项目,AVG(单价),SUM(数量),sum(金额) from [B单位$a2:d] group by 货品项目
拉出透视表后,计算项。a-b
| Expr1000 | 数据 | | | | | | | | | A | B | 公式1 | 物品编号 | 求和项:单价 | 求和项:数量 | 求和项:金额 | 求和项:单价 | 求和项:数量 | 求和项:金额 | 求和项:单价 | 求和项:数量 | 求和项:金额 | 12128921 | 54 | 1510 | 81540 | 54 | 3020 | 163080 | 0 | -1510 | -81540 | 12128922 | 43 | 2590 | 111370 | 43 | 5180 | 222740 | 0 | -2590 | -111370 | 12128923 | 40 | 1130 | 45200 | 40 | 2260 | 90400 | 0 | -1130 | -45200 | 12129521 | 53 | 2330 | 123490 | 53 | 4660 | 246980 | 0 | -2330 | -123490 | 12129522 | 45 | 3200 | 144000 | 45 | 6400 | 288000 | 0 | -3200 | -144000 | 12129523 | 41 | 1180 | 48380 | 41 | 2360 | 96760 | 0 | -1180 | -48380 | 12129721 | 53 | 560 | 29680 | 53 | 1120 | 59360 | 0 | -560 | -29680 | 12129722 | 45 | 1100 | 49500 | 45 | 2200 | 99000 | 0 | -1100 | -49500 | 12129723 | 41 | 50 | 2050 | 41 | 100 | 4100 | 0 | -50 | -2050 | 12135922 | 46 | 300 | 13800 | 46 | 600 | 27600 | 0 | -300 | -13800 | 12137121 | 56.5 | 800 | 45200 | 56.5 | 1600 | 90400 | 0 | -800 | -45200 | 12137122 | 45 | 2800 | 126000 | 45 | 5600 | 252000 | 0 | -2800 | -126000 | 12137123 | 40.5 | 1300 | 52650 | 40.5 | 2600 | 105300 | 0 | -1300 | -52650 | 12137222 | 45 | 1200 | 54000 | 45 | 2400 | 108000 | 0 | -1200 | -54000 | 12137223 | 40.5 | 700 | 28350 | 40.5 | 1400 | 56700 | 0 | -700 | -28350 | 12139322 | 50 | 1000 | 50000 | 50 | 2000 | 100000 | 0 | -1000 | -50000 | 12142422 | 46 | 800 | 36800 | 46 | 1600 | 73600 | 0 | -800 | -36800 | 12142621 | 44 | 51 | 2244 | 44 | 72 | 3168 | 0 | -21 | -924 | 12142622 | 44 | 75 | 3300 | 44 | 120 | 5280 | 0 | -45 | -1980 | 12142721 | 44 | 1448 | 63712 | 44 | 2116 | 93104 | 0 | -668 | -29392 | 12142722 | 44 | 1596 | 70224 | 44 | 2307 | 101508 | 0 | -711 | -31284 | 12142921 | 44 | 62 | 2728 | 44 | 124 | 5456 | 0 | -62 | -2728 | 12142922 | 44 | 125 | 5500 | 44 | 250 | 11000 | 0 | -125 | -5500 |
|
|