Excel自动化比较数字

huangapple go评论59阅读模式
英文:

Excel Automation to Compare Numbers

问题

在一个工作表中,我有两列数字列表:

列表 1 列表 2
12865 4523
1239  1392
5467  3942
5021  2935
32012 99945

等等...

在第二个工作表中,我有与第一个工作表的列表 1 中相同的数字,但顺序不同,并且有一个空的第二个列表。

列表 1 列表 2
1239
5467
12865
32012
5021

我知道这是一个相当基本的问题,但是否有一种方法可以自动化,使 Excel 根据匹配的数字查看列表 1 并填充列表 2?

感谢任何帮助!

英文:

In one sheet, I have two lists of numbers:

List 1 List 2  
12865 4523  
1239  1392  
5467  3942  
5021  2935  
32012 99945 

and so on...

In a second sheet, I have the same numbers as in List 1 on the first sheet, but in a different order, and a blank second list.

List 1 List 2  
1239  
5467  
12865  
32012  
5021

I know this is a pretty basic problem, but is there a way to automate so excel looks at the numbers in list 1 and populates list 2 based on the matching numbers?

Thank you for any help!

答案1

得分: 1

=IF Sheet1 包含在列 A 和 B 中的 List1 和 List2,Sheet2 包含在列 A 中的 List1,Sheet2!B2 中的公式可以如下所示:

=IFERROR(VLOOKUP(Sheet2!A2,Sheet1!A2:B6,2, FALSE),"")

IFERROR 会过滤错误值并将它们替换为空白。

在将此公式输入到 Sheet2!B2 后,双击填充柄以自动将其扩展到整列。

英文:

If Sheet1 contains List1 and List2 in the columns A and B and Sheet2 contains List1 in the column A, formula in the Sheet2!B2 can look like this:

=IFERROR(VLOOKUP(Sheet2!A2,Sheet1!A2:B6,2, FALSE),"")

IFERROR filters error values and replace them with blanks

After entering this formula into Sheet2!B2 double click on the fill handle to expand it to all column automatically.

huangapple
  • 本文由 发表于 2023年6月21日 23:19:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76524863.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定