Google Sheet VLOOKUP REGEX - google-sheets

I have a Google Sheet with
IP Address DNS Name MAC Address Port Switch VLAN
AP-2802I-16
and another Sheet within the same workbook with
vlan mac type switch
216 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),"")),"") 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

Can you try:
=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},)),))

Related

Google Tables INDIRECT function doesn't work how I want

For geting data from another sheet I use function INDIRECT
=INDIRECT("s!$A1")
but I foud a BUG: this formuls locate on another sheet, and if sheet, from which data will be received, doesn't exist yet, then the formula does not work, throws an error that it refers to an invalid range or sheet. If the sheet was created in advance with the desired name, then everything works correctly. If you create a sheet, and then rename it, then return the previous name again, it also does not work.
s - this is the title of the sheet
I found a temporary solution, it works as it should, but it also has a issue
=IMPORTRANGE("link_to_this_file"; "s!$A1") Here is the hard link to the file. This option is not suitable, because when copying a file, the formulas must remain working, otherwise everything will break.
Please let me know what can be done in this case. Maybe there is an option to read the file name to insert into IMPORTRANGE ?
Or is there some other function with similar properties besides IMPORTRANGE, INDIRECT ?
I found one more solution
=query(s!A1;"select * limit 1")
, but....
I don't understand how add the name of sheet dynamically
I need to read name from cell,(the name s located in F25 cell), if I change it to another (for example g)
the formula must changed to
=query(g!A1;"select * limit 1")
Considering that INDIRECT works with strings, and you have in F25 the name of the street you could try:
=INDIRECT(F25&"!A1")
Or, if you have a name with more than one word:
=INDIRECT("'"&F25&"'!A1")

How to Extract the First Name and Last Name From an Email Address in google sheet

I have sheet document of inscription and I need to extract the First Name and the Last Name From an Email Address. I found some solutions like
=LEFT(A3, FIND("_", A3)-1)
but it just split the email address
but I need this output
You can try something like this if you know the delimiter between first and last name and you want them in the same cell: =proper(TEXTJOIN(" ",,REGEXEXTRACT( A2,"(.*)_(.*)#")))

How can I query from one report Tab to another tab the number of calls handled by employees ignoring calls <2min?

I have a call report with two different tabs
TAB 1) "RAWDATA" - Range:A:AB -
a log of two employees´ handled outbound and inbound calls and more columns that are not relevant now.
IMPORTANT COLUMNS:
"D" - SKILL NAME.
Type of call). for us INBOUND would be "RVL_US_Scheduling_PC" and OUTBOUND would be either "RVL_US_Scheduling_OB_PC" or "RVL_US_SchedulingExpress_OB_PC
"I" - CONTACT AGENT NAME
The corresponding column with the employees name in our system
"W" - HANDLE TIME
Te report will inform how long each call lasted which leaves us with the need to only extract only calls greater than 2 MIN
ADDITONAL COLUMN
For OUTBOUND column "V" can also be considered.
TAB 2) "CALLS BY AGENT" - Range: A:E -
This is the tab where I would like to "query" to:
NUMBER OF CALLS HANDLED BY AGENT AND BY TYPE (INBOUND AND OUTBOUND) separately on columns: Kevin: C3 and C4, and Sandra: D3 and D4.
So far I've partially come up with one formula for "inbound":
=QUERY(RAWDATA!A2:W, "select COUNT(D) where I='Aldana, Kevin, Mejia' AND D='RVL_US_Scheduling_PC'")
Unfortunately, when I try to use another "AND" function as follows:
AND W>2:00:00
to limit the query to retrieve only calls longer than 2 min, it´s marking Value Error!
PLEASE HELP ME, TEAM!
I have tried everything even transforming the "duration" (handle time) column to all "formats", and changing it to even proper numbers and change the formula to numeric value and it won't work!
Can anybody assist with the inbound and outbound call count formula for this case scenario? Here´s the file (permissions are open)
Use Filter instead and control the conditions with a dropdown list highlighted in yellow. and counta the output.
=COUNTA(FILTER(RAWDATA!$D$2:$D,RAWDATA!$D$2:$D=B3,RAWDATA!$X$2:$X>$F$3,RAWDATA!I2:I=C$1))

Is it possible to update part of a named range string in a formula using the value from a variable in another cell?

Here is an example of a formula I have written:
=DatabaseVerName&"."&INDIRECT(ADDRESS(4,2,1,TRUE,""&B2&"ChangeLog"))
DatabaseVerName is a named range ...It just so happens that the first word in the string (in this case Database), is the value in cell B2. I would like to be able to update the formula so that when I change the value in B2 (say to the word Report) that the formula references the named range "ReportVerName" and not "DatabaseVerName". FWIW, B2 is a a data validated list with 4 options available.
Is this possible and if so how would I do it?
I haven't tested it, but something like this might work.
=INDIRECT(B3 & "VerName") & "." & INDIRECT(ADDRESS(5,2,1,TRUE,""&B3&"ChangeLog"))
So B3 would be equal to "Database" or some other text, and would get concatenated in front of "VerName" to make up the name of a matching named range and then the remaining part of the address, which appears to have been working for you, would be added.
I haven't tested this, but I think it should work. Let us know.

Obtaining an IP address from a web domain

I would like to retrieve an IP address for any given domain, e.g. google.com would return the IP address 172.217.18.174.
Using the following line on Google Sheets I always get the error
"Imported XML content can not be parsed."
=importxml("http://xml.utrace.de/?query=google.com","//ip")
And I also tried the following ones without luck:
=importxml("http://xml.utrace.de/?query=google.com","//results/result/ip")
=importxml("http://xml.utrace.de/?query=google.com","/*")
Any help is highly appreciated.
=REGEXREPLACE(QUERY(IMPORTDATA("http://xml.utrace.de/?query="&A20),
"where Col1 contains 'ip'"), "<ip>|</ip>", "")
=INDEX(IMPORTHTML("https://tools.keycdn.com/geo?host="&A20, "table", 1), 1, 2)

Resources