簡體   English   中英

根據行/列索引從另一個工作表中查找單元格值

[英]Finding the cell value from another sheet basing on row/column index

我使用Excel 2013。

我有兩張紙: work_hourstasks

#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列( Cost(sum) )。

每個單元格的值(例如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 (具有相同行索引的tasksB列的值)?

像這樣嘗試VLOOKUP

=VLOOKUP(C2;tasks!A:B;2;0)

這將使C2與Tasks中的列A匹配,然后從第二列返回值

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM