Last date search in range

Bravo2003

Active Member
Joined
Apr 1, 2010
Messages
278
Office Version
  1. 365
Platform
  1. Windows
Not sure if this is possible.. but then again anything is possible in Excel I find from you lot...

I have a column of dates in Column C - 28/12/2018, 26/01/2019, 27/02/2019, 29/03/2019, etc...

In Cell C99 I need it to find the latest date related to the ref month number (1, 2, 3, 4, 5, etc - in cell A99) from the column range.

If that makes sense, is it possible?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Given that you have dates from 2018 and 2019, you might need to specify year as well as month

For January 2019, try

=AGGREGATE(15,6,$C$2:$C$98/(MONTH($C$2:$C$98)=1)/(YEAR($C$2:$C$98)=2019),1)

Delete the part in bold if you don't need the year.
 
Upvote 0
Given that you have dates from 2018 and 2019, you might need to specify year as well as month

For January 2019, try

=AGGREGATE(15,6,$C$2:$C$98/(MONTH($C$2:$C$98)=1)/(YEAR($C$2:$C$98)=2019),1)

Delete the part in bold if you don't need the year.

That gives a #NUM error.
Doesn't matter about year, as i will set the range criteria to just cover each years dates range - e.g. C2:C24 then C5:C55, etc..
 
Upvote 0
If you removed the bold section then #NUM means that there are no dates for the month specified in the selected range.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

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