This should have been simple but I can't find a workaround. I want to split a string into its characters.
e.g. dog will be sepearted to:
d
o
g
The problem is I can't put an empty character as a delimiter in the SPLIT function.
What am I missing?
Also
=ArrayFormula(mid(A1,sequence(1,len(A1)),1))
Something like this ?
=split(regexreplace(A2, "(.)", "$1_"), "_")
or if you'd want an arrayformula to process a column at once
=ArrayFormula(if(len(A2:A), split(regexreplace(A2:A, "(.)", "$1_"), "_"),))
Reference
More info on how this works? Check this link.
Try the following
=SPLIT(REGEXREPLACE(O13,"(.)","$1"&"-"),"-",1,1)
Related
I have a column which has urls, So below are the values of the column
https://www.example.com/jasja
https://www.example.com/jasdqw?new=exact
So what I want to extract is before the question mark and after the last slash
So here my output in the column should be
jasja
jasdqw
How can I get this using Regex
Tried =REGEXEXTRACT(C2:C16, SPLIT()), but don't know how to use this
Any help is appreciated
We can use REGEXEXTRACT with a capture group:
=REGEXEXTRACT(C2, "/([^/]+?)(?:\?|$)")
Here is a regex demo.
You could also try
=RegexExtract(A1,".*/(.*?)\?")
A2:
96610,80508,64406,48305
How do I extract the last value, in this case 48305?
There must be an easy solution, but I can't come up with it.
Another way would be something like
=regexextract(A2&"", "[^,]+$")
or, to convert the output to a number:
=regexextract(A2&"", "[^,]+$")+0
This formula did it:
=TRIM(RIGHT(SUBSTITUTE(A2,",",REPT(" ",500)),500))
I have a google sheet with a column (A) of urls.
Xttps://tXco/008wnbebbw
Xttps://tXco/00lR1FNKBo
Xttps://tXco/00lR1Fw9cO
Xttps://tXco/00UwZwgh2h
Xttps://tXco/00UwZwxSqR
Xttps://tXco/00UwZwxSqR
Xttps://tXco/044TcIFl72
In column B I need to find all unique urls up to the 18th character. For instance column B should show:
Xttps://tXco/008wnbebbw
Xttps://tXco/00lR1FNKBo
Xttps://tXco/00UwZwgh2h
Xttps://tXco/044TcIFl72
I have this formula which I was trying to adapt for it (not sure if it helps at all). I was trying to adapt this to use with =UNIQUE( ?
=SUMPRODUCT(--(LEFT($A$1:$A$15,18)=LEFT(A1,18)))>1
If it helps to take a look at the sheet, here it is: https://docs.google.com/spreadsheets/d/1tG7TpHNvNY86PRiePsKyKfxnuEZah6T7ZDL7dXOIcEA/edit?usp=sharing
Thanks in advance!
You may try this formula:
=ArrayFormula(vlookup(
UNIQUE(FILTER(LEFT(A2:A,17),A2:A<>"")),
FILTER({LEFT(A2:A,17),A2:A},A2:A<>""),
2,0))
How it works
it will first find unique left N chars:
UNIQUE(FILTER(LEFT(A2:A,17),A2:A<>"")
then get left N chars and original strings:
FILTER({LEFT(A2:A,17),A2:A},A2:A<>"")
and then use vlookup to get top first entry for uniques.
Try this instead without the extra column. Put it in B1:
=unique(arrayformula(if(left(A1:A,18)=left(A1:A,18),A1:A,"")))
Try this: =unique(arrayformula(left(A1:A,18)))
Is it possible to do a string manipulation of data in a Google Sheet query?
I want to do something like the following:
=QUERY(someRange!A:Z, SELECT A, SUBSTITUTE(B, "OCH", ""))
The idea being that all rows' column B is 'OCHXXXXXXX' where X is a digit. I would like to get rid of the chars.
On a side note... Is this possible in MySQL? How?
This formula might work for you:
=QUERY({Sheet1!A:A,ARRAYFORMULA(SUBSTITUTE(Sheet1!B:B,"OCH","")),Sheet1!C:Z})
I would suggest:
=arrayformula(REGEXREPLACE(somerange!B:B, "OCH", ""))
so what Iam trying to do is:
Find a certain string in Spreadsheet1!A:A and give the value that is in B:B right next to the found value in A:A as an output.
My approach:
=VLOOKUP(B1;Spreadsheet1!A:A;Spreadsheet1!B:B)
The Problem:
VLOOKUP wont give strings back as a value. But I need the string for another formula. Is there any workaround, that does not include scripting?
Thank you!
Try this:
=VLOOKUP(B1;Spreadsheet1!A:B;2,False)
B1 should be the value that can be found in Spreadsheet1!A:A