Home > Mobile >  How to use arrayformula with formulas that don't seem to support arrayformulas?
How to use arrayformula with formulas that don't seem to support arrayformulas?

Time:10-16

I'm trying to use this formula to determine if Column A is a multiple of 5, but the arrayformula isn't expanding.

=arrayformula(if(gcd(5,A1:A)=5,true,false))

https://img.codepudding.com/202210/7b2d9ba3742a48278fecccc0bf880ced.png

CodePudding user response:

try:

=BYROW(A1:A20, LAMBDA(x, GCD(5, x)=5))

enter image description here

or just:

=INDEX(MOD(A1:A20, 5)=0)

enter image description here

CodePudding user response:

As long as the return value is one cell per row, you can use BYROW to use formulas that don't typically support arrayformula. The syntax is

=BYROW(range, LAMBDA(row, your_formula(row)))
  • Related