How to convert HTML formatting inside google sheets rows to their correct formatted equivalent - google-sheets

I have been looking for a solution to convert a database I have with HTML formatting in one of the columns to its "normal" text equivalency in google sheets. A lot of the solutions I've found dealt with writing programs to do this or using Excel, so they unfortunately didn't pertain well enough.
For example in one of my columns I have;
Fast (<i> This character deals damage before non-<b>Fast</b> characters in combat.</i>)
But I would like to be able to have a somewhat streamlined solution to convert the above to:
Fast (This character deals damage before non-Fast characters in combat.)

AFAIK, with Google Sheet API, you can only format text within a cell. As mentioned in documentation, conditional formatting lets you format cells so that their appearance changes dynamically according to the value they contain, or to values in other cells.
You may want to request new feature here.

Related

Combining REGEXEXTRACT and SUBSTITUTE in Google Sheets Formula

I'm extracting text from filename cells into separate metadata field cells. So far I have done this successfully using the REGEXTRACT formula, as seen below.
=REGEXEXTRACT(A1, "TILEABLE|ROOM|MAIN|FLOORSHOT|SWATCH|ANGLED")
However some metadata fields that include multiple words require that a space or other character be placed between words. I'm trying to figure out how to use SUBSTITUTE or REPLACE in conjunction with REGEXTRACT to find a phrase and replace it with a version with something different. Ex. Replace "TOPDOWN" with "Top Down" or replace "1TO1" with "1-to-1).
Depending on your purpose one formula might be better than other. If you want to list in a column the substituted values of this string you could chain the number of phrases you want using SUBSTITUTE and REGEXTRACT.
This will return all the phrases you are looking for and substitute them to then use the formula TRANSPOSE to take this range and display it in a columns (as it normally would be displayed in a row and only a single value). This is a simple example:
=TRANSPOSE({SUBSTITUTE(REGEXEXTRACT(A1,"TOPDOWN"),"TOPDOWN","Top Down"),SUBSTITUTE(REGEXEXTRACT(A1,"SHIRTS"),"SHIRTS","Shirts1")})
try:
=SUBSTITUTE(SUBSTITUTE(REGEXEXTRACT(A1,
"TOPDOWN|1TO1|TILEABLE|ROOM|MAIN|FLOORSHOT|SWATCH|ANGLED"),
"TOPDOWN", "Top Down"),
"1TO1", "1-to-1")

Transform comma separated google form answers to multiple lines in spreadsheet

I have made a google form to which some answers are formatted as comma separated strings inside the automatically populated google spreadsheet. I would like to read from this sheet to another sheet and reformat the answers so that each comma separated answer is shown on a new row. I have tried to apply an ARRAYFORMULA that reads from the original sheet and then use a solution that uses SPLIT and TRANSPOSE the cell content, however combined with the ARRAYFORMULA this fails since it would overwrite contents in other cells.
Here is an example spreadsheet with the responses, a solution sheet, and a desired results sheet. https://docs.google.com/spreadsheets/d/1r_l5fVJ9lGfpubO2o3pXicV7JlZWmANjwSgNi7_DL0A
Any suggestions for how I can achieve the end result?
Okay, I assume this isn't really what you want, but visually it looks okay...
Try this formula:
={{'Form responses'!A2:A3},ArrayFormula(regexreplace('Form responses'!B2:E3,", ",CHAR(10)))}
Then format the cells so that the cell contents are TOP-aligned, instead of the default BOTTOM-aligned.
Realistically, I imagine that you want each question answer split into multiple cells. But if your data responses really contain letter values separated by commas, as you've indicated, you can still search through those cells to find whether an answer contains a certain value. It all depends on why you want the results structured the way you do.
If you can clarify what you want to do with the form results, instead of just appearing vertically for each question, perhaps we can provide a full solution for that requirement?
UPDATE1:
Okay, I may be getting close. I can get your data transformed to look like the following:
This would let you do the analysis that you want, by searching for Q.1 (question 1 responses) in the first column, and then all the answers in the third column, along with the owner in column 2. And from this, it will also definitely be possible to put the results in the exact form you want. It just may take an intermediate step.
UPDATE2:
Okay, I think I have something you can use. I can convert your data to either of the following two layouts.
The one on the right is closest to what you asked for, with the exception that the answers on the right are bottom aligned, with blanks above. But you can still process them for analysis, with queries. I honestly think having the user identifier (email address) on each row would make things simpler, but I can provide it either way.
The layout on the left is more of a traditional database layout, and would make analysis very simple. Each row has the date and email identifiers, the question number, and the answer (or one of the answers) to that question, from that user.
If this is helpful, it might be best if you enabled your sample sheet to allow us to edit it, to enable me to implement it in your sheet. But here is my sample sheet, in case anyone wants to look through it. Note that the main formula to reformat the data, in Solution!B3, could benefit from a lot of cleanup, and is probably nowhere near the best way to achieve this. Just throwing up one possible solution...
I'll try to add some explantion for the formula at some point, but ask if you have any questions.

