Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Array formula with IF not populating collumn in google sheets

I cannot seem to make my arrayformula pupolate downards from the first referenced row for some reason

*background
I have 15 ish formulas in an active document that I would like the to autopopulate with the formulas when I create new rows.

The way to do this seems to be ArrayFormula and changing the references from say O2 to O2:O to make it populate the sheet

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I am making some basic error here and I need some assistance 🙂


link to test sheet *some headers are in Swedish (sorry) 🙂

https://docs.google.com/spreadsheets/d/1P7M73-ITRG3LNA5O7yR0grj40d9tFF8Ve6ed6hQkiyc/edit?usp=sharing

my testing; *** this is in the example sheet in G1

*orig formula which works fine dragging into new rows
=IF(AND(O2=""),"",IFERROR(MAX(($V2)/$X2,0)))

*the formula checks for empty cells and if not it will calculate a percentage based on other furmulas

*array with original formula + header row
={"Klar"; ArrayFormula(IF(AND(O2=""),"",IFERROR(MAX((V2)/X2,0))))}
**this results in O2 populating as expected

With somehow incorrect references which I hoped would populate the whole collumn
={"Klar"; ArrayFormula(IF(AND(O2:O=""),"",IFERROR(MAX((V2:V)/X2:X,0))))}

I expect the formula to currently populate O2-> O6 and to go into new rows with data when they appear.
I also expect to be able to do arrays for all 15 collumns.

>Solution :

Use MAP() function. I have made this formula based on your provided formula =IF(AND(O2=""),"",IFERROR(MAX(($V2)/$X2,0))).

=MAP(O2:O,V2:V,X2:X,LAMBDA(x,y,z,IF(x="","",MAX(y/z,0))))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading