Google Sheets Transpose Formula [duplicate] - google-sheets

This question already has answers here:
How do you create a "reverse pivot" in Google Sheets?
(10 answers)
Closed 1 year ago.
How can I convert the data in the red cell to the data in the green cell?

Try this
=query(arrayformula(split(flatten(A2:A3&"|"&B2:F3),"|")),"select * where Col2 is not null")
if you have an undifined number fo rows, try
=query(arrayformula(split(flatten(A2:A&"|"&B2:F),"|")),"select * where Col2 is not null")
but limit the rows of the sheet to prevent long calculation

Use the TRANSPOSE Function documented here: https://support.google.com/docs/answer/3094262?hl=en
Sample Usage
TRANSPOSE({1,2;3,4;5,6})
TRANSPOSE(A2:F9)
Syntax
TRANSPOSE(array_or_range)
`array_or_range` - The array or range whose rows and columns will be swapped.

Related

Google Sheets - Using a sum formula and multiplying that sum depending on the status of checkboxes

I'm just starting and trying to learn about google sheets and I've got a much more involved sheet than what I'm showing here, but essentially I have ten check boxes and those boxes are each given a unique value when checked. When not checked they are all 0.
In this image I have 10 boxes in column A, with their assigned ON values in column B. Column C1 has the =SUM formula.
What I'm trying to figure out is how to multiply the summed number if boxes 9 OR 10 are selected. So box 9 and 10 would still contribute their value for the sum function but then would also have a multiple value that is triggered for the summed total.
Thanks in advance for any help!!
edit: sorry, I think I've caused some confusion. The values in the B column are just a visual representation of the value of the assigned value of the check boxes themselves, they aren't actually necessary to be used, but I'll see if I can use any of the answers listed to logic my way through it! thanks!
use:
=SUMPRODUCT(SUMIF(A1:A10, TRUE, B1:B10)*IF(A9=TRUE, B9, 1)*IF(A10=TRUE, B10, 1))
Try this
=ArrayFormula(IFERROR(SUM(QUERY(VLOOKUP(
QUERY(IF(A1:A<>TRUE,,ROW(A1:A)), "Select * Where Col1 is not null",0),
QUERY({ROW(A1:A),B1:B}, "Select * Where Col1 is not null") ,2,0), " Select * where Col1 is not null "))*
PRODUCT(QUERY(VLOOKUP(QUERY(IF(A1:A<>TRUE,,ROW(A1:A)), "Select * Where Col1 is not null",0),
QUERY({ROW(A1:A),B1:B}, "Select * Where Col1 is not null") ,2,0), " Select * where Col1 is not null ")),""))
Test all checkboxes

How to Find Date of a stock's ATH in Google Sheets

I have been trying to come up with the formula to give in 2 neighboring cells: 1.) the ALT of the stock and 2.) next the first cell, the date of the ATH value.
The example is the following:
table structure snapshot
I managed to address 1.) with the answer provided here - Filter the Google Finance formula to only display the "high" of all time
But I am unable to define a working index formula to then give me the date when the ATH was recorded.
Thank you!
Try
=query(GOOGLEFINANCE("ABBV", "high", "01/12/1980", TODAY(), 7),"select Col2, Col1 order by Col2 desc limit 1",0)

Column BY isn't pulling in google sheets query [duplicate]

This question already has an answer here:
Col BY causing parse error in Google sheets query
(1 answer)
Closed 5 months ago.
=query('Network Trade Data_2'!$AA$1:$CP,"Select AA, AC, BY where AC is not null",1)
I am just trying to pull in column BY but getting an error due to by also being a command. Any help would be greatly appreciated!
This is a known problem ."BY" is a reserved word in query strings since "by" is an actual syntax word you might use. The easiest fix is to change your range to an array and refer to things by their column numbers instead of range refs.
=query({'Network Trade Data_2'!$AA$1:$CP},"Select Col1, Col3, Col53 where Col3 is not null",1)
the other fix would be to use `:
=QUERY('Network Trade Data_2'!AA1:CP, "select AA,AC,`BY` where AC is not null", 1)

Reference to the cell which contains a certain date [duplicate]

This question already has an answer here:
How to compare dates or date against today with query on google sheets?
(1 answer)
Closed 3 years ago.
I have a problem with the query function in Google Sheets.
=QUERY(A1:D7; "Select B where C contains '"& F1 &"' ";0)
These formula works if the cell F1 contains a text or a number. But if it contains a date it turns with a N/A mistake.
As a result I need to get the data from the column B which is placed in the line with the certain date.
Please, could you help me? What do I do wrong?
for a date do:
=QUERY(A1:D7; "select B where A = date '"&TEXT(F1; "yyyy-mm-dd")&"'"; 0)
or do:
=ARRAYFORMULA(QUERY(TO_TEXT(A1:D7); "select Col2 where Col1 = '"&F1&"'"; 0))

Calculate total of values in columns?

I have a Google Sheets document with four sheets. In each sheet, there are two columns: first is a name, and second a value.
I need to get the total of the values from the four sheets in a fifth sheet where the names from the four name-columns correspond.
The column with the values is called differently in most sheets.
How can I accomplish this task?
You can use Query + Arrays, like on image below:
Code:
=QUERY({Sheet1!A2:B;Sheet2!A2:B;Sheet3!A2:B;Sheet4!A2:B};
"select Col1,sum(Col2) where Col1 is not null group by Col1 label Col1 'Name',sum(Col2) 'Total'";0)
Explanation:
First: you combine 4 sheets using an Array. Ranges start from row 2 to omit different columns headers:
{Sheet1!A2:B;Sheet2!A2:B;Sheet3!A2:B;Sheet4!A2:B}
Second: Using Query to perform a total. In Query there are some extra operations:
Col1 is not null - for not showing empty rows in totals
label Col1 'Name',sum(Col2) 'Total' - for naming result columns
Syntax may be a little different depending on your local settings, so look at the working copy:
Link to working copy
Is that serves your needs?

Resources