Google Sheets Quartile Function Giving Error - google-sheets

In Google sheets I write the formula =QUARTILE(G7:G27, 1) to give the lower quartile between G7 and G27 but it gives me #ERROR!
Here is a print screen that shows my problem.

In the event your spreadsheet locale uses commas , as decimal separators, you will have to use semicolons ; as formula argument separators, like this:
=quartile(G7:G27; 1)

use ; as fx argument separator:
=QUARTILE(G7:G27; 1)
see (not): https://stackoverflow.com/questions/73767719/locale-differences-in-google-sheets-documentation-missing-pages

Related

Error in number formatting in Google Sheet

I need to format the numbers in a column like this:
08146.000331/2021-32
But, when I use the following format
00000"."000000"/"0000"-"00
The result is
08146.000331/2021-30
What am I doing wrong?
There is a formula to achieve the aimed result?
This is the actual sheet: link
Some of the values in column C are numbers and some are text strings that look like numbers.
Click in column C and choose Insert > Column right to create a new column D. Then insert this formula in cell D4:
=arrayformula(
{
"Formatted SEI";
regexreplace(trim(C5:C); "^(\d{5})(\d{6})(\d{4})(\d{2})$"; "$1.$2/$3-$4")
}
)
The formula converts all values to text strings and inserts separators.
Try
000"."000"."000"-"00 ---> for CPF, and
00"."000"."000"/"0000"-"00 ---> for CNPJ.
For numbers with more then 14 digits, this type of formatting don't works due to numeric precision limit.
Um abraço.

Random Cells From A List In Google Sheets

Sample
Code:
=ArrayFormula((VLOOKUP(QUERY(UNIQUE(RANDBETWEEN(ROW(INDIRECT("A1:A"&COUNTA(A:A)*10))^0;COUNTA(A:A)));"limit 4");{ROW(INDIRECT("A1:A"&COUNTA(A:A)));FILTER(A:A;A:A<>"")};2;0)))
I'm trying but got this error,
test 1
Can anyone tell what's wrong? To make my code
to work as in the first picture
error in #REF!
VLOOKUP evaluates outside the range bounds.
im try change code
=ArrayFormula((VLOOKUP(QUERY(UNIQUE(RANDBETWEEN(ROW(INDIRECT("A1:A"&COUNTA(A:A)*10))^0,COUNTA(A:A))),"limit 4"),{ROW(INDIRECT("A1:A"&COUNTA(A:A)));FILTER(A:A,A:A<>"")},1,0)))
but number
solution for that?
=ARRAYFORMULA(VLOOKUP(FLOOR(RANDARRAY(5)*COUNTA(A2:A)),{SEQUENCE(COUNTA(A2:A),1,0),A2:INDEX(A2:A,COUNTA(A2:A))},2))
Create 5 random integers using RANDARRAY between 0(inclusive) and number of entries in A2:A(i.e., COUNTA)(exclusive).
Create a artificial side by side array({arr1,arr2}) of SEQUENCE of numbers (from 0) and actual values in A2:A
VLOOKUP the random integers in the created artificial array to give random values in A:A
If you're in locales that use comma as decimal separators, The artificial array should be created using \ instead of ,({arr1\arr2}).
=ARRAYFORMULA(VLOOKUP(FLOOR(RANDARRAY(5)*COUNTA(A2:A));{SEQUENCE(COUNTA(A2:A);1;0)\A2:INDEX(A2:A;COUNTA(A2:A))};2))
On the first formula
{ROW(INDIRECT("A1:A"&COUNTA(A:A)));FILTER(A:A;A:A<>"")}
replace the semicolon ; between INDIRECT() and FILTER() by a backslash \ as using a semicolon appends the results of FILTER to the results of INDIRECT but you are looking to put the results of each function on their own column. Please note that this formula is using semicolons as argument separator.
On the second formula replace the semicolon ; between INDIRECT() and FILTER() by a comma , (and replace the third argument of VLOOKUP, 1, by 2. Please note that this formula is using commas as argument separators.
Explanation
Commas are used as argument separator on spreadsheets that use dot as decimal separator (=SUM(1,2,3)) but also use commas as columns separator on arrays ({"a","b"})
Semicolons are used as argument separator on spreadsheets that use comma as decimal separator (=SUM(1;2;3)). On these spreadsheets, backslashes are used as columns separator on arrays ({"a"\"b"});
References
Using arrays in Google Sheets

Google sheets, SUMIF function gives: "Argument must be a range" error if I use ADDRESS function as second parameter of range

I am writing a formula in Google Sheets. Here's the formula;
=IF(COUNTIFS(C$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),3), C3, E$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),5), E3, F$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),6), "<>0") > 1, "MULTIPLE POSITIVE LBS THAT'S GREATER THAN ZERO", MINUS(F3, SUMIFS(G$3:G$480, C$3:C$480, C3, E$3:E$480, E3)))
Now the formula works like this but it only sums the values between row 3 and 480. What I want to do is get all the values between row 3 and the last non-empty field. In order to achieve that I used this formula;
ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A)))
I was able to make this formula work for countif function but when I use the same formula in sumif function, it gives me Argument must be a range error.
This is the second version (the one giving an error)
=IF(COUNTIFS(C$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),3), C3, E$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),5), E3, F$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),6), "<>0") > 1, "MULTIPLE POSITIVE LBS THAT'S GREATER THAN ZERO", MINUS(F3, SUMIFS(G$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),7), C$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),3), C3, E$3:ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))),5), E3)))
I also tried to make ADDRESS function work independently, in a completely different cell and it gives the correct address.
This is the first time I'm writing sheets or any kind of excel formula so I couldn't find the source of the problem. What am I doing wrong?
Replacing ADDRESS(ROW(INDEX(A2:A,COUNT(A2:A))) with C$3:INDEX(C2:C,COUNT(A2:A)) did the trick. Apparently ADDRESS returns a string rather than a reference.
Address function returns a string. Which is not accepted as an input for sumif function So you have to convert the string returned by the address function to a reference. To do this, use the indirect function.
Like so: INDIRECT(address(2,row()-1,4,TRUE,"MAIN"))
Now you can use this as an input to many other functions like sumif, column, row, etc.

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

Understanding "select X where Y = ..." in a google sheets QUERY function

I'm trying to figure out how to parse this google sheets function:
=IFERROR(QUERY($A$2:$F$1000, "select F where A="&A4&" "),"")
I'm having trouble understanding the "select F where A="&A4&" part. The function is applied to an entire column. For some of the rows, this function returns a number, for others it returns a blank. The A column which it is referencing is entirely composed of 6-digit numbers.
What is going on such that sometimes the function returns a number and sometimes a blank?
Also, why are the ampersands important? If I take away the ampersands, the function returns an error.
You need to fix the quotes around A4.
=IFERROR(QUERY($A$2:$F$1000, "select F where A='"&A4&"'"),"")
'"&A4&"'
means what is in cell A4
The & means to concatenate.
In this case the literal contents of A4 into the query formula.
Notice that the query has 4 "s. ie ""
"&""
The single quotes are to make the contents of A4 a string.
where A=
so where contents of A2 to A1000 matches the contents of A4.
It would definitely match on A4, (and any other Col A cell that had the same contents.)
in which case it would return F4 because of the
"select F"
means show/return column F in the results
You should try the following:
=arrayformula(if(eq(F2:F,A2:A),F2:F,))
It is hard to suggest the right formula without seeing what you are working with or what the expected result looks like, so if this doesn't work, please share your sample spreadsheet.

Resources