Displace output from formula into another cell - Google Sheets - google-sheets

I would like the array result of a formula to be displaced/displayed somewhere else. In this instance it should appear down a row.
For this case, it can be done by padding out the first row of a wrap around array, but it's not very pretty and is not dynamic. (It must be ammended if the number of array columns changes.)
={"","","","";query(A1:D5)}
Is there a better more generic way to do this?

try:
={INDEX(IFERROR(SEQUENCE(1, COLUMNS(A:D))/0)); QUERY(A1:D5)}

You can do it with IFERROR(.../0) combined with SEQUENCE(), COLUMN() or ROW().
Something along the lines of
=arrayformula({iferror(sequence(1,columns(A1:D5))/0);query(A1:D5)})

Related

Refer to itself in ARRAYFORMULA

I am just wondering whether it is possible to achieve what I need to achieve, but using an ARRAYFORMULA.
I have a simple setup where in column B I show the value, which is present in the last previous filled in row in column A
Here is an example.
So, the questios is: is it possible to achieve the same, but with ARRAYFORMULA(s), so that in case a new row is incerted, one does not need to drag formula to fill in the new row, but the formula would be added automatically. All my attempts ended up with the circular reference problem.
This is tradtionally done with a vlookup of row numbers into a filtered array of the values. It would look like this in row 4 of your sample sheet:
=ARRAYFORMULA(VLOOKUP(ROW(A4:A),FILTER({ROW(A4:A),A4:A},A4:A<>""),2,TRUE))

Iterate a range within a formula in sheets

I haven't been able to find if there's a 'quick' way to iterate the range of a column. In many formulas you have to have to first select the range of the sheet like
'Data'!A1:C1
I want to know if there's an easy way to iterate the column for the following rows when you drag the formula to the rows below so the formula in the next row is
'Data'!B2:C2
Is it possible? Thanks in advance.
possible:
="Data!"&ADDRESS(ROW(A2), ROW(A2), 4)&":"&ADDRESS(ROW(A2), 3, 4)
do not forget to convert it into actual range by wrapping it into INDIRECT
Try
'Data'!A"&row()&":C"&row()
you could change row()/+- with a corresponded number for the fit you want.

Remove Unused Cells in Arrayformula

I'm usually pretty good about modifying the arrayformula so that cells aren't displaying values when there is no data adjacent to it. But, with these money values, I can't seem to change it to work. How can the arrayformula be changed so that $0.00 doesn't appear all the way down the column for data that is not yet present?
Here's the spreadsheet to edit. Arrayformula is in yellow highlighted cell.
Thanks for your help!
One solution is you can expand the computation to:
=ARRAYFORMULA(IFERROR(1/(1/(DMAX(TRANSPOSE(A3:G), SEQUENCE(ROWS(A3:G)), {IF(,,);IF(,,)}))),""))
The formula will originally return an error for zero result, but because of the IFERROR it will be replaced by space.

How to highlight a specific range of cells if none have a value

Apologies in advance if I don't explain this very well, I have only an amateur's interest in formulas.
I have a Google Sheet where I need to fill in a value, in this case, "1" in one column in the range C-J for each row.
I'd like to know the custom formula so that if I haven't filled in a "1" in any row C-J, then the C-J range of that row is highlighted red (but not the whole row)
I've attached screenshots of what it looks like currently and then an example of what I would like it to look like.
Current:
Desired:
use this custom formula:
=SUM($C4:J4)=0
or you can use:
=COUNTIFS($C4,"",$D4,"",$E4,"",$F4,"",$G4,"",$H4,"",$I4,"",$J4,"")
Use Custom Formula
=countif($C2:$J2,1)=0

How to use arrayformula to dynamically join strings in google spreadsheet?

I use Arrayformula() to make my reports dynamic and easier to edit. For example, if I have a Column A with a list o number o blue balls in a set and a Column B with a list red balls in a set, on the cell C1 I can write =ArrayFormula(add(A1:A,B1:B)) and in the Column C will have the total of balls in each set. It would be exactly the same as writing =A1+B1 in cell C1 and dragging the formula down to the last row. Arrayformula() has some benefits, because it will work if some adds or removes rows from the sheet and also it makes the reports way more organized and easier to edit.
Since I´ve discovered arrayformula(), my life has changed, because of the fact that googleSheets expands the formula to other cells. It does not work every time, but the idea of expanding to other cells seems to be possible some way or another, here is a good example of a problem that was not resolved by arrayformula(), but has the same idea.
Keeping that idea in mind, imagine that on Column A there is a list of First Names and on Column B there is a list of Last names. On Column C I want to join this two string using a simples space. The way to do that would be in the cell C1 write =join(" ",A1,B1) and then drag down this formula. This method method however is prone to error since people can add and remove rows, deleting my formula. I want to use a formula that I can write in one single cell and it expands to other cells. I´ve tried =arrayformula(join(" ",A1:A,B1:B)), but it does not work.
Is that a way to do that using =arrayformula() or other native function?
I know I could write a script or custom formula to do that, but this is not my goal here.
I think this formula should work:
=arrayformula(A1:A&" "&B1:B)
In case you want to use a delimiter, you can do the following to have a clean result even though, A or B is not present in some cases:
ARRAYFORMULA(ifna(ifs(isblank(A1:A),,ISBLANK(B1:B),A1:A),A1:A&" - "&B1:B))

Resources