从多个标准中获取价值

时间:2015-08-26 18:38:42

标签: excel indexing match vlookup

目标:根据类型和年份获得资产成本。

Sheet 1中

    A            B       C       D          E 
1  YEAR         YEAR    CD2     TYPE       Cost      
2  Prior2005    2003    TRUCK   COMBO      #DIV/0!  
3  2005         2005    TRUCK   CONVEYOR    FALSE
4  2012         2012    TRUCK   CONVEYOR    #N/A
5  2014         2014    TRUCK   CONVEYOR    

Sheet 2中 范围名称= Cost_Each

YEAR    Tractor, Flatbed(w/ Piggy), Flatbed(wo/ piggy), Conveyor, Combo
2015    2800    2000    2600    3500    3500
2014    4000    4100    2600    3500    3500
2013    7500    4100    1450    6700    6700
2012    7500    4100    1450    6700    6700
2011    7500    4100    1450    N/A N/A
2010    7500    4100    1450    N/A N/A
2009    7500    4100    1450    15200   15200
2008    7500    8500    1450    15200   15200
2007    7500    8500    1450    15200   15200
2006    7500    8500    1450    15200   15200
2005    7500    8500    1450    15200   15200
Prior 2005  7500    8500    1450    15200   15200

我在Sheet1上尝试了以下操作来获取成本(失败):

Row 2 
=LOOKUP((Cost_Each!A$2:A$15=A2)/(Cost_Each!B$2:B$15=D2),(Cost_Each!B$3:M$14))
Row 3
=IFERROR(INDEX(Cost_Each,MATCH(D3,Cost_Each,0),MATCH(A3,Cost_Each,0)),"FALSE")
Row 4
=SUMPRODUCT(--(A2:A17=Cost_Each!A3:A14),--(D2:D17=Cost_Each!B2:M2),--(Cost_Each!B3:M14))
Row 5
=INDEX(Cost_Each!B3:M14,SUMPRODUCT(--(A:A=Cost_Each!A3:A14),--(D:D=Cost_Each!B2:M2),0))

有人能告诉我我做错了什么吗?

0 个答案:

没有答案