Formatting of Complex Numbers in Google Sheets - google-sheets

How can complex numbers be formatted in Google sheets? If for instance I have the following complex number in a cell, with both real and imaginary part too long for my needs,
=COMPLEX(1.23456789, 0.987654321)
which would be displayed as
1.23456789+0.987654321i
where is the format accessible so that it is displayed as in the following?
1.23+0.99i

this maybe:
=COMPLEX(ROUND(1.23456789,2), ROUND(0.987654321,2))

Related

Very Specific Filtering in Google Sheets

I am making a calculator in Google sheets and I would like to find a formula or script or something that will allow me to read the value of a certain square and add the formula "=sum(C5:C9)" or "=product(C5:C9)" or whichever depending on what the person puts in C4. Not sure if this is possible in google sheets (without custom code), but if it is, that would be great!
try:
=IF(C4="*"; PRODUCT(C5:C9); SUM(C5:C9))

Google Sheets same formula and same input text produce different results

When I use the same formula =VALUE(SUBSTITUTE(INDEX(SPLIT(A2,"€"),1),",".")) and the same input text 17,70 € in different sheets within the same Google sheet, I get different results. Why?
and
It's difficult to know for sure without seeing the sheets, but it's probably down to one of the values being formatted as a number and the other as text.
Alternatively, it might be a difference in the 'locale' setting if you have two different sheets.

How to Regexextract whole words that contain a mixture of text and numbers in Google Sheets

I am trying to make this formula work for a mixture of text and numbers. It works for text that contain 4 numbers only. How can I manipule this to match specific words e.g Text Text 50 or even random 2020 text.
I need to hardcode the words into the formula or using INDIRECT cell reference.
The formula I got.
=ArrayFormula(IF(A:A="",,TRIM(IFERROR(REGEXEXTRACT(A:A,"^([øa-zA-Z-\/ ]+)"))&IFERROR(REGEXEXTRACT(A:A," [0-9]{4}")))))
I simpler terms I want the formula to extract these specific words as they are without trimming them. This formula works for other strings except ones that are a mixture of numbers and text.
I tried to edit my formula like this but I wasn't successful.
=ArrayFormula(IF(A:A="",,TRIM(IFERROR(REGEXEXTRACT(A:A,"^([[:Text Text 50:]][[:random 2020 text:]][øa-zA-Z-\/ ]+)"))&IFERROR(REGEXEXTRACT(A:A," [0-9]{4}")))))
The link to my spreadsheet - https://docs.google.com/spreadsheets/d/1BYW-QzqRA8vIBWazDSZhbUZ_TCbVAPYSI-1hFthfrew/edit?usp=sharing
If you enter the texts you are looking for in a separate column (say into E1:E3), you can use this formula:
=IFERROR(ArrayFormula(REGEXEXTRACT(A:A,JOIN("|",E1:E3))),"")
If you want hardcode, just use:
=IFERROR(ArrayFormula(REGEXEXTRACT(A:A,"AC Reggiana 1919|B93 Copenhagen|Etar 1924 Veliko T..")),"")

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

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

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.

Resources