【发布时间】:2023-03-13 21:38:01
【问题描述】:
我使用 Excel 2013。
我有两张纸:work_hours 和 tasks:
#work_hours!
A B C D
1 Task Hours Cost (sum) Cost per hour
2 Task1 5
3 Task2 3
4 Task1 2
#tasks!
A B C
1 Name Cost (sum) Description
2 Task1 500 Desc1
3 Task2 1000
我想填充work_hour:C 列(成本(总和))自动(按公式)。
每个单元格的值(例如C2、C3、C4...我们称之为MY CELL)应该是:
**MY CELL** value should be: The value of cell ($B;x) from `tasks` sheet,
where x is the row index in `tasks` where name (A column) match the name
from the row of **MY CELL**.
所以在我的例子中,公式应该产生:
#work_hours!
A B C D
1 Task Hours Cost (sum) Cost per hour
2 Task1 5 500
3 Task2 3 1000
4 Task1 2 500
我知道tasks 的行索引可以通过以下方式找到:
=MATCH(C2;tasks!A:A;0)
返回2。
但是如何更改该公式,使其返回500(tasks 中具有相同行索引的B 列的值)?
【问题讨论】:
-
使用索引,匹配为第二个参数
-
我认为你想匹配 A2 而不是 C2...
标签: excel