How to prevent Google Spreadsheet from interpreting commas as thousand separators? - google-sheets

Currently, pasting 112,359,1003 into Google Sheets automatically converts the value to 1123591003.
This prevents me from applying the Split text to columns option as there are no commas left to split by.
Note that my number format is set to the following (rather than being Automatic):
Selecting the Plain text option prevents the commas from being truncated but also prevents me from being able to use the inserted data in formulas.
The workaround for this is undesirable when inserting large amounts of data: select cells that you expect to occupy, set to Plain Text, paste data, set to back to desired number format.
How do I disable the automatic interpretation by Google Spreadsheet of the commas in my pasted numeric values?

You can not paste it in any number format, because of the nature of numerical format types. It will parse it into an actual number and physically store it in this format. Using plaintext type, like you are, is the way to go for this.
However, there are some options to perform these tasks in a slightly different way;
- you might be able to use CSV-import functionality, which prevents having to change types for a sheet.
- you can use int() function to parse the plaintext value into an int. (and combine this with lookup functions).

TEXT formatting:
Use ' to prepend the number. It'll be stored as text regardless of actual formatting.
Select the column and set formatting as `plain text.
In both the above cases, You can multiply the resulting text by 1 *1 to use in any formula as a number.
NUMBER formatting:
Keep Number formatting with ,/Automatic.
Here, though split text to columns might not work, You can use TEXT() or TO_TEXT()
=ARRAYFORMULA(SPLIT(TO_TEXT(A1:A5),","))

Related

How to make a word mentioned in column A bold in column B where that word is mentioned in a sentence (Google Sheets)?

Basically, I am trying to create conditional formatting that does the following:
Simple example
I really would like to just make bold a word (not a whole sentence) in column B that is mentioned in column A.
I tried many different formulas in the "Value or formula" field:
=REGEXMATCH($B1,A1)
=REGEXMATCH($B1,"<"&A1&">")
=REGEXMATCH(B1,"\b"&A1&"\b")
=ARRAYFORMULA(REGEXMATCH(SPLIT(B1," "),"\b"&A1&"\b"))
...but none of these work.
This is actually sort of possible, if you are willing to stretch your definition of 'bold'. It's absolutely right that you can't make a particular part of a text string within a cell bold (or italic/underlined/coloured/etc.) in a way that replicates the effect if you manually select an area of a text string and format it using the menu bar options - effectively you are setting some metadata which sits 'outside' of the cell so isn't accessible to a formula.
However, Unicode fonts generally contain a region within their character map which corresponds to a bold version of the underlying font, and so with a little bit of trickery it's possible to substitute characters with their bold version. Here's a formula which achieves something like your original request:
=let(wordstobold,A1:A2,
sentencestosplit,B1:B2,
boldwords,map(wordstobold,lambda(eachword,concatenate(map(split(regexreplace(eachword,"(.)","$1_"),"_"),lambda(eachchar,filter(BOLDCHARS(),exact(STDCHARS(),eachchar))))))),
splitsentences,map(sentencestosplit,wordstobold,lambda(sentence,word,split(sentence,word,false))),
presplits,choosecols(splitsentences,1),
postsplits,choosecols(splitsentences,2),
map(presplits,boldwords,postsplits,lambda(x,y,z,x&y&z)))
The formula exploits the fact that SPLIT treats a multicharacter delimiter as a single entity by default, so if you pass the word to be bolded to SPLIT as the delimiter for the sentence it will split the sentence into two halves, presplit and postsplit. The substitution of the normal characters for bold characters could be done in a number of ways, but what I'm doing here is to explode the word to be bolded into individual characters and then MAPping a the equivalent bold character onto each one using FILTER/EXACT.
A couple of 'helper' Named Functions are required: STDCHARS() & BOLDCHARS(); these don't accept any parameters and are a means of storing the character sets for the part of the formula which swaps characters for their bold equivalents. It would be possible to integrate these into the formula, albeit at the expense of readability.
STDCHARS():
={"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z";"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z";"0";"1";"2";"3";"4";"5";"6";"7";"8";"9"}
BOLDCHARS():
={"๐—ฎ";"๐—ฏ";"๐—ฐ";"๐—ฑ";"๐—ฒ";"๐—ณ";"๐—ด";"๐—ต";"๐—ถ";"๐—ท";"๐—ธ";"๐—น";"๐—บ";"๐—ป";"๐—ผ";"๐—ฝ";"๐—พ";"๐—ฟ";"๐˜€";"๐˜";"๐˜‚";"๐˜ƒ";"๐˜„";"๐˜…";"๐˜†";"๐˜‡";"๐—”";"๐—•";"๐—–";"๐——";"๐—˜";"๐—™";"๐—š";"๐—›";"๐—œ";"๐—";"๐—ž";"๐—Ÿ";"๐— ";"๐—ก";"๐—ข";"๐—ฃ";"๐—ค";"๐—ฅ";"๐—ฆ";"๐—ง";"๐—จ";"๐—ฉ";"๐—ช";"๐—ซ";"๐—ฌ";"๐—ญ";"๐Ÿฌ";"๐Ÿญ";"๐Ÿฎ";"๐Ÿฏ";"๐Ÿฐ";"๐Ÿฑ";"๐Ÿฒ";"๐Ÿณ";"๐Ÿด";"๐Ÿต"}

Why are hyphens screwing up my duplicate finding conditional formatting?

I have a sheet I use as a database of scientific papers. I copy journal article titles from different sources (some could be from an email, others are links on a web page, or just the title from the article page). I have conditional formatting set to let me know if I'm adding a title that is already in the list. I've noticed that there are some titles that are "ignoring" the conditional formatting, and it looks like there are hyphens in all of the offenders. If I remove the hyphens, the conditional formatting works. So there is some 'difference' in the hyphens originating from the same title that is preventing the conditional formatting from viewing them as identical.
Shared sheet
Examples of offending titles:
End-to-end continuous bioprocessing: impact on facility design, cost of goods and cost of development for monoclonal antibodies
Endโ€toโ€end continuous bioprocessing: impact on facility design, cost of goods and cost of development for monoclonal antibodies
Endโ€toโ€end continuous bioprocessing: Impact on facility design, cost of goods, and cost of development for monoclonal antibodies
What is this difference, and is there a way to fix it? Do I need to write a script to find/replace the hyphens to get this to work?
TIA
Just because characters appear identical, it does not mean that they are identical. You have fallen foul of the similarity between the hyphen and dashes. Visually, they are almost identical - dashes are slightly widest than the hyphen.
Dashes are regarded as "special characters" (i.e. they aren't keys on the keyboard) but they are used widely in html. So if, for instance, you copied an item from a website then you might unwittingly have copied dashes rather than hyphens.
You can identify the exact nature of a character by using the CODE function.
You ask "What is this difference, and is there a way to fix it? Do I need to write a script to find/replace the hyphens to get this to work?"
WHAT IS THIS DIFFERENCE?
It's important to recognise that though these examples appear identical, there are other differences that are more than just hyphens vs dashes.
Example#1 - Hyphen - CODE returns "45"
Example#2 - Dash - CODE returns "8208"
Example#3 - Dash - CODE returns "8208".
But there are other factors that contribute to fail to trigger the conditional formatting rule:
Length = 128 (vs 127 for the other examples). There is an additional comma (after "cost of sales")
the word "Impact" is spelled with an upper case "I" (lower case for the other examples)
MOVING FORWARD
Do you need a script? No (IMHO)
Is there a way to fix it? As outlined above, there are more differences that just hyphens and dashes. And, as time goes by, the number & type of difference might increase. However, there is a solution to the "Hyphen Vs Dash" problem which is the focus of this question.
FORMULA AND FORMATTING
Your data is currently in Column A and Column A is also subject to conditional formatting.
Remove the conditional formatting rules from Column A
Insert this formula in cell B2
=arrayformula(if(LEN($A2:A)-LEN(SUBSTITUTE($A2:A, char(8208), ""))=0,A2:A,arrayformula(substitute(A2:A,char(8208),char(45)))))
Conditional Formatting for Column B
select the range in Column B
select, Format, Conditional Formatting.
Select "Custom Formula is" and enter this formula: =countif($B$2:$B2,B2)>1
Select a preferred Formatting Style and then click Done.
FORMULA LOGIC
arrayformula enables the formula to automatically populate all the relevant cell in the column.
LEN($A2:A)-LEN(SUBSTITUTE($A2:A, char(8208), ""))=0
a test for dashes in a string. It substitutes a nil value for any/all instances of a dash (char(8208)), then compares the length to the adjusted length. If the value is zero, then there are no dashes in the string.
IF: Test for any dashes,
if the string doesn't contain any dashes then use that value
else, the string must contains dashes so substitute any dashes for hyphens, and use the substituted value
arrayformula(substitute(A2:A,char(8208),char(45)))
The conditional formatting rule then looks for duplicate values in the column, and formats any/all duplicate values.
You'll note that Example#3 is not flagged as a duplicate despite containing dashes. This is because of the spelling of "Impact" and the extra comma after "cost of sales".
Sample

Problem reading variables containing mix of numbers and strings

I am reading an Excel file (see syntax below) where some of the fields are text mixed with numbers. The problem is that SPSS reads some of these fields as numeric instead of string and then the text is deleted.
I assume this happens in cases where a large part of the first rows are empty or with a numeric value and then it defines the variable as numeric.
How can this be avoided?
GET DATA
/TYPE=XLSX
/FILE='M:\MyData.xlsx'
/SHEET=name 'Sheet1'
/CELLRANGE=FULL
/READNAMES=ON
/DATATYPEMIN PERCENTAGE=95.0
/HIDDEN IGNORE=YES.
When you use the get data command, the subcommand /DATATYPEMIN PERCENTAGE=95.0 tells SPSS that if up to 5% of the values in the field do not conform to the selected format it's still ok. So in order to avoid cases where only very few values are text and the field is read as number, you have to correct the subcommand to:
/DATATYPEMIN PERCENTAGE=100

Google Sheets - Split Data

I have these data in Google Sheets
$71,675_x000d_
$80,356_x000d_
$107,361_x000d_
$123,393_x000d_
$116,878
I want them to be split into different columns.
However, when I do so using Data > Split Data into Different Columns, it separates $71 and 675_x000d_ but I need the $71,275 and remove the xoood
Please note that the last number doesn't have those extra characters.
Please help.
Your post says you want to "remove the x000d (that is, extract only the dollar amounts). That said, let's say your raw data starts in A2 (i.e., the data is in A2:A). Place the following formula into the first cell of another otherwise empty column (e.g., B1):
=ArrayFormula({"Extracted";IF(A2:A="",,REGEXEXTRACT(SUBSTITUTE(A2:A&"_",",",""),"\d+"))})
How It Works:
ArrayFormula(...) signifies that we'll be processing an entire range and not just one cell.
The outer curly brackets {...} signify that a virtual array will be formed from non-like or non-contiguous pieces.
The first piece of the virtual array is the header. Here, that is "Extracted"; but you can change it as you like.
The semicolon means "place the next information below the previous part."
IF(A2:A="",, ...) is a standard check that basically says "Don't try to process any blank cells in Column A"; or alternatively worded, "If any cell in A2:A is blank/null, do nothing."
Skipping the REGEXEXTRACT for now, A2:A&"_" appends an underscore to every entry in A2:A. This allows entries in A2:A that are just a dollar amount (e.g., from the post, $116,878) to have a consistent symbol following them if not already there. (And adding the underscore to anything that already has an underscore won't matter, because we won't be extracting that far out.)
Now that we've got the new strings, we SUBSTITUTE every comma for a null (i.e., delete all commas).
Finally, REGEXEXTRACT will take all of the virtually modified strings and extract \d+, which means only digits (\d) in an unbroken sequence of any length greater than 0 (+). Note that REGEXEXTRACT will only return the first such match it encounters as written, so 000 will not be extracted.
An IFERROR wrap is placed around the REGEXEXTRACT, just in case you have any situations in real life that don't have any sequence of numbers at all. In these cases, nothing will be returned (whereas, without the IFERROR, an error would have been returned).
Once the extraction is done, you can apply Format > Number > Currency (rounded) to the entire column.
Addendum:
After an additional comment (below), it appears that the raw data is in Column T, that all five entries are in one cell and that the OP would like all five amounts extracted across each row. That being the case, assuming that Columns U:Y are empty to start, place the following in cell U1 (not U2):
=ArrayFormula({"Va11","Val2","Val3","Val4","Val5";IF(T2:T="",,IFERROR(REGEXEXTRACT(SUBSTITUTE(T2:T&"_",",",""),REPT("\$(\d+)[^\$]*",5))))})
This works much the same way as the previous formula. The differences:
There are five headers now.
You'll see REPT(...,5) here. This is an easy way to repeat the same extraction five times.
That repeated extraction is now the following:
\$(\d+)[^\$]*
The backslash in front of the dollar signs means to treat those symbols as literals instead of as their usual meaning (i.e., end-of-string). So the extraction reads as follows:
\$ anything that starts with a dollar sign
(\d+) extract what is between the ( ), which is any group of digits [^$]*` followed by any number (including 0) characters that are not dollar signs
As I said, the REPT will repeat this five times; so five groups matching this pattern will be extracted.
Understand that if you have any groups that don't follow the pattern exactly, resulting in five matching extractions, nothing will be returned.
Be sure to format U:Y as currency rounded, or you will wind up with some of those numbers translating as raw dates and therefore being completely off.
Please use the following formula and format cells to your needs.
=ArrayFormula(IFERROR(SPLIT(REGEXREPLACE(A2:A,"\n|_x000d_","โˆš"),"โˆš")))
The big advantage of the above formula compared to others is that it works for any number of lines included within a single cell (as shown in the image below).
Functions used:
ArrayFormula
IFERROR
SPLIT
REGEXREPLACE
You can use SPLIT function:
=ArrayFormula(IF(LEN(A:A),SPLIT(A:A,"_x000d_",FALSE),""))

