# 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?

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? – João Vaz Mar 24 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. – marikamitsos Mar 24 at 19:37
• oh of course, that's exactly what I wanted. Thank you once again! – João Vaz Mar 25 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. – marikamitsos Mar 31 at 21:35