Trim Space on left Google sheets - google-sheets

I have this formula on Google sheets:
=ARRAYFORMULA(IFERROR(IF(ISBLANK(A2:A),SPLIT(REGEXREPLACE(C2:C,",","+VITAMIN "),"+"),SPLIT(A2:A,"+"))))
How do i remove spaces on left after my split?
You can see example in column F in this example:
https://docs.google.com/spreadsheets/d/15ZU_mUrnTvhssgHF231dHKFjjsD7t_0pEFm0ysKoL6A/edit#gid=0

For example, how about using TRIM as follows?
Modified formula:
=ARRAYFORMULA(TRIM(IFERROR(IF(ISBLANK(A2:A),SPLIT(REGEXREPLACE(C2:C,",","+VITAMIN "),"+"),SPLIT(A2:A,"+")))))
and
=ARRAYFORMULA(IFERROR(IF(ISBLANK(A2:A),TRIM(SPLIT(REGEXREPLACE(C2:C,",","+VITAMIN "),"+")),TRIM(SPLIT(A2:A,"+")))))
Reference:
TRIM

Related

Removing Capital Letters between brackets on google sheets

on google sheets I am trying to remove some capital letters that exist between brackets using regexreplace
=arrayformula(regexreplace(regexreplace(A2:A,"\(.+?\)\ Ltd$| $| LTD$","")," $| LTD$",))
the only part remaining is where it could be random company (PTY) and I need to remove the space before the (PTY) and the (PTY).
any ideas?
Try this formula:
=arrayformula(regexreplace(A2:A,"\s?\(.+\) (Ltd|LTD)$",""))
Output:
Reference:
Regex capturing group

Using REGEXREPLACE to insert commas into values in Google Sheets

How do I go about using REGEXREPLACE to insert commas into values in Google Sheets? Example:
cell A1 = 1234567890
expected output in B1 = 1,234,567,890
edit:
The intention would be so that the user would not need to format anything themselves. This issue is from a template I'm doing up, sample sheet here - https://docs.google.com/spreadsheets/d/1n-KXqcSpx_DpvrOv9A4UsKn1amGGEUCpyzWWDphWdJY/edit?usp=sharing
try:
=TEXT(A1; "#,###,###,##0")
Try
=A1
and change the format to
#,##0
To insert commas into values in Google Sheets, I recommend:
Select the range of cells you'd like to format or modify.
Click Format and then Number.
Select the format to apply to the range of cells.

How to combine data from two google sheet and exclude the empty row?

Hi everyone,
I have 2 google sheets with data as shown in the screenshot above. For the first google sheet, the empty row are row 3 & row 7. For the second google sheet, the empty row are row 2, row 7 and row 10. I want to combine these two google sheets in a master google sheet. This is what I used to combine the data and the result that I get:
=QUERY({IMPORTRANGE("1BT3KLMGoE3FMaiW8G1ig6GRTyaJnYcskSaIeki7m-gs","Sheet1!A1:J100"),IMPORTRANGE("1gW5rEiinQe-PaqvFH890ZXXx7YnSVtmUghhpTl7lGng","Sheet1!A1:J100")},"where Col2 is not null")
As you can see, the data from second google sheet start from Column K and row 3 data is missing. I want to start the data from second google sheet in row 9 instead of Column K. May I know what I did wrong in the QUERY and IMPORTRANGE and how to avoid missing the data from second google sheet (row 3 data)?
Hope to get some helps and advices, thank you.
Issue:
As per kishkin's comment,
Try replacing comma , before the 2nd IMPORTRANGE with semi-colon
Formula:
=QUERY({IMPORTRANGE("1BT3KLMGoE3FMaiW8G1ig6GRTyaJnYcskSaIeki7m-gs","Sheet1!A1:J100");IMPORTRANGE("1gW5rEiinQe-PaqvFH890ZXXx7YnSVtmUghhpTl7lGng","Sheet1!A1:J100")},"where Col2 is not null")
Delimiter used is , instead of ;. I assume you are located most likely in Europe and that is the reason of the issue. See reason below.
Reason:
Locations using decimal points:
For locations using periods (or points or dots or whatever you call them) to denote decimal separators (most non-European countries including US, UK, Australia), the syntax will follow this structure:
Decimals will be denoted by a decimal point (a period)
Arguments in formulas separated by a comma
Horizontal data in curly-brace arrays separated by a comma
Locations using decimal commas:
For locations using commas to denote decimal separators (most European countries), the syntax will follow this structure:
Decimals will be denoted by a comma
Arguments in formulas separated by a semi-colon
Horizontal data in curly-brace arrays separated by a back-slash
Output:
Reference:
Sheets Location

Trying to get Formula for Google sheet

I'm looking to create a formula that converts a column of strings (If a string is available) into a larger string. See the google spreadsheet example in the attached.
Is this possible? Please help me make a formula.
Column A to E is the input, Column H should contain the formula that displays the expected result.
https://docs.google.com/spreadsheets/d/1bOMkEgzhyoZHNv2Z9dCQ7qcDGb36CTN9fnMo9wJ7cqU/edit?usp=sharing
There's a new tab on your sheet with this formula in h1.
=ARRAYFORMULA({"Output";IF(A2:A="",,SUBSTITUTE(A2:A," ","_")&" = "&IF(B2:B="","['"&A2:A&"']","['"&TRANSPOSE(SUBSTITUTE(TRIM(QUERY(TRANSPOSE(A2:G&CHAR(10)),,7)),CHAR(10)&" ","', '"))&"']"))})
Does that work?

Google spreadsheets: prepend character for each cell with a formula

I have a Google Spreadsheet doc with two columns:Column A and Column B.
I need formula in Column B to get the value in Column A with the sign '+' prepended for each word.
Take a look at the capture:
Try this formula in cell B1:
=ArrayFormula(IF(A:A="",,SUBSTITUTE("+"&A:A," "," +")))
This formula also works:
=JOIN(" +",SPLIT(A1," "))
Regexreplace also good thing to make it with condition:
=ArrayFormula(IF(A:A="",,REGEXREPLACE(A:A,"(\w{4,})"," +$1")))
to add + only for words which has more than 3 characters

Resources