Font weight BOLD using formula in cell

I'm using Google Spreadsheet to make some calculations.
At the bottom of my table I need SUM, AVG and some others and everything is fine.
But I made a long cell with all the text, like this:
="Hi at all, this is my report: "&SUM(B:B)&" are the sum of my fingers, "&AVG(C:C)&" is the avg of my sons."
and so on.
Everything works. But I need to bold the SUM(B:B).
I won't use single cells for math results.
I tried with ....<b>"&SUM(B:B)&"</b>.... but obviously I take <b></b> in my cell and not the bold font weight.
How to style from formula in cell?
Recently I had the same problem, but I found a solution. This solution works well in google sheets.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(E3,"A","๐€"),"B","๐"),"C","๐‚"),"D","๐ƒ"),"E","๐„"),"F","๐…"),"G","๐†"),"H","๐‡"),"I","๐ˆ"),"J","๐‰"),"K","๐Š"),"L","๐‹"),"M","๐Œ"),"N","๐"),"O","๐Ž"),"P","๐"),"Q","๐"),"R","๐‘"),"S","๐’"),"T","๐“"),"U","๐”"),"V","๐•"),"W","๐–"),"X","๐—"),"Y","๐˜"),"Z","๐™"),"0","๐ŸŽ"),"1","๐Ÿ"),"2","๐Ÿ"),"3","๐Ÿ‘"),"4","๐Ÿ’"),"5","๐Ÿ“"),"6","๐Ÿ”"),"7","๐Ÿ•"),"8","๐Ÿ–"),"9","๐Ÿ—")
If you want to improve your formula, use the characters below:
ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyz
๐€๐๐‚๐ƒ๐„๐…๐†๐‡๐ˆ๐‰๐Š๐‹๐Œ๐๐Ž๐๐๐‘๐’๐“๐”๐•๐–๐—๐˜๐™๐Ÿ๐Ÿ๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿ”๐Ÿ•๐Ÿ–๐Ÿ—๐š๐›๐œ๐๐ž๐Ÿ๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ
At the current time, in Google Sheets you cannot bold partial components of any formula. The solution mentioned using the 'B' or bold icon only works if the desired bold selection is an entire cell containing a formula, or partial of a cell that does not contain a formula.
Yes, this is possible.
My own solution is at the bottom, but I find the one added by Adrian Mihai Nemes here to be cleaner. So, I have expanded that solution here to work for lowercase as well as uppercase and numbers. This should work for text containing anything, including newlines, single quotes, emojis, etc.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B25,"A","๐€"),"B","๐"),"C","๐‚"),"D","๐ƒ"),"E","๐„"),"F","๐…"),"G","๐†"),"H","๐‡"),"I","๐ˆ"),"J","๐‰"),"K","๐Š"),"L","๐‹"),"M","๐Œ"),"N","๐"),"O","๐Ž"),"P","๐"),"Q","๐"),"R","๐‘"),"S","๐’"),"T","๐“"),"U","๐”"),"V","๐•"),"W","๐–"),"X","๐—"),"Y","๐˜"),"Z","๐™"),"a","๐š"),"b","๐›"),"c","๐œ"),"d","๐"),"e","๐ž"),"f","๐Ÿ"),"g","๐ "),"h","๐ก"),"i","๐ข"),"j","๐ฃ"),"k","๐ค"),"l","๐ฅ"),"m","๐ฆ"),"n","๐ง"),"o","๐จ"),"p","๐ฉ"),"q","๐ช"),"r","๐ซ"),"s","๐ฌ"),"t","๐ญ"),"u","๐ฎ"),"v","๐ฏ"),"w","๐ฐ"),"x","๐ฑ"),"y","๐ฒ"),"z","๐ณ"),"0","๐ŸŽ"),"1","๐Ÿ"),"2","๐Ÿ"),"3","๐Ÿ‘"),"4","๐Ÿ’"),"5","๐Ÿ“"),"6","๐Ÿ”"),"7","๐Ÿ•"),"8","๐Ÿ–"),"9","๐Ÿ—")
For my own solution, this will bold all lowercase, uppercase, and numbers. It should work for text containing just about anything, including newlines, single quotes, etc. (perhaps not emojis?).
Just replace the single A2 reference with whatever it is you want bolded:
=ARRAYFORMULA(JOIN("", UNICHAR(QUERY(UNICODE(SPLIT(TRANSPOSE(SPLIT(
REGEXREPLACE(
REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(A2&""
,"([^a-zA-Z0-9])","$1"&UNICHAR(160)&UNICHAR(1)&CHAR(127))
,"'","''")
,"([a-z])","$1"&UNICHAR(160)&UNICHAR(119738)&CHAR(127))
,"([A-Z])","$1"&UNICHAR(160)&UNICHAR(119744)&CHAR(127))
,"([0-9])","$1"&UNICHAR(160)&UNICHAR(120735)&CHAR(127))
,"'","''")
,CHAR(127))), UNICHAR(160))), "select Col1+Col2-1 label Col1+Col2-1 ''",0))))
Overview:
For each character group (lowercase, uppercase, numbers) we're using stringed together REGEXREPLACE calls to append special separator characters along with the base unicode character for that group's bold font right after.
So for example, Hi-1 becomes "H"&UNICHAR(160)&UNICHAR(119743)&CHAR(127)&"i"&UNICHAR(160)&UNICHAR(119737)&CHAR(127)&"-"&UNICHAR(160)&UNICHAR(1)&CHAR(127)&"1"&UNICHAR(160)&UNICHAR(120734)&CHAR(127).
Once we have this new string, we split on the `CHAR(127) and transform, so each of these characters are on their own row. So the example now becomes:
"H"&UNICHAR(160)&UNICHAR(119743)
"i"&UNICHAR(160)&UNICHAR(119737)
"-"&UNICHAR(160)&UNICHAR(1)
"1"&UNICHAR(160)&UNICHAR(120734)
Next, we split on the UNICHAR(160) character:
"H", UNICHAR(119743)
"i", UNICHAR(119737)
"-", UNICHAR(1)
"1", UNICHAR(120734)
We use the UNICODE() function to convert the actual characters along with their corresponding UNICHAR into their unicode numbers:
72, 119744
105, 119738
45, 1
49, 120735
Now, we use the QUERY() function as a way of summing each of these rows individually. That's where the "select Col1+Col2-1 label Col1+Col2-1 ''" comes in. It is adding column 1 to column 2 and taking away the 1 extra from the base unicode value, and then preventing a heading label from being added to the function output.
So, now we get:
119815
119842
45
120783
We use the next UNICHAR() function to convert these to their unicode characters, which at this point is the corresponding bolded character:
๐‡
๐ข
-
๐Ÿ
Lastly, we use a JOIN() with an empty string "" delimiter to combine it all back into a single string.
๐‡๐ข-๐Ÿ
p.s. If you're curious why the different character groups need to be split up, it's because each group lines up with their corresponding bold characters in order, but not all 3 character groups in a row. There are some extra characters between the normal type groups that you don't see in the bold section of unicode. Thus, each character group has to be given its own base unicode value to be added to that normal character's unicode value.
p.p.s. If you wanted to add more characters, you would just need to add another wrapping REGEXREPLACE() with the correct character group, and the UNICHAR() with the correct base unicode value for that group, and then add that new group to the exclusions from the first REGEXREPLACE(). Happy to explain this further if required.
p.p.p.s. The REGEXREPLACE() with the single quote ' being replaced with two single quotes '' is needed because when we split the characters to their own cells, Google Sheets actually considers a leading single quote as a special character and removes it. So effectively, two single quotes get converted to one single quote after splitting.
I updated Adrian's formula to style to sans-serif characters instead of serif ones if anyone needs it. It includes both lower and upper case letters, as well as numbers.
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(D2,"A","๐—”"),"B","๐—•"),"C","๐—–"),"D","๐——"),"E","๐—˜"),"F","๐—™"),"G","๐—š"),"H","๐—›"),"I","๐—œ"),"J","๐—"),"K","๐—ž"),"L","๐—Ÿ"),"M","๐— "),"N","๐—ก"),"O","๐—ข"),"P","๐—ฃ"),"Q","๐—ค"),"R","๐—ฅ"),"S","๐—ฆ"),"T","๐—ง"),"U","๐—จ"),"V","๐—ฉ"),"W","๐—ช"),"X","๐—ซ"),"Y","๐—ฌ"),"Z","๐—ญ"),"a","๐—ฎ"),"b","๐—ฏ"),"c","๐—ฐ"),"d","๐—ฑ"),"e","๐—ฒ"),"f","๐—ณ"),"g","๐—ด"),"h","๐—ต"),"i","๐—ถ"),"j","๐—ท"),"k","๐—ธ"),"l","๐—น"),"m","๐—บ"),"n","๐—ป"),"o","๐—ผ"),"p","๐—ฝ"),"q","๐—พ"),"r","๐—ฟ"),"s","๐˜€"),"t","๐˜"),"u","๐˜‚"),"v","๐˜ƒ"),"w","๐˜„"),"x","๐˜…"),"y","๐˜†"),"z","๐˜‡"),"0","๐Ÿฌ"),"1","๐Ÿญ"),"2","๐Ÿฎ"),"3","๐Ÿฏ"),"4","๐Ÿฐ"),"5","๐Ÿฑ"),"6","๐Ÿฒ"),"7","๐Ÿณ"),"8","๐Ÿด"),"9","๐Ÿต")
EDIT
I understood how to use the "Substitute" formula but I have a question: is it possible to use another font? (Montserrat). The substitute formula seem to force a specific font regardless of the font I am selecting for that cell.
Here is what I also tried:
I noticed that when I CCed the substitute formula in an empty cell in a google sheet, every letter/number is followed by its bold version.
I thought it was just a matter of the font being used within the formula so I CCed the formula in a google doc and manually changed the font as well as every bold letter and number to Montserrat. They appear "correctly" within google doc, however when I CC that modified substitute formula in an empty cell in google sheet, it doesn't keep the bold letters and numbers. How come CCing from here keeps the bold letters/numbers in google sheet, and CCing from a google doc have the bold letters/numbers reset to regular version?
Please help me figure this out
Yours,
--Jay
Having the same issue at the moment. Spent a decent amount of time figuring it out before I realized it cannot be done. The reason for this is that Google spreadsheets does not allow bits of a query to have bold/italics/underline to it.
The only workaround I have found is to do it manually . Let the query run , and highlight the section of the string you want with a different formatting option.
To make any of the cells bold just make a conditional format for the cell/range/array and choose bold.

Resources