How to match format of matching value? *Google Sheets

How to match format of matching value? *Google Sheets
https://i.stack.imgur.com/xeZmS.png
If I understand your question, I think I have an answer for you. See sample sheet here:
https://docs.google.com/spreadsheets/d/1QhED3qsoUiX0Km8R86Rg6kHdKdjwQW0uhHZeOd40Sy4/edit?usp=sharing
Note that this currently requires one formula for each of your due date columns, but these are easily dragged across, from D10, for as many columns as you need. There may be a way to combine them as one, but I haven't figured that out yet.
This conditional formatting rule's formula is applied to include D10:D and across as many columns as you need - D10:I18 in this sample sheet.
=arrayformula(index($A$2:$C$18,match(D$9&D10,$A$2:$A$18&$B$2:$B$18,0),3))
which combines the date and the item name, finds them in the initial data, and sees whether the Paid checkbox is ticked. If yes, it formats the text as "strikethrough". For clarity, I've also formatted the cell to gray, but this is easily removed, in the formatting options for that conditional formatting rule.
REFERENCE:
INDEX
ARRAYFORMULA
Conditional Formatting rules

Copy cell formatting using Lookup formulae google spreadsheet

I am making a spreadsheet for my D&D game in google spreadsheets, and am having some trouble with a vertical lookup. I have the workspace set up such that the first sheet is a search sheet, and the second is a database sheet.
In the search sheet, you type in the name of a spell, and then using VLOOKUP formulae it retrieves the data from the database. That does work. However, it does not copy over the formatting.
One of the pieces of information copied over is the spell description. Inside this description, which is fitted all in one cell, I sometimes use italics to emphasize certain parts. The italic formatting for those few words is not copied over with VLOOKUP. I was wondering if this was possible.
I tried to google this problem, and found somebody else asking this not too long ago on the google forums, but there were no replies there. Hoping to have a bit more luck here.
Example
In cell Sheet2!A1 is 'Name', in Sheet2!C1 is 'Description with italics'
In cell B2 on the active sheet is the searchbar (filled with 'Name')
I currently retrieve the information using:
=VLOOKUP($B$2,Sheet2!A1:C,3,false)
This would return
'Description with italics'
I would like to get
'Description with italics' returned instead.
Partial formatting of cell content was introduced recently and has very limited support in Google Sheets. About the only thing it is good for is formatting of headers and other informational elements, like
| Invoices sent | Invoices not sent |
To save yourself frustration, I suggest using partial formatting just for that, and not for data.
Formulas do not preserve partial formatting, even the simplest =A1 removes it.
Scripts do not support creation of copying of partial formatting, either.

What's the right tool for this job?

Is it possible to nest simple programs within a Google Sheets, similar to how you would with Visual Basic for Applications in Excel? Or alternatively a simple = syntax using regex, if there is a way to do that in Google Sheets?
I want to take a list of multiple names (name1, name2, name3) in a single cell from across multiple identical sheets and transpose them to another sheet within the same spreadsheet, check for duplicates and ignore capitals, etc. Is there a way to do this?
You are asking for an easy answer to a composite problem. To solve this, I would split the job into separate chunks:
Split the input cell content into
different cells. As it is unclear
how this format is, I cannot advice
on any specific method. Check out
ImportRange function or similar.
Transpose them. use =TRANSPOSE(area)
Remova duplicates, use =UNIQUE(area)
Check the Google Spreadsheet function list for details.
Nest them: =UNIQUE(TRANSPOSE(A1:C15)).
LOWER cannot be used in this nest as it works with only text input, not array input. Although you can use it for the first input cell.

Resources