Sumproduct calculation vba

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,075
Office Version
  1. 2019
Platform
  1. Windows
How can I use this formula in vba...

=SUMPRODUCT(--(TEXT($D$15:$D$1001,"mmmmyyyy")=$S23&T$14),$P$15:$P$1001)

Thank you kindly
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I think you will find that James006 wants you to confirm that they are both Comboboxes :biggrin:
I think you also need to confirm that the months are the months names and not the month number.
 
Upvote 0
They are combo boxes and the months will be Names and the Years will be numbers
 
Upvote 0
Could someone assist with offering a solution to my request. Thanks
 
Upvote 0
Have you tested :

Code:
CCI.Caption = Evaluate("=SUMPRODUCT(--(TEXT(D15:D1001,""mmmmyyyy"")= " & cbMon & cbYr & ",P15:P1001)")
 
Upvote 0
Have you tested :

Code:
CCI.Caption = Evaluate("=SUMPRODUCT(--(TEXT(D15:D1001,""mmmmyyyy"")= " & cbMon & cbYr & ",P15:P1001)")


yes...that was the first thing I tried but it gives me an error
 
Upvote 0
You need some quotes for your text values:

Code:
CCI.Caption = Evaluate("=SUMPRODUCT(--(TEXT(D15:D1001,""mmmmyyyy"")= """ & cbMon & cbYr & """,P15:P1001)")
 
Upvote 0
Does this work for you...
Code:
[table="width: 500"]
[tr]
	[td]CCI.Caption = Evaluate("SUMPRODUCT(--(TEXT(D15:D1001,""mmmmyyyy"")=""" & cbMon & cbYr & """),P15:P1001)")[/td]
[/tr]
[/table]
 
Upvote 0
Works Perfect!!!!! Thank you sooo much to everyones for help. I really appreciate it A LOT!!!

Does this work for you...
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]CCI.Caption = Evaluate("SUMPRODUCT(--(TEXT(D15:D1001,""mmmmyyyy"")=""" & cbMon & cbYr & """),P15:P1001)")[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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