Google Sheet VLOOKUP REGEX

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

Google Sheet VLOOKUP REGEX

问题

抱歉,我无法提供关于特定代码的实际翻译,因为这部分包含具体的代码和电脑术语,需要专业背景知识。

英文:

I have a Google Sheet with

IP Address DNS Name MAC Address Port Switch VLAN
<IP address> AP-2802I-16 <mac address>

and another Sheet within the same workbook with
vlan mac type switch
216 <mac address> Yes Switch Name

I'm trying to build a VLOOKUP with REGEX to take the mac address in the first sheet, look it up in the second sheet and only display the corrosponding switch, port, and VLAN if the port starts with gi or te, case insensitive.
I have =IFERROR(ArrayFormula(IF(len(C2:C),vlookup(C2:C,{Port!B2:C},2,FALSE),&quot;&quot;)),&quot;&quot;) but I can't get a regex or wildcard to work in there. Any help would be appreciated.

Tried =IFERROR(ArrayFormula(IF(len(C2:C),vlookup(C2:C,{Port!B2:C},2,FALSE),"")),"") and can't get a regex in it.

Edit
I have this Sheet. In the first tab, I have the IP Address, DNS name, and Mac Address of the device. I have VLAN, Mac Address, port, and switch name in the second tab. I need to grab the Mac Address from the first tab and search for it in the second tab, but only return the information from the line if the port is Gi or te and ignore the other lines with the Mac Address.
https://docs.google.com/spreadsheets/d/1bIAKbQn8ylpHFHOjTdiRJ6mU8uIkhkGLRSRvHvuoBqU/edit?usp=sharing

答案1

得分: 0

=INDEX(IF(LEN(C2:C),IFNA(VLOOKUP(C2:C,FILTER({Port!B:D,Port!A:A},REGEXMATCH(Port!C:C,"(?i)^gi|te")),{2,3,4},)),))

英文:

Can you try:

=INDEX(IF(LEN(C2:C),IFNA(VLOOKUP(C2:C,FILTER({Port!B:D,Port!A:A},REGEXMATCH(Port!C:C,&quot;(?i)^gi|te&quot;)),{2,3,4},)),))

huangapple
  • 本文由 发表于 2023年2月7日 02:48:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75365418.html
匿名

发表评论

匿名网友

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

确定