【问题标题】:excel index match vlookup - return value based on criteria in two columnsexcel索引匹配vlookup - 根据两列中的条件返回值
【发布时间】:2018-05-01 11:07:35
【问题描述】:

一家快递公司使用带有油箱的汽车,每个星期天晚上都装满了燃料。 周日晚上,空车在没有司机的情况下通过 2 个秤(每个秤都有自己的差异)进行称重。

date    car scale   weight  note 
04/29   014 scale_1 1244.3  fillup 
04/29   014 scale_2 1247.1  fillup 
04/29   015 scale_1 1200.9  fillup 
04/29   015 scale_2 1203.7  fillup

整个星期,包裹都是在清晨装载,汽车在晚上清空并称重。

date    car scale   weight  note 
04/30   014 scale_1 1213.3  returned to depot 
04/30   014 scale_2 1216.1  returned to depot 
04/30   015 scale_1 1144.9  returned to depot 
04/30   015 scale_2 1147.7  returned to depot 
05/01   014 scale_1 1167.8  returned to depot 
05/01   014 scale_2 1170.6  returned to depot 
05/01   015 scale_1 1052.9  returned to depot 
05/01   015 scale_2 1055.7  returned to depot

05/01 与 04/30 相比,每尺度 1 和每尺度 2 的差异为 45.5 公斤

如何在右侧的列中创建一个函数 - “note”之后的一个函数,这将使我根据比例和汽车与之前的测量结果有所差异? (从同一个“秤”和同一个“汽车”中查找最后一个“重量”值,然后从当前测量值中减去它)

【问题讨论】:

  • 第一个数据列表中只有一个日期:如果您有超过一周的星期日体重,它们是否会按日期升序排列?

标签: excel indexing match criteria vlookup


【解决方案1】:

我得到了类似于 learnAsWeGo 的东西。试试:

=E9-(INDEX($E$2:$E8,MATCH(1,MATCH($D$2:$D8,D9,0),-1)))

我在比例和重量之间创建了另一列。此列连接汽车+规模。在要显示差异的列中,输入上面的公式。对于无法找到匹配项的情况,您需要在其中抛出 iferror。

Last occurrence difference

【讨论】:

    猜你喜欢
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-21
    • 2017-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-12
    相关资源
    最近更新 更多