[英]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.