Return latest date for year

thanksamillion101

New Member
Joined
Jul 8, 2020
Messages
41
Office Version
  1. 2010
Hello and thank you in advance! I have a formula to return the latest date for each month, however it will not work for returning the latest date for a certain year. The information is pulled from Sheet 2 into Sheet 1. Please help


I added month name abbrev in column T and could also add a column U to specify the year, but would rather use a formula to determine the latest date for specific months and year using only column S dates. Hope I explained correctly.


The formula I have currently will work for 2019 but not 2020 or 2021.

IF($A2="","",IFERROR(1/(1/MAX(IF(($P:$P=$A2)*($Q:$Q=$B2)*($T:$T=D$1)*($R:$R=$O$2),$S:$S,""))),"")) Returns latest date for the month

IF($A2="","",IFERROR(1/(1/(IF((P:P=$A2)*(R:R=$O$2)*(Q:Q=$B2),MAX((YEAR(S:S)=$K$1)*S:S)))),"Err")) Returns latest date for the year (only works for 2019)




NameStateJanFebMarAprMayJun201920202021Sheet 2CustomerCoSourceDatesMonth
RedT2/3/215/2/205/22/19ErrErr0101-ARedT0101-A
5/22/2019​
May
BlueV3/1/21GreenC0101-A
6/1/2021​
Jun
RedT2/3/215/2/20BlueV0101-A
3/1/2021​
Mar
RedT2/3/215/2/20RedT0101-A
5/2/2020​
May
GreenC6/1/21RedT0101-A
2/3/2021​
Feb
A BC D E F G H IJ K L MN O PQ R S T
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
ABCDEFGHIJKLMNOPQRST
1NameStateJanFebMarAprMayJun201920202021Sheet2CustomerCoSourceDatesMonth
2RedT2/3/215/2/205/22/19Err0101-ARedT0101-A
5/22/2019​
May
3BlueV3/1/21GreenC0101-A
6/1/2021​
Jun
4RedT2/3/215/2/20BlueV0101-A
3/1/2021​
Mar
5RedT2/3/215/2/20RedT0101-A
5/2/2020​
May
6GreenC6/1/21RedT0101-A
2/3/2021​
Feb
 
Upvote 0

Forum statistics

Threads
1,215,232
Messages
6,123,759
Members
449,120
Latest member
Aa2

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