I have trouble creating automation using Google Sheets. I use array formula for converting duration format from one column, to make it understandeable for Google Data Studio, however, my autiomation, when there's no existing project, needs to append a new row. But if there's an array formula applied to a column, it has created 0 values for 1000 rows, and my new row gets appended as 1001. How to fix that?
Maybe I could somehow limit the array formula to work only if there's data in the row?
I tried to find other variant of array formula from here, but none of these worked,
https://support.google.com/docs/table/25273?hl=en
I could use some help. Thanks before.
Here's my spreadsheet, that I'm working on
https://docs.google.com/spreadsheets/d/1zWxvwNhCExy7_9tvgJ0lo4nBmYac51NMqaqzh8kR4H4/edit?usp=sharing
Array formula applied to last column creates rows for non-existend data
use:
=ARRAYFORMULA(IF(E2:E="";;SECOND(E2:E)+MINUTE(E2:E)*60+HOUR(E2:E)*3600))
Related
I have the following formula to automatically insert the date in column B if the corresponding cell in row A contains data
However there are already rows that have been filled out manually from before I decided to try automate this and I don't want to lose the data
so I have the following formula (note 5 is used here just for testing purposes. in final application there are more than 100 populated rows I am trying to skip over
=ArrayFormula(IF(ROW(B:B)=1,"Date",IF(ROW(B:B)<5,"",IF(A5:A<>"",TODAY(),""))))
however it keeps returning the following error
Error
Array result was not expanded because it would overwrite data in B2.
As far as I can tell this is because it is attempting to write an empty string to these cells. Is there a way to have it not do this and simply start from row X?
I tried to wrap the formula in an IfERROR statement but that did not work and as seen above I attempted start referencing only from cell 5 onward but tat didnt work either
=ArrayFormula(IFERROR(IF(ROW(B:B)=1,"Date",IF(ROW(B:B)<5,"",IF(A:A<>"",TODAY(),""))),""))
I wish to create a helper cell using a dynamic array, Is this possible?
Normally I use a formula such as in this example =IF(A4="",C2,A4) which check if column A is blank and if so just copies the above value until a new value appears in column A.
However as shown in the image when I insert New rows the helper cell becomes broken.
For this reason I wanted to use a dynamic array to create the helper cell which should be able to handle rows inserted or removed.
The problem I have is that unlike a normal formula which you can just drag down, a dynamic array is looking at the values as a whole. Using =IF(A4:A40="","-",A4:A40) inserts a hyphen as shown in the image. Essentially I wish to replace the hyphen such that "For each value between A4:A40 check if blank and if true take the value in the above cell". In essence creating a dynamic helper column.
You can use the inexact form of Match to find the last row which is not blank, and then Index to take the value in column A from there:
=INDEX(A4:A40,MATCH(ROW(A4:A40),IF(A4:A40<>"",ROW(A4:A40))))
This sort of thing is done a lot in Google Sheets.
If you insert a row, the formula changes to
=INDEX(A4:A41,MATCH(ROW(A4:A41),IF(A4:A41<>"",ROW(A4:A41))))
and still works OK.
A truncated version of my data is in the form shown in the screenshot below: three columns of 5 unique names. The names appear in any order and in any position but never repeat in a single row.
My goal is to create an array that contains the number of times Adam appears in each row. I can fill down the formula=countif(A2:C2,$I$2) in a new column, or if I write the array manually for each row, it looks like:
={countif(A2:C2,$I$2);countif(A3:C3,$I$2);countif(A4:C4,$I$2);countif(A5:C5,$I$2);countif(A6:C6,$I$2)}
Where cell I2 contains "Adam". Of course, this is not feasible for large data sets.
I know that arrays are effectively cells turned into ranges, but my main issue is that the cell I'm trying to transform already references a range, and I don't know how to tell the software to apply the countif down each row (i.e. I intuitively would like to do something like countif((A2:C2):(A99:C99),"Adam") but understand that's not how spreadsheets work).
My goal is ultimately to perform some operations on the corresponding array but I think I'm comfortable enough with that once I can get the array formula I'm looking for.
try:
=ARRAYFORMULA(IF(A2:A="",,MMULT(IF(A2:C="Adam", 1, 0), {1;1;1})))
I have created a excel sheet with multiple columns combining a mix of manual data entry, data validation dropdowns and array formulas to automate data entry.
eg. {=IF(ROW(A2:A100}=2,"Name",IF(C2:C100<>"",$B$1,""))}
which adds header and autopopulates column A with name specified in B1 for every non-blank cell in C.
The problem I am having is after the array formula has been applied I cant filter or sort the data without an error message appearing stating "You cannot change part of an array".
This defeats the purpose of array formula if the data has to stay fixed in its original position and requires the use for cell by cell calculations.
I am at my tethers end on a question and was hoping someone on here could point out the simple mistake I am making.
I have a formula that I am using in an excel spreadsheet that works fine but when I import into Google Sheets it ceases to work.
The formula that works in excel is
{=INDEX('2009-2010'!D2:D20,MIN(IF(SUBTOTAL(3,OFFSET('2009-2010'!D2,ROW('2009-2010'!D2:D20)-ROW('2009-2010'!D2),0)),ROW('2009-2010'!D2:D20)-ROW('2009-2010'!D2)+1)))}
and the way I try and use it in sheets is
=ArrayFormula(INDEX('2009-2010'!D2:D20,MIN(IF(SUBTOTAL(3,OFFSET('2009-2010'!D2,ROW('2009-2010'!D2:D20)-ROW('2009-2010'!D2),0)),ROW('2009-2010'!D2:D20)-ROW('2009-2010'!D2)+1))))
But instead of doing what it is meant to (which is displaying the top visible cell on column 'D' of another worksheet called '2009-2010') it just inserts the whole column.
I have tried a couple work arounds but I am in over my head - any assistance would be fantastic!
Somewhat surprisingly I have not been able to find anything(anywhere) about someone trying to do the same function on Google Sheets...?!
This is an oldie, but if someone is still interested one could use this formula instead, in both Excel and Spreadsheet:
=INDEX('2009-2010'!D2:D20,MIN(IF('2009-2010'!D2:D20>0,ROW('2009-2010'!D2:D20)-ROW('2009-2010'!D2)+1)))
The IF('2009-2010'!D2:D20>0 part can also be changed to <>"" if the values are texts.
The problem is Spreadsheet doesn't treat all array formula scenarios the same way Excel does. For example Excel calculates the CountA for each item and returns an array of 0 and 1, and Spreadsheet counts the whole array and returns one count result.
This formula is also more efficient by avoiding the OFFSET volatile function.