两张Excel表格中的数据如何匹配?

有两张Excel表,两张表的数据格式不一致,表01的A列与表02的C列能对应但是乱序,我想将02表的A列信息匹配到01表的B列上。请各位大虾帮帮忙拉!

温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-07-11
用匹配,首先就用到VLOOKUP()函数
但要进行配匹的数据要在要在整个数据的左侧,所以你首先要将A列数据复制到C列,然后即可在表1的B列第一行填入公式
【=iferror(vlookup(A1,02!B:C,2,false),"")】即可本回答被网友采纳
第2个回答  2019-07-11
excel表格中,匹配关键字可以找出两个表格数据的相同值并进行分析与计算。通常有两种方法: 1 公式法: 比如在sheet1的A列,需要查找sheet2的B列在不在A列里面,那么在Sheet2的C列就可以写如下公式: =vlookup(B1,sheet1!A:A,1,0) sheet1的数据: sheet2的数据与公式 途中#N/A就是没有找到,未匹配。方法二:通过vba代码来查找并上色: Sub filter() Dim s1 As Variant Dim i, j As Integer Dim foundRange As Range Application.ScreenUpdating = False s1 = Sheet2.Range("B1:B180").Value For i = 1 To UBound(s1, 1) Set foundRange = Sheet1.Range("B1:B20357").Find(What:=s1(i, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext) If Not foundRange Is Nothing Then Sheet1.Cells(foundRange.Row, 2).EntireRow.Interior.Color = rgbRed Else MsgBox s1(i, 1) & "并未在sheet1中找到", 64 End If Next i Application.ScreenUpdating = True End Sub
第3个回答  2019-07-11
excel表格中,匹配关键字可以找出两个表格数据的相同值并进行分析与计算。通常有两种方法: 1 公式法: 比如在sheet1的A列,需要查找sheet2的B列在不在A列里面,那么在Sheet2的C列就可以写如下公式: =vlookup(B1,sheet1!A:A,1,0) sheet1的数据: sheet2的数据与公式 途中#N/A就是没有找到,未匹配。方法二:通过vba代码来查找并上色: Sub filter() Dim s1 As Variant Dim i, j As Integer Dim foundRange As Range Application.ScreenUpdating = False s1 = Sheet2.Range("B1:B180").Value For i = 1 To UBound(s1, 1) Set foundRange = Sheet1.Range("B1:B20357").Find(What:=s1(i, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext) If Not foundRange Is Nothing Then Sheet1.Cells(foundRange.Row, 2).EntireRow.Interior.Color = rgbRed Else MsgBox s1(i, 1) & "并未在sheet1中找到", 64 End If Next i Application.ScreenUpdating = True End Sub
第4个回答  2019-07-11
excel表格中,匹配关键字可以找出两个表格数据的相同值并进行分析与计算。通常有两种方法: 1 公式法: 比如在sheet1的A列,需要查找sheet2的B列在不在A列里面,那么在Sheet2的C列就可以写如下公式: =vlookup(B1,sheet1!A:A,1,0) sheet1的数据: sheet2的数据与公式 途中#N/A就是没有找到,未匹配。方法二:通过vba代码来查找并上色: Sub filter() Dim s1 As Variant Dim i, j As Integer Dim foundRange As Range Application.ScreenUpdating = False s1 = Sheet2.Range("B1:B180").Value For i = 1 To UBound(s1, 1) Set foundRange = Sheet1.Range("B1:B20357").Find(What:=s1(i, 1), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext) If Not foundRange Is Nothing Then Sheet1.Cells(foundRange.Row, 2).EntireRow.Interior.Color = rgbRed Else MsgBox s1(i, 1) & "并未在sheet1中找到", 64 End If Next i Application.ScreenUpdating = True End Sub

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网