![](/img/trans.png)
[英]Search each cell in a column to find a certain value and copy value from another cell in the row the value is found in
[英]Search for the number in a cell then copy a cell from that row to another cell
我需要將下游數字例如6.25(單元格L2)放入單元格L1中。 但這必須從數據庫中找到。 因此,如果Cell B1
匹配column B
中的任何地方,請復制該行的L值,然后復制到原始行即L1的L列中。 我認為VLookup是我正在嘗試做的,但無法使其正常工作...
PIPE 17888 Upstream Pit ID 20447 Concrete Circular Pipe 1/04/2015 380 6.36 img008.jpg
PIPE 17888 Downstream Pit ID 22105 Concrete Circular Pipe 1/04/2015 380 Downstream 6.25 img010.jpg
PIPE 17854 Downstream Pit ID 22105 Concrete Circular Pipe 1/04/2015 380 Downstream 6.36 img010.jpg US PIPE NOT FOUND
PIPE 17811 Upstream Pit ID 22105 Concrete Circular Pipe 1/04/2015 380 6.25 img010.jpg
PIPE 18105 Downstream Pit ID 23037 Concrete Circular Pipe 1/04/2015 600 Downstream 5.94 img014.jpg
如果可以確定B列中的每個ID僅對“下游”出現一次,則可以使用允許多個條件的SUMIFS查找正確的值以添加到適當的單元格中。
=SUMIFS($L$2:$L$1000,$B$2:$B$1000,B2,$C$2:$C$1000,"Downstream")
請注意,特定的ID是非固定的單元格引用-在此為B2。
但是,這不會顯式標記任何問題。 如果沒有找到對應的記錄,它將只是評估為零,如果找到兩個或更多匹配的記錄,它將對結果求和。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.