how to concatenate a section of a column of data - google-sheets

Is it possible to use a cell to define the end of a range for a formula?
Essentially, I would like to use the JOIN() statement to concatenate a section of a column of data.
The data starts at a cell, say A5, and runs to a cell with the word 'total' in it. I've created a cell (let's call it L12) which returns the number of rows of data that are available.
I'd like to use that cell to form part of the range details of the JOIN() formula thus:
=JOIN(" ", A5: A[the value in L12]).
Is this possible?

I've found the indirect() function does exactly what I needed it to do.
See the Google function list https://support.google.com/docs/bin/static.py?hl=en&topic=25273&page=table.cs

Related

modify number from cell reference in QUERY function (Google Sheets)

Is it possible to modify a number from a cell reference within the syntax of a QUERY function in Google Sheets without a helper cell/column?
If I have "5" in a cell, can I reference that cell and somehow subtract 1 when using the LIMIT option in the QUERY syntax so it returns four results?
I am including a sample sheet below as well as working and nonworking formulas.
link to sheet & cell
https://docs.google.com/spreadsheets/d/1lyCK5eIEQYjGFOxh5T_4BxeuDS-1zvMLq80IYn0dc38/edit#gid=1018697126&range=B1
working formula:
=QUERY(INDIRECT(currentTable),"limit "&B1&"",1)
nonworking attempt:
=QUERY(INDIRECT(currentTable),"limit "&B1&"-1",1)
You can just subtract 1 from B1 instead before passing it into the query.
=QUERY(INDIRECT(currentTable),"limit "&B1-1,1)
Output:

Google Sheets Fill Down with Formula

I have a very hard problem to solve, which must be completed with a formula (not a script).
Basically, the Raw input column needs to be dynamically filled down until it hits the next piece of text.
Here's an example file with includes the expected output.
https://docs.google.com/spreadsheets/d/1ibqCvY39NlhCRWsbBdxKITUUpVpp9wXdEz44T-pHDY0/
Is it even possible to achieve?
Thanks
This will work based on your ask, assuming that A2 is never blank, place this in the first row of data (not header):
=ArrayFormula(IF(A2:A<>"", A2:A, B1:B))
It checks to see if there is a value in column A, if there is, it fills that column, if not, it copies the cell above.
Delete everything in Column B (including the header) and place the following formula in B1:
=ArrayFormula({"Header";VLOOKUP(FILTER(ROW(A2:A),ROW(A2:A)<=MAX(FILTER(ROW(A2:A),A2:A<>""))),FILTER({ROW(A2:A),A2:A},A2:A<>""),2,TRUE)})
Here is a basic explanation of how this formula works:
A virtual array is created between the curly brackets { }; this virtual array contains a header and all results. You can change the header name to whatever you like.
VLOOKUP looks up every row number that is less than or equal to the highest row number that contains text in A2:A. Each of these qualifying rows is looked up in a second array that contains only the row numbers and Column-A data from non-blank rows, returning the data itself. Since rows are in perfect ascending order and the last parameter of VLOOKUP is set to TRUE, all blank rows in the first array will "fall backward" to find the most recent row that did have something in Column A.

SPREADSHEET INDIRECT() with variable column

If A1 has a value of 2, =INDIRECT("L"&(5+A1)) will return me cell L7's content. And my A1 value keeps on being updated.
But I need a way to sort through columns instead of rows, like
L7, M7, N7, O7 and so on...
Which formula can help me sort through the columns? I also know that =COLUMN() returns the current column converted to number, but I had no luck with =INDIRECT((column()+A1)&7).
You can use the address() function inside indirect. Address() returns a cell reference as a string. So for example, if you enter in G5
=indirect(address(A1, column()))
while A1 is 1 the above formula will return the contents of cell G1.
See if this helps?

Add title row with ARRAYFORMULA in Google Sheets

I watched a tutorial where the author uses an IF statement along with the ARRAYFORMULA function to add a title row to a column of data. Links are given to the docs; however, for an example of how to use ARRAYFORMULA see this answer.
An example can be seen below:
I was able to populate the C column by placing the following formula in C1:
=ARRAYFORMULA(if(row(A:A) = 1, "spent", B:B - A:A))
I'm confused about the syntax. I understand that X:X references the entire X column but I don't understand how it's being used to check if we're at cell A1 in one context and then being used to apply mass formulas in another context.
How does the above line work?
Can you illustrate with some examples?
It sounds to me that the information you learned led you to expect that row(A:A)=1 translates to row A1?
It works a little different than that, the syntax as your using it now, is basically saying if any row in A:A has a value of 1, then write "spent" else subtract B-A
My suggestion:
use a literal array to make your header, then use the if(arrayformula) to only populate rows with values, for aesthetics:
Example:
={"Spent";arrayformula(if(isnumber(A2:A),B2:B-A2:A,))}
Explanation:
The {} allow you to build a literal array, and using a semicolon instead of a comma allows you to stack your cells vertically, following that we check if there is a value in column A, if so, subtract A from B, else leave it blank.
why not just put the column title directly on the first row cell, and start the array formula from the 2nd row, using the A2:A, B2:B syntax?
If something does not have to be in a formula, better put it directly on the cell - simpler for others to understand what's going on, and the formula will be simpler.
If you put the array formula in line 2, and someone sorts the data, then the arrayformula will move. If it is in the header line, this is less likely to happen.
You can also use the IFS function to achieve a similar effect to the array,
=arrayformula(ifs(row(A1:A)=1,"Spent",A1:A="",,True,B1:B-A1:A)
Here the first condition checks the row number, and if it is row ONE, then inserts a Column Header.
The Second condition - A1:A="",, - ensures that blank lines are ignored.
The Third condition True (ELSE) performs the calculation.
This method also allows for different calculations to performed on different rows depending on requirements.

Lookup and Transpose functions to return multiple values in a cell

I want to use a type of lookup function that will return a range of cells instead of one cell. Then transpose that data.
Typical Vlookup function
VLOOKUP(Value_Lookup Range_Column_False)
I would like that column part to be a range in a row not a specific cell. For example:
If the value exists with the defined range, send the values of the entire row the initial value is in. Then transpose the range in a selected cell.
Is there a way to do this? I am only familiar with the vlookup function, would Index Match work?
Here is a link to an example spreadsheet:
Spreadsheet example
Please try:
=transpose(query(A1:EZ4,"select * where A ='Jimmy Medina' "))
Re supplementary, please try:
=transpose(query(A1:EZ4,"select * where A ='"&'Name Selection'!$A1&"' "))

Resources