SUMPRODUCT or SUM Formula with Date Range

BillNLTC

New Member
Joined
Jan 3, 2006
Messages
7
Hi Folks...I hope you can help me (as you have so remarkably in the past!) with a challenge.

I have a spreadsheet with 3 columns:
Column A contains dates in this format: 1/15/06
Column B contains either "YES" or "NO"
Column C contains dollar amounts.
Columns D through O are labeled January through December

For those items containing a "YES" in Column B, the corresponding dollar amounts in Column C must be summed in a cell for the month corresponding to their date.

For instance, if there are three sales for January (say, on the 15th, 18th, and 26th) listed in Column A, and they all have a "YES" in Column B, their corresponding dollar amounts need to be summed and placed into a single cell under Column D-January.

Two additional points:
Point 1: The date ranges that I need to use do not correspond exactly with calendar dates. In other words, for my purposes, the month of January ends on the 28th so I need to capture only those amounts that have a date prior to the 29th. February ends on the 25th, but also includes January 29th, 30th, and 31st. And so on.

Point 2: I have determined that the problem with the formulas below has something to do with the date range. If I substitute any other character, number, or word for the date range, it works perfectly. I tried using a VLOOKUP to substitute a number for the date range, but I can't get the formulas to work with it.

I have tried the following two formulas with no luck:

{=SUM(($A$3:$A$1000<"1/29/06")*($B$3:$B$1000="YES")*($C$3:$C$1000))}

=SUMPRODUCT(($A$3:$A$1000<"1/29/06")*($B$3:$B$1000="YES")*($C$3:$C$1000))

I appreciate any advice that you may have, and thank you for your time and consideration!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi BillNLTC,

Welcome to MrExcel!
Book1
ABCDEF
11-Jan28-Jan25-Feb31-Mar
2JanFebMar
301/05/06Yes$10040016001800
401/15/06No$200
501/25/06Yes$300
601/30/06Yes$400
702/04/06Yes$500
802/14/06No$600
902/24/06Yes$700
1002/27/06Yes$800
1103/06/06No$900
1203/16/06Yes$1,000
1303/26/06No$1,100
Sheet3


Formula in D3 and copy across,

=SUMPRODUCT(--($A$3:$A$19>=C$1),--($A$3:$A$19<=D$1),--($B$3:$B$19="Yes"),$C$3:$C$19)

D1:F1 houses the month end dates.

HTH
 
Upvote 0
Book6
ABCDEFG
1
2DateY/NAmount28-Jan-0525-Feb-0528-Mar-0528-Mar-05
31/3/2005Y67.16133.2226.87121.25121.25
41/24/2005Y66.04
51/26/2005N32.44
61/29/2005Y86.72
71/30/2005Y39.48
82/10/2005Y19.17
92/17/2005Y81.5
102/28/2005N81.64
112/28/2005Y16.54
123/1/2005Y55.5
133/14/2005N17.26
143/16/2005Y65.75
Sheet1


D2, copied across:

=SUMPRODUCT(--($B$3:$B$14="Y"),--($A$3:$A$14>=EDATE(D$2,-1)+1),--($A$3:$A$14<=D$2),$C$3:$C$14)
 
Upvote 0
Thanks a million Aladin and Krishnakumar!!! I'm ashamed to say that I've spent about 10 hours, mostly reviewing previous board posts, doing what it took you mere minutes to do! I'm sincerely grateful.

If I might ask, I'm not familiar with the two dashes that you've used in your formulas. If your time permits, is a brief explanation possible?

Again, thank you so much for your expertise in resolving this for me. Take care...
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,279
Members
449,094
Latest member
GoToLeep

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