基于日期和单元格值的Microsoft Excel转置

时间:2017-05-13 07:20:41

标签: excel transpose

我有这样的原始数据:

01-01-17    Cash Sales  1500
01-01-17    POS 1       50
01-01-17    POS 2       30
02-01-17    Cash Sales  6000
02-01-17    POS 1       150
02-01-17    POS 2       95
03-01-17    Cash Sales  6000
03-01-17    POS 1       150
04-01-17    Cash Sales  2700
04-01-17    POS 2       600
05-01-17    Cash Sales  1000
06-01-17    Cash Sales  7000
06-01-17    POS 1       1000

我试图在同一天从POS 1扣除每天的POS 2Cash Sales销售额。

如何在Excel中实现此目的?

我查了Transpose函数,但似乎不会为此做。

我试图实现的最终结果如下所示。你能帮忙吗?

                                    Cash Sales  POS 1   POS 2
01-01-17    Cash Sales  1500        1500        50      30
01-01-17    POS 1       50              
01-01-17    POS 2       30              
02-01-17    Cash Sales  6000        6000        150     95
02-01-17    POS 1       150             
02-01-17    POS 2       95              
03-01-17    Cash Sales  6000        6000        150 
03-01-17    POS 1       150             
04-01-17    Cash Sales  2700        2700                600
04-01-17    POS 2       600             
05-01-17    Cash Sales  1000        1000        
06-01-17    Cash Sales  7000        7000        1000    
06-01-17    POS 1       1000                

1 个答案:

答案 0 :(得分:2)

你可以尝试一下,让我知道它是否有效,

D2开始的公式,向右拖动并向下拖动到整个范围

=IFERROR(IF(AND($B2=$D$1,INDEX($A2:$C$999,MATCH(D$1,$B2:$B$999,0),1)=$A2),INDEX($B2:$C$999,MATCH(D$1,$B2:$B$999,0),2),""),"")

enter image description here