Array_Literal Issue in Google Sheets [duplicate] - google-sheets

This question already has answers here:
ARRAY_LITERAL, an Array Literal was missing values for one or more rows
(2 answers)
Closed 2 months ago.
I am not able to figure why the formaula is giving out Array_Literal error code when I am doing everything right.
Formula:
={IMPORTRANGE("https://docs.google.com/spreadsheets/d/dfnk", "Dotpe Import!A2:C15000");
FILTER("RISTA Import!A2:C2500", "RISTA Import!E2:E2500" = 1)}
Error Code:
In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.
I also, looked at this link, and according to it, I have same column count in both arrays.
Thanks in advance! 😊

try both the scenarios and see if it works out.
={IMPORTRANGE("[SPREADSHEET ID]", "Dotpe Import!A2:C15000"); FILTER('RISTA Import'!A1:C2500,'RISTA Import'!E1:E2500 = 1)}
-
={IFERROR(IMPORTRANGE("[SPREADSHEET ID]", "Dotpe Import!A2:C15000"),MAKEARRAY(1,3,LAMBDA(r,c,IFERROR(1/0)))); IFERROR(FILTER('RISTA Import'!A1:C2500,'RISTA Import'!E1:E2500 = 1),MAKEARRAY(1,3,LAMBDA(r,c,IFERROR(1/0))))}

see (not): https://stackoverflow.com/questions/73767719/locale-differences-in-google-sheets-documentation-missing-pages
use:
={IFERROR(IMPORTRANGE("https://docs.google.com/spreadsheets/d/dfnk", "Dotpe Import!A2:C15000"), {"","",""});
IFERROR(FILTER("RISTA Import!A2:C2500", "RISTA Import!E2:E2500" = 1), {"","",""})}

Related

How to workaround Query with a mixed-data column? (google sheets) [duplicate]

This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
I have a simple Query that groups my data by months that was working fine before, but now that I've introduced a formula into my date column, it's not working anymore. (I'm guessing it's because the majority data in the column is now formulas instead of actual dates).
=Query(C5:L,"SELECT SUM(I) pivot MONTH(C)+1",1)
Is there a way for me to still get my intended Query data without removing my formulas in the date column? (Query formula is in M2)
Thank you in advance!
Link to sheet: https://docs.google.com/spreadsheets/d/1EpvLMboKJ0KeR7tTqBarF1AnAg3jelhKTkyBhwKNlK4/edit#gid=1335125620
Your formulas in Col C seem to be causing the issue since they're adding a blank space when there is no corresponding value in Col D:
=IF(D45=""," ",TIMESTAMP())
Instead, try:
=IF(D45="",,TIMESTAMP())

ArrayFormula from several IF statements [duplicate]

This question already has answers here:
ArrayFormula and "AND" Formula in Google Sheets
(4 answers)
Closed 4 months ago.
I have a IF statement with several AND conditions working great for my needs, however i want/need to transform it into an ARRAYFORMULA but i just cannot get it to work...
Working formula is this
=if(AM3="";"";
if(and(COUNTIF(AM3;"*"&X3&"*");J3<>"x");"Arrival";
if(and(J3="x";L3<>"x";if(COUNTIF(AM3;"*"&X3&"*");false;true));"Departure";"")))
NOT working ARRAYFORMULA is this:
=arrayformula(if(AM2:AM="";"";
if(and(J2:J<>"x";COUNTIF(AM2:AM;"*"&X2:X&"*")>0);"Arrival";
if(AND(J2:J="x";L2:L<>"x";if(COUNTIF(AM2:AM;"*"&X2:X&"*")>0;FALSE;TRUE));"Departure";"d"))))
Can someone help and explain me why it doesn't work pls?
Thanks.
AND is not supported under AF. try:
=INDEX(IF(AL3:AL="";;
IF(REGEXMATCH(LOWER(AL3:AL); LOWER(X3:X))*(J3:J<>"x"); "Send Arrival";
IF((J3:J="x")*(L3:L<>"x")*(IF(REGEXMATCH(LOWER(AL3:AL); LOWER(X3:X));
FALSE; TRUE)); "Send Departure"; ))))

Trying to filter a query using data validation drop down - numerical options work, but not a combination of numbers/letters [duplicate]

This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
Here is a copy of my sheet https://docs.google.com/spreadsheets/d/1b7ofD9f02yKiIvGYfCBi_GdhkRtgTAoY2NpftJmZaDQ/edit?usp=sharing
So my query is on the front tab 'Overall' in D1
=query(Data!A1:G,"SELECT * WHERE 1=1 "&IF(A2="All Raids",""," AND A contains "&A2&" ") &IF(B2="All Classes",""," AND LOWER(B) = LOWER('"&B2&"') "),1)
On the datasheet, I have people listen in raids 1,2 and 3.. and it works fine. However, if I were to change a value to something like BWL1 or BWL2, it will not display.
I got this code from a youtube tutorial, so I don't understand it 100%, but basically the "a2=all raids","" part is just to remove any filters, then the remaining is filtered by my drop-down menus, &A2& and &B2&.
Any ideas?
I've tried using A CONTAINS "&A2" instead of A = "&A2&", I just cant figure out a workaround to where any value (numberical+lettered) listed in my Datasheet column A works.
Thank you in advance for your time, I hope this makes sense :)
That's a known issue with query() function: query() has trouble with mixed datatypes (numeric and text in column A). To avoid this you can convert column A to text. See if this formula works
=query({ArrayFormula(to_text(Data!A1:A)), Data!B1:G},"SELECT * WHERE 1=1 "&IF(A2="All Raids","", " AND Col1 contains '"&A2&"'") &IF(B2="All Classes",""," AND LOWER(Col2) = LOWER('"&B2&"') "),1)
Note that, because of the use of 'contains' when '1' is selected in A2, it will also show rows containing BWL1. If you don't want that, change 'contains' to '='.

Some data removed after query [duplicate]

This question already has answers here:
Query is ignoring string (non numeric) value
(2 answers)
Closed 5 months ago.
I have a google sheet https://docs.google.com/spreadsheets/d/1mUV9DpVJHC2UbyqOG49wUIRj3EflTlB9etJQFssRLvo/ with a column "Floor", it contains the number and also character, I want to query the column and remove all empty cell, =unique(query(A:A,"SELECT A WHERE A IS NOT NULL ORDER BY A")) only the number be queried and all characters have been removed.
Can anyone advise how I can query all with unique and sort function?
I read the article from https://webapps.stackexchange.com/questions/101778/google-sheets-query-wont-display-cell-text-if-other-cells-have-numbers and come up a solution, hope this can help others.
=UNIQUE(ARRAYFORMULA(QUERY(TO_TEXT(A2:A), "SELECT Col1 WHERE Col1 IS NOT NULL ORDER BY Col1")))
Reason of using TO_TEXT() because mixed data types in a single column in Google Sheet, the majority data type determines the data type of the column for query purposes, so I convert all into text format.
Ref: https://support.google.com/docs/answer/3094285?hl=en
UNIQUE is used to filter out all duplicated values
Regarding ARRAYFORMULA() function, I don't know why it is needed but QUERY() will return #VALUE! if missing the ARRAYFORMULA().
If someone can explain the use of ARRAYFORMULA() and Col1 reference, appreciate to answer.
use the filter function instead.
considering Column A has both numbers and characters.
in B2, write: =filter(A2:A,isnumber(A2:A))
let me know if you need help!

How to make cell reference static even after inserting a column? [duplicate]

This question already has answers here:
How to maintain absolute cell address even when deleting ranges?
(2 answers)
Closed 5 months ago.
I want to use the sparkline formula on a fix range("G:P").
Everyday i add another column next to column F into my sheet. So Column "G" becomes "I" and so on. The problem is that the formula does update the range aswell.
=SPARKLINE($G54:BM54)
to
=SPARKLINE($I54:BM54)
Is there a way to prevent that?
You can use INDEX or INDIRECT:
=SPARKLINE(INDEX(54:54;7):BM54;{"charttype"\"column";"negcolor"\"red";"color"\"green";"axis"\WAHR})
or
=SPARKLINE(INDIRECT("$G54:BM54");{"charttype"\"column";"negcolor"\"red";"color"\"green";"axis"\WAHR})

Resources