Counting values within date range

krispatterson

Board Regular
Joined
Apr 28, 2017
Messages
51
Hi guys

Pretty simple one for you lot I'm sure!


Column A - 1000's of dates
Column B - £'s
Column C - £'s

Column D - list of dates (ie Nov 16, Dec 16, Jan 17 etc)



I'm currently using the following formula to count the number of instances of dates within a range:
=COUNTIFS(!$A:$A,">="&D1,!$A:$A,"<"&EDATE(D1,1))

I need to amend it so that my formula:
> looks in Column A and pulls out all dates within a range (so, as the above, only look at date instances in Nov 16)
> if Column A is in Nov 16, the figure from Columns B & C are added together.


Does that make sense? Let me know if it's doable, thanks guys!

Kris
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You could try:

=SUMPRODUCT(($A$1:$A$50000=D1)*($B$1:$C$50000))

SUMPRODUCT can't take full columns, so I am using 50000 rows; you might change it to a value that better suits your needs.
 
Last edited:
Upvote 0
The dates in column D such as Nov 16.... are they true dates?? Click Nov 16. What appears in the formula bar?
 
Upvote 0
try

=SUMPRODUCT(--($A$1:$A$5000>=D1)*($B$1:$C$5000))-SUMPRODUCT(--($A$1:$A$5000>=EDATE(D1,1))*($B$1:$C$5000))
 
Last edited:
Upvote 0
steve, dates are all 01/11/16, 01/12/16 etc etc

& repush, that doesn't work unfortunately.


I'll try and recreate my spreadsheet below, in basic form:

WORKBOOK 1
ABC
01/11/16
01/12/16
01/01/17
01/02/17

<tbody>
</tbody>

WORKBOOK 2
ABC
04/11/1615
10/11/16145
15/11/16816
14/11/16410
01/12/1661
22/11/1646

<tbody>
</tbody>


I want a formula that:

> looks at Workbook 2
> looks at Column A and finds all instances of a date in November
> If it finds a November instance, it then adds Columns B & C together.


So, I've used the edate function previously to find the number of instances of a date range in November before (as per 1st message). What I now need it to do is an extra calculation when it find those instances.


Does that make sense?? :)
 
Upvote 0
it makes sense . . . and that's what the sumproduct-formula should do . .

can you explain "doesn't work"? (errors, (unexpected) values, . . )

What should the result in Workbook 1 look like?
 
Upvote 0
it makes sense . . . and that's what the sumproduct-formula should do . .

can you explain "doesn't work"? (errors, (unexpected) values, . . )

What should the result in Workbook 1 look like?


Thanks Repush.


So
- result in Workbook 1, Column B (next to 01/11/16) should be 100 (so, sum of all numbers in Workbook 2, Column B & C excl the 01/12/16 values)
- result in Workbook 2, Column B (next to 01/12/16) should be 7 (so, sum of all numbers in Workbook 2, Column B & C excl the 01/11/16 values)


I think that makes sense :) :)
 
Upvote 0
and that is exactly the result I get . .
but I had tot translate it from Dutch (; to , and so on) so I might have made a typo
 
Upvote 0
I checked . . no typo . .
try to put it in the same workbook (2)
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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