Parse current cell contents into URL based on the content of the same cell in Google Sheets - google-sheets

I would like to parse the content of a cell into a URL based on the entered content of the same cell in Google Sheets. I need the entire column to be processed.
Right now I can only accomplish this with two columns like this...
Column A has an ID number. Column B uses an array to parse a URL based on the ID number in Column A. The array formula I'm using in B2 is...
=ARRAYFORMULA(HYPERLINK("http://www.website.com/content/"&B3:B, ""&B3:B))
So A3 might have the ID number entry: 216856
And this creates the URL in B3: http://www.website.com/content/216856
But what I would really love, is a way to do this with one column. Perhaps through a script? Can anyone help me with this, please? Thank you!

If you highlight the column you want to transform then go to edit and choose the find and replace functionality or press command shift and H it will also pop up - then in the find field enter: ^ and in the replace field enter http://www.website.com/content/ and check the search using regular expressions checkbox.
Once you click replace all, it will add that part of the url to the beginning of all the cells thus turning it into a URL for you. Super easy and generally pretty quick depending on how many rows you have - I have done this with tens of thousands of rows and more.

Related

GoogleSheets - bringing back last "n" characters that are uppercase only

I have data that brings back a name plus the ticker code. I need to extract the ticker code only into google sheets.
using: =IMPORTXML("https://www.coingecko.com/?page=5","//tr") I bring back 100 coins but the first column is for example
Dogecoin9DOGE
or
Ethereum2ETH
or
Ethereum ClassicETC
I would like to create a column that simply has DOGE or ETH or ETC, anyone know of a way to manipulate the 1st column to get to that?
Thanks
the webpage looks like it is 2 separate columns but the extract does not work that way. I was trying to think of a way to count the uppercase values and then maybe use a RIGHT(len(uppercasevalues)) but not sure how to get there.
You can use REGEXEXTRACT.
=REGEXEXTRACT(A1,"[A-Z]+$")

How to transpose rows into columns of contact details without mixing them up? (Google Sheets)

I have a data set of contact details where the emails and their names are scattered in rows, I would like to list them in 2 nice columns. I've tried using "paste special" and use this code below, but none of them worked.
This is how it looks like:
I've tried this code, but it only applies to one row, whereas I want to apply it to all rows and columns.
=transpose(A2:R2)
and
=transpose (A2:R300)
Both don't work. I hope somebody can help me with this, I'd really appreciate it. Thanks in advance!
It looks that you are using the wrong terms so you are using the wrong functions.
Apparently you have a cell with data separated by spaces and break lines and you want to have each email and name on it's own cell, having emails on one column and names on the next column.
One way to achieve that, first replace the separating spaces by using a character like | and the break lines by another different character like $.
Note: Some people use Unicode characters that are very unlikely to appear like ♦, ❤.
To do the above for break lines you could use FIND and REPLACE (Ctrl + H) or function formulas like REGEXREPLACE, SUBSTITUTE, and maybe others. As there are spaces used both as word separators and values separators, FIND and REPLACE can't be used easily. For a single cell, maybe the easier way is to insert the name/email separator manually.
Then separate the cell data. To do this you could use a formula function like SPLIT or Data > Separate values into columns.
Another way is by using Google Apps Script and JavaScript string handling methods but basically the algorithm is the same.
Related
How to split this complex string into 3 columns and 50 rows using Google sheet script
Google Apps Script: Create new rows for cells that contain commas
Google Sheets: string to columns and rows

reference cell via two partial matches on another cell

I need to match two conditions on the cell Name and add the price information into cell price if both condition match. In other words, if Name contains both conditions, get the price. I tried different approaches using QUERY, SEARCH; FIND; VLOOKUP but I got stuck somewhere in the middle. Here's the example sheet (Google Spreadsheet solution preferred over Excel):
https://docs.google.com/spreadsheets/d/1zwG3_5Ctg_IZ1kI04Uee-qIvMrNQ4GmEwySmYcMKLfA/edit?usp=sharing
Maybe important: Both, the Name values as well as the whole reference table get pulled from other files dynamically. So I don't know anything concerning order or length of these columns in advance, not even if there are matches at all.
In addition to previous answer AND given the current set of data (in a Google spreadsheet), in B2 try:
=ArrayFormula(iferror(vlookup(regexreplace(A2:A; "[^A-Z]"; ""); {E2:E&F2:F\G2:G}; 2; 0)))
and see if that works ?
Based on your spreadsheet table:
you can try the following formula:
this formula works in excel not in google spreadsheets
=IFNA(INDEX($G$2:$G$6;MATCH(1;COUNTIFS(A2;"*"&$E$2:$E$100&"*";A2;"*"&$F$2:$F$100&"*");0));"NOT FOUND")
this is an array formula, so press ctrl+shift+enter to calculate the formula.
i think it will do the job.
here is the example file to download

