Remove specifig part of all URL's in a sheet - regex

I have a sheet with multiple links, all in the format of https://abc.xyz.com/randomstuff and I would like to remove the abc. from all of them.
Is there a way to somehow automate that for me inside google sheets?

try:
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A6:A16, "(https?://)")&
REGEXEXTRACT(A6:A16, "[^\.]\.+(.+)")))

You can do that with Substitute():
=SUBSTITUTE(A1,"abc.","")
Or even use Arrayformula() to apply the formula to a range of values:
=ARRAYFORMULA(SUBSTITUTE(A1:A,"abc.",""))

Related

I want to turn this if formula into an array formula but cant seem to get it to auto populate down the rows

I want the driving distance between two address's and I am running a script that allows the following statement work.
This works but I have to drag the formula down when new rows are added from my mobile app into my sheet
=(IF(ISBLANK($AF2:$AF),"",DrivingMeters($E2:$E,$AF2:$AF)/1000))
This doesn't work
=ARRAYFORMULA(IF(ISBLANK($AF$2:$AF),"",DrivingMeters($E$2:$E,$AF$2:$AF)/1000))
I cant work out what I am doing wrong?
it could possible be you need to adjust your DrivingMeters custom formula to accept arrays. Please share the sheet or custom formula
try:
=ARRAYFORMULA(IF(AF2:AF="",, DrivingMeters(E2:E, AF2:AF)/1000))

Extract column value using REGEXEXTRACT with ARRAYFORMULA

I have a column in Google Sheets with values like 1(current), 2(current), etc. I am getting these values from google form response.
I want to extract only the integer from cell value as 1,2,3.. so on.
I am able to use SPLIT(A2, "(current)") for cells. But this does not get applied for new values from form response.
I found that ARRAYFORLMULA can be used for applying a formula to new responses from forms, but somehow it isn't working. I tried them as mentioned below, but I am not sure if I am using it correctly.
=ArrayFormula(QUERY( SPLIT(E2:E,"(current)")))
=ArrayFormula(SPLIT(E2:E,"(current)"))
Can someone help with how to achieve above answer with REGEXEXTRACT?
try like this:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(E2:E, "\d+")))

How can I use ArrayFormula within a formula containing Vlookup, Filter and RegexMatch

I'm making a Google Spreadsheet which checks if a Value in Column A contains keywords out of a List in Column F. Problem is that I want to check if the value in A is exactly the same OR partly the same.
With a lot of help i've found over here I created this working formula:
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A2);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:G)));1;FALSE)
Because I automatically import new lines of data I want to use ARRAYFORMULA. Unfortunately, I can't get it done.
This are my working formulas:
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A2);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:F)));1;FALSE)
=VLOOKUP(FILTER(ArrayFormula((LOWER(F:F)));REGEXMATCH(LOWER(A3);ArrayFormula((LOWER(F:F)))));ArrayFormula((LOWER(F:F)));1;FALSE)
You can find my spreadsheet over here:
https://docs.google.com/spreadsheets/d/1aIdQ65SdeXW-4cTr8azQIiLNGcRCvTexGS_lFu8mECs/edit#gid=1308644379
=ARRAYFORMULA(PROPER(IFERROR(REGEXEXTRACT(LOWER(A2:A); LOWER(TEXTJOIN("|"; 1; F2:F))))))

Google Query Language GQL string manipulation I need a REPLACE or SUBSTITUTE function

I'm using Google Sheets with an imported CSV.
The range I perform queries on is called 'Import'
I need to do simple string functions, like REPLACE() and LEN() to evaluate if the data I have is acceptable.
I've been searching, and cannot find any way to manipulate strings in Google Query Language?
Other sources suggest I can use 'Standard' SQL, but I don't seem to be able to?
Any ideas where to look and learn? This language doesn't seem well supported and I couldn't find any IRC groups either.
What I have:
=query(Import,"select A,B,F,E,AL where not AL matches '^[A-Za-z]{2}[ ]{0,1}[0-9]{2}[ ]{0,1}[a-zA-Z]{3}$'")
What I want: (T-SQL)
=query(Import,"select A,B,F,E,AL where not REPLACE(AL," ","") matches '^[A-Za-z]{2}[ ]{0,1}[0-9]{2}[ ]{0,1}[a-zA-Z]{3}$'")
Google query language is very limited and there is no function that will give you the requested functionality. You should be able to perform the necessary replacements on your data before you run the query on them, though, using standard Google Sheets functions.
You can manipulate the data while defining the Query Range in the Query Formula itself, e.g.:
=query(ArrayFormula(regexreplace('Filters#0'!F1:L250,"Eliminate ","")),"select Col1, Col7 where Col7 matches '(.*\d{1,3}\.){3}.*'"))

Snippets on google sheets

I have to answer a F.A.Q by google sheets, and I have a list of models answers. I wanted a way to do a snippet in google sheets
for example if a type "#answer1" he replace for my model answer number 1.
Thanks
The best way to do this is to use a combination of an Index and Match function. You could use Vlookup also but I prefer Index Match as it is more flexible and performant.
If you type #answer 1 into any one of cells a1:a3 and then put your lookup table in cells c1:d3 then put the following formula into b1:
=index($D$1:$D$3,match(A1,$C$1:$C$3,0))
cmd/ctrl + d it down to fill the rest of the table.
See: http://i.stack.imgur.com/gWjjh.png