Assistance with Sumproduct(orsumifs) on multiple columns including specifying months (Current and Previous)

Stretlow

Board Regular
Joined
Dec 17, 2008
Messages
131
Good morning.

if someone could help me with a formula I'd'd appreciate it. (i'm OK with some basics but this is beyond me unfortunately)

I have a table the following column headers

E = Amount
N = Date Refunded
Y = WriteOff

what i'm looking for is two formulas.

1) Sum Column E where Column N is in the current month and Column Y is blank.
2) Sum Column E where Column N is in the Previous month and Column Y is blank.

I currently have got this far

=SUMIFS(Chargebacks!E:E,Chargebacks!N:N,"<>",Chargebacks!Y:Y,"=")

obviously the bit in red is where i need to define the months but i'm not sure how


I really need to to do some self learning on sumproduct as I find it difficult to get my head around however any help is greatly appreciated.

Stret
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Now this will depend on how your months have been entered in Column N.

If they have been entered as dates then:

- For current month
Code:
=SUMPRODUCT(E:E,(MONTH(N:N)=MONTH(NOW()))*(Y:Y<>""))

-For previous month
Code:
=SUMPRODUCT(E:E,(MONTH(N:N)=MONTH(NOW())-1)*(Y:Y<>""))


I really need to to do some self learning on sumproduct as I find it difficult to get my head around however any help is greatly appreciated.


I'm exactly the same, but this forum is a great place to start.
 
Upvote 0
Hi Stret

Try for 1):

=SUMPRODUCT(--(TEXT(Chargebacks!N1:N100,"yyyymm")=TEXT(TODAY(),"yyyymm")),--(Chargebacks!Y1:Y100=""),Chargebacks!E1:E100)


Remark: it's not efficient to use whole columns in the formula. if you need adapt the ranges.
 
Upvote 0
Hi Comfy

3remarks

- if you test only the month you'll for ex. accept the same month of last year
- Now()-1 means yesterday same time, not last month
- better to avoid whole columns, makes formulas slow
 
Upvote 0
Hi Comfy

3remarks

- if you test only the month you'll for ex. accept the same month of last year
- Now()-1 means yesterday same time, not last month
- better to avoid whole columns, makes formulas slow

- if you test only the month you'll for ex. accept the same month of last year - Good point, I didn't think of that.

- Now()-1 means yesterday same time, not last month - the formulas reads Month(Now())-1

- better to avoid whole columns, makes formulas slow - agreed.
 
Upvote 0
Thanks chaps.

Ill have a go at this later today.

The reason i used the whole columns was because the formulas are being used on a sheet that auto populates its data from a sharepoint list so wanted to make sure it catches all the records however theres probably not going to be more than 10k.

I'll post back how im going on.

Thanks again
 
Upvote 0
=SUMPRODUCT(--(TEXT(Chargebacks!N1:N100,"yyyymm")=TEXT(TODAY(),"yyyymm")),--(Chargebacks!Y1:Y100=""),Chargebacks!E1:E100)

this works perfect, where do I insert the -1 to get last month?

Stret
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,170
Members
448,870
Latest member
max_pedreira

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