Google Spreadsheet & ArrayFormula - auto-adding formulas

I'm having problems with something that is likey very simple to correct. I have a form that submits data to a Google Spreadsheet, simply a date, name and score. On a separate sheet I am going to have a leaderboard which shows all submissions ranked by highest score (for simplicity in the example in the link below, I just have the leaderboard showing up on the right of the same sheet). I have it sorting the data fine, but I'm struggling with getting the 'rank' value to display. As shown for the first 3 rows (G2, G3, G4) I know what the formula is to display the 'rank' value...but what I'm struggling with is how to get that value to show without having to have that formula in each cell. Since the data will be coming from a form, there will obviously be new rows added regularly which means the leaderboard will automatically get adjusted and I want all of the rows to display the rank #. From what I have read, ArrayFormula should allow this to work, but even with looking at examples I can't figure out how to get it to work with my formula.
I know I could just highlight the entire 'G' column and paste in the formula, and hope it adds it to enough rows...but then it displays 'N/A' for all of the rows which don't currenlty have any data.
Hoping its just a simple solution that I'm being dumb and missing...any help would be greatly appreciated. The link to an example is below. To summarize, for all rows that have content in column H and I, the G cell for that row should show the rank value automatically.
https://docs.google.com/spreadsheets/d/1pCIJQi5g2scOtB6o2PgVVb-0azzhupEOPjiL0RMM57A/edit?usp=sharing
Thank you!
=ARRAYFORMULA(RANK(INDIRECT("I2:I"&COUNTA(H:H)),$I$2:I,0))
This will automatically rank and sort, for all values, including additional ones that are added. You only need to enter it into G2, and it will dynamically fill in the rest for you.
You can use
IFERROR(RANK(...),"")
and drag it to all rows - this will leave blank cells instead of #N/As. I'm sure there are other ways but that seems like the easiest one to me.

Exporting values of unchecked items in Google Forms checklist

Using Google Forms checkboxes to collect survey responses into a Sheets doc, I find that I can only get the values of checked lines to fill the spreadsheet.
I'm trying to get the unchecked CheckBox values to fill a different cell in the spreadsheet as well, has anyone found out a way to do this?
I'd appreciate any help!
I have a way with spreadsheet formulas.
The drawbacks are the necessities of
manual input of all possible options
copying and pasting a formula for each response (can be done in advance, but if not enough formulas are pasted for the number of responses, the sheet will break)
An ideal solution would automatically detect all possible responses, and could theoretically accept an infinite number of responses without breaking and needing maintenance.
With that said, he's an example of what I suggest:
Google Sheet
Google Form
All possible options on the form must be typed into cells A2:A
cells B2:B show comma+spaces if the corresponding cell in A2:A is not blank, with =arrayformula(if(isblank(A2:A),"",", ")). These commas and spaces are needed later in a concatenate().
Raw data from the Form Responses spreadsheet was brought into D2:E with =arrayformula('Form Responses 1'!A2:B)
G2:G holds the important formulas. They must be copied and pasted to each individual cell for each row.
First, all possible responses in $A$2:$B are filtered based on if the cell in column A can be found in the text in column E.
=filter($A$2:$B,arrayformula(iserror(search($A$2:$A,E2))))
Next, some error catching. I added an iferror() to catch a "N/A, no results found in filter evaluation", and an if(isblank(),"",) to catch if no timestamp is in column D meaning no response was recorded in this row.
=if(isblank(D2),"",iferror(filter($A$2:$B,arrayformula(iserror(search($A$2:$A,E2)))),""))
Finally, do a concatenate() to pull the values and the comma+spaces all into one string inside one cell.
=concatenate(if(isblank(D2),"",iferror(filter($A$2:$B,arrayformula(iserror(search($A$2:$A,E2)))),"")))
Oh, and if you don't like the comma+space being the last characters in the string, in J2:J I did a =arrayformula(iferror(left(H2:H,len(H2:H)-2),"")) which cuts off the last 2 characters of the string in column H.
If I come up with a better solution, I'll let you know. It's an interesting puzzle to solve.

Resources