![](/img/trans.png)
[英]Copying cell values from one sheet to another, and paste it near a cell with specific value
[英]Find value from one cell, copy value from cell near to that cell and paste it to another sheet
我有2張紙,它們的值不同。 我需要在sheet2的一個cell.sheet1中找到一個值,然后將值從nextcell_in_the_same_row.sheet1復制到nextcell_in_the_same_row.sheet2。 讓我們看下面的例子很難解釋。
例如之前
first sheet:
A B
1 aaa 123
2 bbb 456
3 ccc 789
4 ddd 122
second sheet:
A B
1 aaa
2 ada
3 cca
4 ccc
后
first sheet:
A B
1 aaa 123
2 bbb 456
3 ccc 789
4 ddd 122
second sheet:
A B
1 aaa *need to find value in the first sheet and copy value from B2 because aaa in A1*
2 ada *value does not exist in the first sheet so copy nothing*
3 cca *not need to copy because no value in the first sheet*
4 ccc *need to copy the value from B3*
非常感謝!
將VLOOKUP
與IFERROR
一起使用。
=IFERROR(VLOOKUP(A1, Sheet1!A:B, 2, 0), "")
這將完成您在問題中所描述的(順便說一句!)。 在Sheet2
中將公式向下拖動到底部。
VLOOKUP
接受工作表2中的A1
值(無值工作表,因為該值與公式在同一工作表中),並在工作表Sheet1
A列中查找它。
它返回公式中選擇的表的第二個值(因此為什么2
)(列A為1,列B為2)。
0 VLOOKUP
查找完全匹配。 您無需在此處進行近似匹配。
如果VLOOKUP
找不到任何東西(如使用ada
),則存在IFFERROR
,而不是給出IFFERROR
#N/A
,而是返回一個空單元格""
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.