count number of cells within a certain date

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Hi I have a list of contracts that includes their end date and their annual value,

e.g.
A1 = name of contract
B1 = 31/12/2018 (end date)
C1 = 500,000 (contract value)

I want a formula to count how many dates in column B fall within a particular month and another formula to sum the corresponding contract value of column C.

e.g.
E1 = January 2019
E2 = looks at E1 and counts how many dates in column B fall within January 2019
E3 = looks at E1 and sums the corresponding value in column C for those contracts ending in January 2019

Hope that's clear!! Thank you!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I put this in E2 and it seems to work

=COUNTIF(Sheet1!$B:$B,"31/1/2018")-COUNTIF(Sheet1!$B:$B,"1/1/2018")

Not sure how I work out the values
 
Upvote 0
In E2 enter:

=COUNTIFS(Sheet1!$B:$B,">="&"2019-01-01",Sheet1!B:B,"<="&EOMONTH("2019-01-01",0))

In E3 enter:

=SUMIFS(Sheet1!C:C,Sheet1!$B:$B,">="&"2019-01-01",Sheet1!B:B,"<="&EOMONTH("2019-01-01",0))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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