0

Using IFS with ARRAYFORMULA creates an error saying that the: "IFS has mismatched range sizes. Expected row count 1. column count 1......"

=IFS(A2="A",ARRAYFORMULA(B3:B10),A2="B",ARRAYFORMULA(C3:C10) create an error on my test page below. Any help is appreciated.

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

2
  • Welcome to Web Applications Stack Exchange. The problem would probably be better described as "how to use ifs() in an array formula" rather than the other way around. Jun 11, 2022 at 20:34
  • Many thanks to doubleunary for his quick and accurate solution!
    – Rellif
    Jun 11, 2022 at 20:45

1 Answer 1

0

The ifs() function is more picky than the if() function when it comes to operand and result dimensions. Use this pattern:

=arrayformula( 
  ifs( 
    iferror(B3:B10 / 0, A2) = "A", 
      B3:B10, 
    iferror(C3:C10 / 0, A2) = "B", 
      C3:C10, 
    true, 
      na() 
  ) 
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.