Google Sheets: Why is the first cell of my query repeating? - google-sheets

I am compiling multiple sheets into one master sheet. The first four rows of the first sheet in my array are repeating in one cell instead of listing in separate cells. No matter which sheet I list first, the first four sells end up being in one cell. The second sheet listed does not have this problem. My data starts in the 5th row in column B.
This is the formula I'm using:
=QUERY({A!B5:U; B!B5:U},"select * where Col1 is not null")
Table Preview

you need to use 3rd query parameter:
=QUERY({A!B5:U; B!B5:U}, "where Col1 is not null", 0)

Related

Can I add a floating column to a Sheets query?

I have a Sheet like this [minimal] example. The "Data" tab is a running list of points different groups have scored. This is constantly updating. The "Results" tabs gets a list of all the unique group names from the Data tab and add them as a row in Column A. So, if an entry for "Group5" is entered on the Data tab, a row with that name will appear on the Results tab. Similar for the columns on the results tab. Each unique action on the Data tab becomes a column on the results tab.
I would like to add a "Total" column to the last column on the Results tab. The problem is, if a new "action" category appeared on the data tab, it would take up the last column and the Total column would need to shift over one. Is there a way to get the "Total" column to float so that it is always on the end without conflicting with the query formula?
In B1 cell put below formula-
={TRANSPOSE(UNIQUE(QUERY(Data!C2:C, "SELECT C where C is not null",0))),"Total"}
In B2 cell put below formula then drag down and right as needed.
=IF(OR($A2="",B$1=""),"",IF(B$1="Total",SUMIFS(Data!$D$2:$D,Data!$B$2:$B,$A2),
SUMIFS(Data!$D$2:$D,Data!$C$2:$C,B$1,Data!$B$2:$B,$A2)))

Get range from formula an a sheet and use it in a different formula that gets data from a different sheet in Google Sheets

I have two sheets Sheet Main and Sheet Unique
On sheet Main, I have a range of data with headers
On sheet Unique in cell A1 I have a drop-down of all the header names from sheet Main
In cell B1 of sheet Unique, I have the formula
=SUBSTITUTE(ADDRESS(A1,MATCH(A1,Main !A1:AA1,0),4),1,"")
Which gets the Column letter of the header on sheet Main from the dropdown on sheet Unique
Is cell A2 on sheet Unique I have the formula
=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!F2:F),"|"))))))
Which gets the unique list of elements from the column on sheet Main that was selected from the drop-down on sheet Unique.
In this case, F2:F is the range on sheet Main of the selected header from sheet Unique
I want to update the formula
=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!F2:F),"|"))))))
automatically every time I make a new selection from the Drop-down on the sheet Unique
Combing the two formulas I get and adding INDIRECT
=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!&INDIRECT(SUBSTITUTE(ADDRESS(Y1,MATCH(A1,Main!$A$1:$AA$1,0),4),1,""),"|"))))))))
I get the error formula parse error I can not get what I am doing wrong!
Thanks for any assistance
Try this in cell Unique!A2:
=unique(sort(indirect("Main!"&substitute(address(1,match(A1,Main!1:1,0),4),"1","")&"2:"&substitute(address(1,match(A1,Main!1:1,0),4),"1","")),1,1))

=FILTER arrayformula with

Test sheet
I have an Options sheet that categorizes transactions based on their type. In the Transactions sheet, I add transactions with their corresponding category, and I am trying to create a formula where the corresponding category type is automatically added in the column next to it.
I have been able to create a partially working formula:
=ARRAYFORMULA(FILTER(Options!C:C,Options!B:B=D31))
I want to expand it across all the cells in column E using an ARRAYFORMULA, but I can't seem to figure out how to have the Options!B:B=D with the corresponding cell. Making it =D31 I've been able to figure out, but having one formula at the bottom (at Ref 1) and then the right category type for each corresponding cell, I have not.
use in E2:
=ARRAYFORMULA(IFNA(VLOOKUP(D2:D, Options!B:C, 2, 0)))

Search for a text combination and then moving its next 2 cells to the other table

Alright, I have 3 tables, from the first, the value of 2 cells is taken and brought in the 3rd table and from the 3rd table the sum of those cells is added in one cell and counted in another. Ex: First table Jacob 1 Apple (written 2 times in 2 different rows). This will go in the 3rd table just the same then numbers will be counted (2 numbers) and written in the 2nd first cell and also added and written in another cell. I want to redo this as many times I add a new name or number it kind of breaks the formulas and the formulas start stealing from the above cell or from the below.
Link: https://docs.google.com/spreadsheets/d/1a0NIeA2xlDzpK-C4Mvq1UANfYdUHc9gHli6U3v2L6r8/edit?usp=sharing
delete everything in range E:K
paste this formula into E1 cell:
=ARRAYFORMULA({QUERY(A1:C,
"select A,count(A),sum(B)
where A is not null
group by A
label count(A)'DS events total',sum(B)'Overall attendees'", 0),
QUERY(IFERROR(QUERY(A1:C,
"select sum(B)
where A is not null
group by A
pivot C", 0)*1,
{"Overal BTs", "Overal CTs", "Overal FTs", "Overal PTs"}),
"select Col4,Col1,Col3,Col2", 1)})

How to import data from other sheet and list them?

I have Sheet1 and Sheet2in the same document. In Sheet1 from Row 2 (A2~ZX2) there are names. At Row 5 (A5~ZX5) there are checkboxes with custom values set to either 1 for checked, 0 for unchecked.
At Sheet2 I want to load Sheet1's A2~ZX2 values where their checkbox is unchecked.
I figured out that =Sheet1!$A1 can load from another sheet, but I don't know how to make as a list that automatically filters checkbox value.
I'm not sure that you need Sheet 2. Use the funnel looking icon to set up a filter on Sheet 1.
Please try:
=transpose(query(transpose(Sheet1!A2:ZX5),"select Col1 where Col4 <> TRUE"))
Leave off the outer TRANSPOSE for a list in a column rather than by row as in your source.

Resources