根据身份证号取姓名值
根据身份证号取姓名值=IFERROR(IFERROR(IFERROR(IFERROR(VLOOKUP(A2,IF({1,0},'1月'!B:B,'1月'!A:A),2,),VLOOKUP(A2,IF({1,0},'2月'!B:B,'2月'!A:A),2,)),VLOOKUP(A2,IF({1,0},'3月'!B:B,'3月'!A:A),2,)),VLOOKUP(A2,IF({1,0},'4月'!B:B,'4月'!A:A),2,)),VLOOKUP(A2,IF({1,0},'5月'!B:B,'5月'!A:A),2,)) =INDIRECT(TEXT(MAX(IF(T(OFFSET(INDIRECT("'"&COLUMN(A:E)&"月'!b1"),ROW($1:$98),))=A2,COLUMN(A:E)/1%%+ROW($2:$99)/1%+1)),"0月!!r00c00"),)
数组三键盘下拉即可 如果姓名超过了99行,要怎么修改呢? 是不是把相应的改成“/1%%%”和“!R0000C00”就可以了。 =IFERROR(INDEX(LOOKUP(1,0/COUNTIF(INDIRECT("'"&ROW($1:$5)&"月'!B:B"),A2&"*"),INDIRECT("'"&ROW($1:$5)&"月'!a:a")),MATCH(A2,LOOKUP(1,0/COUNTIF(INDIRECT("'"&ROW($1:$5)&"月'!B:B"),A2&"*"),INDIRECT("'"&ROW($1:$5)&"月'!b:b")),)),"")
群里雪神搞出来的=VLOOKUP(A2,T(INDIRECT(INT(ROW($100:$599)%)&"月!"&{"B","A"}&MOD(ROW($100:$599),100)+1)),2,) 啥群? 大佬们值得学习啊 我发一个这个
Sub 开整()
Dim 各月, 结果, Sht As Worksheet
Dim Dic As Object
Set Dic = CreateObject("scripting.dictionary")
For Each Sht In Worksheets
If InStr(Sht.Name, "月") Then
With Sht
各月 = .Range("a2:b" & ..End(3).Row)
For i = 1 To UBound(各月)
Dic("'" & 各月(i, 2)) = 各月(i, 1)
Next
End With
End If
Next
With Sheets("根据身份证号得出姓名")
Range("b2:b" & ..End(3).Row).ClearContents
结果 = .Range("a2:b" & ..End(3).Row)
For i = 1 To UBound(结果)
结果(i, 2) = Dic("'" & 结果(i, 1))
Next
..Resize(UBound(结果), 2) = 结果
End With
MsgBox "整完"
End Sub