Can i refrence a cell in a query? - google-sheets

Trying to get all results from sheet 2 where colum A contains the value of cell A24 in current sheet.
=QUERY('SHEET2'!1:997, "select B where A contains A24")

In place of A24 you would use '"&A24&"'

Related

Google Sheets Find Cell containing date in other sheet

I'm looking to make a planner, I would like to find the cell in another sheet called 'Main' that matches my cell A2.
The date would be in row 2 of which some are not dates.
I'm just looking to do conditional formatting based on that cell but can't seem to find out how to get the cell
any help would be welcome...
If you want to highlight the cell in Row 2 of the Main sheet, then you can highlight row 2 in the Main sheet and apply conditional formatting in the Main sheet using this formula:
=A$1=INDIRECT("Sheet1!$A$2")
Please note that the above formula assumes that the sheet containing reference date in A2 is named "Sheet1."

How can I reference/get the value from a cell from another column, but the cell is above a number of blank cells? See image

I'm trying get the value of the previous cell from another column. But it must be the last cell above the current row.
You can use index and query to return the last cell above the current row with following formula:
=index(QUERY($B$2:$B2,"Select B where B is not null"),COUNT($B$2:B2))
If combined with INDIRECT and ROW, you can make this independent of current row:
=index(QUERY(INDIRECT("B2:B"&ROW()),"Select B where B is not null"),COUNT(INDIRECT("B2:B"&ROW())))
Reference:
INDEX
QUERY
INDIRECT
ROW

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

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)

Input cell from another sheet based on named cell name

Is they a simple way to import a cell from another sheet based on the name of a cell in the current sheet?
Below, I trying to say if A2 equals named sheet say Sheet2 then import J10 from Sheet2
=IMPORTRANGE(""=A2"","J10")
Thanks
Using =indirect("'"&A2&"'!J10")

TRANSPOSING: How to copy a cell value into the 'Sheet' part of formula

I'm trying to reference the data from another sheet, but I'd like to be able to dynamically specify the Sheet name via a cell within this sheet.
Let's say cell A1 has the text "Sheet 1"
Instead of having my formula say:
=TRANSPOSE('Sheet 1'!F2:F121)
I need to find a way to insert the data from cell A1:
=TRANSPOSE('reference text from A1'!F2:F121)
Is there a way of doing this? I'm working in Google Sheets.
Does this formula work as you want:
=TRANSPOSE(INDIRECT(A1&"!F2:F121"))

Resources