Sumifs with different column

teuteux13

New Member
Joined
Sep 25, 2016
Messages
28
Dear all,

I need to found the formula to obtain the sum of previous prices month in the column total.

Let suppose we are in March 2018 and the month is not finished then you need to compare your current data to the previous and current year month by month.

In the column "H'' I need to find a formula to sum only the previous month up to today.

And because March 2018 result isn't out yet then the calculation should stop at February for the row 2017 and 2018 as the example below

Hope you can help I can't find it.

Thank you in advance.

ABCDEFGH
1yearprice 01volume01price 02volume 02price 03volume 03Total
220170010
320172042
420173346
52018549
62018033

<tbody>
</tbody>
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Re: need help with sumifs with different column

Hi,

I'm sure there is a more elegant way of achieving this, but for now please try to use the following formula (cell H2 & drag it down):

=SUM(B2*(COUNTA($B:$B)=COUNTA(B:B)),D2*(COUNTA($B:$B)=COUNTA(D:D)),F2*(COUNTA($B:$B)=COUNTA(F:F)))

COUNTA check should determine if we are dealing with an incomplete month. In column F this statement will return 0, thus F2 value won't be included in the SUM calculation.

Let me know if that works for you.
 
Upvote 0
Re: need help with sumifs with different column

Maybe something like this:
Code:
=SUMPRODUCT(SUMIF(B$1:G$1,"*price "&TEXT(ROW(A$1:INDEX(A:A,MONTH(NOW())-1)),"00"),B2:G2))

This formula its not assuming the current month to be March 2018. I have used now() assuming that you are looking for summing up data till current month. It will automatically change the month based on todays's date.
 
Upvote 0
Re: need help with sumifs with different column

Dear Justyna,

It doesn't work all my result return always "0"

Can you simulate by copying my table and see if it is working for you

Thanks
 
Upvote 0
Re: need help with sumifs with different column

Dear mr Nishant49,

Your formula doesn't work.. Only "0" as result

Could you try to simulate my table and make it work?

Thanks in advance
 
Upvote 0
Re: need help with sumifs with different column

Hi teuteux13,

I checked my code and Nishant's code and both seem to work fine. Is there any chance you can share a sample of your file (i.e. using online Excel document)?

Thanks,
Justyna
 
Upvote 0
Dear Justyna,

Sorry i have double checked to an other laptop and it is working.

It's weird! it didn't work on my company laptop but work on my personal....

I will figure out tomorrow by reinstalling the software

Thanks and sorry for the callback
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top