Drakell
Drakell

Reputation: 150

Google Spreadsheet Arrayformula for multiple columns conditions

I'm new on google spreadsheets, and I'm having this little problem:

I need to Sum values from column K (a project), for an specified person in cell B3, where the project belongs to the category RF or RM in column C, I've tried this but returns the sum of K like not conditions where applied...

=arrayformula(if(AND('SheetX'!I$3:I=B3;OR('SheetX'!C$3:C="RF";'SheetX'!C$3:C="RM"));sum('SheetX'!K$3:K);0))

Also

=arrayformula(Sum(if(AND('SheetX'!I$3:I=B3;OR('SheetX'!C$3:C="RF";'SheetX'!C$3:C="RM"));'SheetX'!K$3:K;0)))

Thanks to anyone who can help me with this simple issue.

Upvotes: 4

Views: 6159

Answers (1)

Drakell
Drakell

Reputation: 150

Already fixed. According to this link "The OR function does not work in array expression (nor does the AND function; but the NOT function does work). The workaround is to use ADD instead of OR and MULTIPLY instead of AND instead; for practical reasons use the + operator associated with ADD and the * operator associated with MULTIPLY."

What I did was this:

=Sum(filter('SheetX'!K$3:K;'SheetX'!I$3:I=B3;('SheetX'!C$3:C="RF")+('SheetX'!C$3:C="RM")))

Thanks to this video that clear it up.

Upvotes: 3

Related Questions