Multiple links to hyperlink string (Split and concatenate with ArrayFormula) - google-sheets

I'm trying to figure out how to make a formula to turn links in one cell into hyperlinks in another
From cell A1, A2 etc I'm trying to get cell B1, B2 etc using the Split and concatenate formulas. But it's not possible to process each link to make a "wrapper" and then wrap it back into one cell
A1
https://link.com/xxxxxx1, https://link.com/xxxxxx2, https://link.com/xxxxxx3
A2
https://link.com/xxxxxx1, https://link.com/xxxxxx2, https://link.com/xxxxxx3, https://link.com/xxxxxx4, https://link.com/xxxxxx5
B1
Button 1, Button 2, Button 3
B2
Button 1, Button 2, Button 3, Button 4, Button 5
https://docs.google.com/spreadsheets/d/1v8dYt6CIgwnlcc5HKJLNvuAcLZI0IKRTInsprs56hsU/edit?usp=sharing

try:
=INDEX(TEXTJOIN(", ", 1, "<a href="""&SPLIT(A1, ", ")&""">"&
"Name "&SEQUENCE(1, 3)&"</a>"))
arrayformula:
=INDEX(REGEXREPLACE(TRIM(FLATTEN(QUERY(TRANSPOSE(IF(A1:A="",,
IF(IFERROR(SPLIT(A1:A, ", "))="",,"<a href="""&SPLIT(A1:A, ", ")&""">"&
"Button "&SEQUENCE(1, 5)&"</a>,"))),,9^8))), ",$", ))

Related

Google Spreadsheets, Insert a cell value to another cell

I don't know anything about scripts so I would prefer a function.
I have a table like this:
a1
b1
c1
a2
b2
c2
If "a1" = 1 a2 = today's date.
For example:
if I write to a1 cell a "1" it will "transform" into today's date,
if anything else nothing happens.
You can simply put this formula in A2 cell :
=if(A1=1,TODAY(),"")

How can I change the range of countif() inside an arrayformula()?

I want to find duplicates that happen after the current row. I can find duplicates that happen anywhere with this formula but I don't want to flag the last occurrence of a particular value as being a duplicate.
=arrayformula(if(row(B:B) = 1, "Duplicate", if(not(isblank(A:A)), if(countif(A:A, A:A) > 1, "Yes", "No"), "")))
If I statically specify a starting cell in the lookup range it only finds duplicates after that spot. However I need to have the starting spot change based on the row I'm on.
=arrayformula(if(row(B:B) = 1, "Duplicate", if(not(isblank(A:A)), if(countif(A5:A, A:A) > 1, "Yes", "No"), "")))
I tried using indirect() and row() but it doesn't seem to update for each row.
=arrayformula(if(row(B:B) = 1, "Duplicate", if(not(isblank(A:A)), if(countif(indirect("A"&row(B:B)&":A"), A:A) > 1, "Yes", "No"), "")))
try:
={"Duplicate"; ARRAYFORMULA(IF(INDIRECT("A"&ROW()+1&":A")<>"",
IF(COUNTIF(INDIRECT("A"&ROW()+1&":A"), INDIRECT("A"&ROW()+1&":A")) > 1, "Yes", "No"), ))}
UPDATE:
={"Duplicate";
ARRAYFORMULA(IF(A2:A="",,
IF(COUNTIFS(A2:A, A2:A, ROW(A2:A), ">="&ROW(A2:A))>1, "Yes", "No")))}

Trim text in Google sheet

https://videows1.douyucdn.cn/live/high_12350844720190721092508-upload-f6cd/0704ae76898440f99c6e738c687d413a_0000000.ts?k=db7c96ce8829f45a9b473a453c73dd8a&t=15d4b829f&nlimit=5&u=275209677&ct=web&vid=10201331&pt=2&cdn=ws&d=6c1ede202b60f1196d299eb100091501
I want to trim this URL in 3 rows in Google sheet like that
A1:
https://videows1.douyucdn.cn/live/high_12350844720190721092508-upload-f6cd/0704ae76898440f99c6e738c687d413a
A2:
_0000000.ts
A3:
?k=db7c96ce8829f45a9b473a453c73dd8a&t=15d4b829f&nlimit=5&u=275209677&ct=web&vid=10201331&pt=2&cdn=ws&d=6c1ede202b60f1196d299eb100091501
cell A1:
=LEFT(INDEX(SPLIT(A6, "?"),,1),LEN(INDEX(SPLIT(A6, "?"),,1))-11)
cell A2:
=RIGHT(INDEX(SPLIT(A6, "?"),,1), 11)
cell A3:
="?"&INDEX(SPLIT(A6, "?"),,2)
all in one:
={LEFT(INDEX(SPLIT(A6, "?"),,1),LEN(INDEX(SPLIT(A6, "?"),,1))-11);
RIGHT(INDEX(SPLIT(A6, "?"),,1), 11);
"?"&INDEX(SPLIT(A6, "?"),,2)}

Leave a cell blank until data is entered in different cell in Google Sheets

Can someone help me to type this formula: =IF($F5>0,I4/$F5,0)
inside this formula: =IF(F5="","",[I-want-to-type-it-here])
The first formula =IF($F5>0,I4/$F5,0) is to calculate the profit margin, and the second is to leave the cell empty until I enter data in a different cell.
try it like this:
=IFERROR(IF($F5>0, I4/$F5, 0), )
=IF(F5="", ,
IF($F5>0, I4/$F5, 0))
=IF(F5="", , IFERROR(IF($F5>0, I4/$F5, 0),
IF($F3>0, I3/$F3, 0)))

concatenate ignoring empty cells

I may or may not have information in the cells that I want to concatenate.
If cell a and cell be are populated, I would like cell c to have: "a, b"
If cell a is populated and b is not then cell c to have: "a"
If cell b is populated and a is not then cell c to have: "b"
If both cell a and b are empty then cell c to be empty
I can do a simple concatenation: a1 & ", " & b1
But the simple concatenation gives results like ", oranges" or ", "
Anyone have a formula that will solve this?
Let a be at E20 and b be at F20. Then the function
=IF(AND(ISBLANK(E20);ISBLANK(F20));"";IF(AND(ISBLANK(E20);NOT(ISBLANK(F20)));F20;IF(AND(NOT(ISBLANK(E20));ISBLANK(F20));E20;CONCATENATE(E20;", ";F20))))
should be appropriate for your purposes.

Resources