PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, November 3, 2022

[FIXED] How to use arrayformula with GCD?

 November 03, 2022     array-formulas, byrow, google-sheets, google-sheets-formula, lambda     No comments   

Issue

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))

GCD doesn't seem to support arrayformula. How to make it work with ARRAYFORMULA?

Column C is the result of using autofill.

A B[Arrayformula] C[DragFill]
1 FALSE FALSE
2 FALSE
3 FALSE
4 FALSE
5 TRUE
6 FALSE
7 FALSE
8 FALSE
9 FALSE
10 TRUE
62 FALSE
34 FALSE
22 FALSE
75 TRUE
34 FALSE
46 FALSE
30 TRUE
21 FALSE
92 FALSE
56 FALSE

Solution

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



Answered By - player0
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing