Google Sheets, how can I remove or strip specified strings - google-sheets

I'm using Google Sheets and trying to figure out a formula that strips or removes specific strings. So a cell might have:
[url=https:website1]https:website1[/url] [url=https:website2]https:website2[/url]
and I want to convert it to
https:website1 https:website1
Each cell in the column will have different "websites" but the formatting will be similar. Any help is appreciated.
I've tried REGEXEXTRACT and SUBSTITUTE functions but can't seem to figure it out.

can you try:
=BYROW(A2:A,LAMBDA(ax,IF(ax="",,TEXTJOIN(CHAR(10),1,INDEX(REGEXEXTRACT(SPLIT(ax,"[url=",0,0),"[^\]]*"))))))

Related

ARRAYFORMULA && Extract Num From String

Trying to use an arrayformula on google sheets to auto-populate a column which will extract the number from a string. I've found / made multiple methods of extracting the number from the string, but I can't seem to get it to work in an arrayformula.
This formula works perfectly to extract the text, but because it's creating an array it's not working within the array formula.
TEXTJOIN("",TRUE,IFERROR((MID(H13,ROW(INDIRECT("1:"&LEN(H13))),1)*1),""))
This below just won't work. I've tried multiple methods, but can't get it working. Clearly I'm making a circular reference, but I can't see to solve it.
=ARRAYFORMULA(IF(ROW(C12:C)=12, "Num", IF(ISBLANK(C12:C), "", TEXTJOIN("",TRUE,IFERROR((MID(H13:H,ROW(INDIRECT("1:"&LEN(H13:H))),1)*1),"")))))
Included is an example worksheet, with a column with expected output.
Thanks for your time! :)
Example Worksheet
What you could try, as I demonstrated in M13 on your sheet, is to use REGEXREPLACE() to remove anything from your data that is not a digit through "\D":
=INDEX(IF(H13:H="","",REGEXREPLACE(TEXT(H13:H,"#"),"\D","")))

TEXT() equivalent for strings in Google Sheets?

In Google Sheets, TEXT() can format numbers but I cannot find one for strings.
For example,
TEXT(012345678,"00-000-0000")
formats the number into
01-234-5678
I want to do a similar thing but with strings, like:
AABCDEEEF to AA-BCD-EEEF
I guess using several functions can yield the same result but I want to know if there is a simple method, like TEXT().
I believe your goal as follows.
You want to convert AABCDEEEF to AA-BCD-EEEF.
How about this sample formula?
Sample formula:
=ARRAYFORMULA(REGEXREPLACE(A1:A5,"(.{2})(.{3})(.{4})","$1-$2-$3"))
In this case, I used REGEXREPLACE.
When you want to use only one cell, please use REGEXREPLACE(A1,"(.{2})(.{3})(.{4})","$1-$2-$3")
Result:
Reference:
REGEXREPLACE

Google Sheets - Parse Number / Currency

I have a spreadsheet in Google Sheets. I have a column with a set of strings e.g. '£3.36'. Now I wish for these to be treated as a number/currency and not as a string, as I am unable to mathematically manipulate them otherwise.
I have tried removing the £ by using =Right() and =LEN(), but unfortunately, sheets still considers them to be a string.
I have tried changing the format of the cell and selecting currency, but this does not work either.
I have also tried =TO_PURE_NUMBER(), but this didn't work for me either.
Has anybody got any suggestions?
All help is appreciated.
Scratch that. =right(x,len(x)-1) does actually work!

How to show duplicates on 2 google sheets at the same time?

This conditional format command shows duplictes on the Sheet1 perfectly:
Appliy to range A:A
=COUNTIF(A:A,A1)>1
Is it possible make it work with Sheet2 at the same time. I've read that INDIRECT could help but I don't understand how to do that.
I tried this with no luck:
If you want it to check both sheets for duplicates, you can still use almost the same formula, but you have to put the references into an Indirect statement:
=countif(INDIRECT("Sheet1!A:A"),A1)+countif(INDIRECT("Sheet2!A:A"),A1)>1
as mentioned in the documentation

Conditional Formatting based on sum of the 6 cells below

I was Hoping to be fever along before i had to ask for help but.
using Google sheets i am trying to have a range of cells(a row specificity) change there background colour based on the Sum of the 6 cells directly below it in the
I know I am happy using the basic conditional forming and i have a formula witch will return true if the Sum = what i am looking for
=IF(SUM(D6:D11)=6,true,FALSE())
and this works if i copy and past it along but if i try to put it in the Custom formula is box i get told
There was a problem while
Cannot save the rule with invalid formula.
so i take it that i am not using the box right
any help would be greatly appreciated
Conditional formatting is ... conditional. There is not normally any need for IF(). Your formula should work as:
=Sum(D6:D11)=6
but over what range and what cells to format (other then D5) I can't help you, if required, without further details.
Please though do read the [google-spreadsheet] tag wiki.

Resources