# Issue trying to sum different columns

I am trying to sum 3 different columns and I'm not being successful.

My function is: `=ARRAYFORMULA(SUMIF(MONTH(D:D), 2, A:C))`

Where `D` is a column with dates, and `A`,`B` and `C` columns with currency (A-value, B-shipping and C-tip). So my idea is to sum the values I got just for the month of February.

The function works but it seems to be just summing the column `A` and not the other two. Does anybody know how can I make it sum all 3 columns?

• Welcome. Please read how to and share a test sheet so as you can be easier helped. Mar 21, 2020 at 4:09
• Thanks, just edited Mar 21, 2020 at 17:31

Since you want to return the sum of each of 3 columns you could use the following query formula instead

``````=QUERY(QUERY(A:D,
"select sum(A), sum(B), sum(C) where month(D)+1=2 ",1),
"select * OFFSET 1 ",0)``````

The above formula will give you results for just the month of February.

You can alter the formula to get results for each month

``````=QUERY(QUERY(A:D,
"select sum(A), sum(B), sum(C) group by month(D) ",1),
"select * OFFSET 2 ",0)``````

Functions used:

• Hi marikamitsos, thank you so much for your reply! But my idea is to sum all values in one. Just in one cell and not in three different ones. Do you know how? Mar 24, 2020 at 15:38
• "my idea is to sum all values in one. Just in one cell and not in three different ones."??? Maybe I am missing something. So you want `G2+H2+I2`? If so, just wrap the formula with `SUM`. eg: `=sum(QUERY(QUERY(A:D,"select sum(A), sum(B), sum(C) where month(D)+1=2 ",1), "select * OFFSET 1 ",0))`. If it is something else please update the sheet with cells with the expected results. Mar 24, 2020 at 19:37
• oh of course, that's exactly what I wanted. Thank you once again! Mar 25, 2020 at 15:18
• Glad I could help. Please remember that as per site guidelines when an answer addresses your question, accept it and even upvote it so others can benefit as well. Mar 31, 2020 at 21:35