Pick the last date of the month

tanvirabid3

New Member
Joined
Oct 15, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,
I have the daily dates for all the months of 2021. The catch is that for some months the last date is the EMONTH date like Jan 31. But for some months the last date is March 27, April 28, June 26 and so on. I want to pick the last available date for every month from Jan to Dec. Is there a way that this can be done. Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi everyone,
I have the daily dates for all the months of 2021. The catch is that for some months the last date is the EMONTH date like Jan 31. But for some months the last date is March 27, April 28, June 26 and so on. I want to pick the last available date for every month from Jan to Dec. Is there a way that this can be done. Thanks
Below function

Book1
AB
105-01-2131-Jan-21
Sheet1
Cell Formulas
RangeFormula
B1B1=EOMONTH(A1,0)
 
Upvote 0
Below function

Book1
AB
105-01-2131-Jan-21
Sheet1
Cell Formulas
RangeFormula
B1B1=EOMONTH(A1,0)

Hi there, this is the just the general formula. Let me clarify please. I want to pick the latest date in a month from the given dates. Like in Feb, the latest date is Feb 25. In March it is March 26. I want to find the last dates for every month that are in the list. Please assist.
 
Upvote 0
e.g. 11.02.2021

=EOMONTH(A1;0) >>>> 28.02.2021
=EOMONTH(A1;1) >>>> 31.03.2021
=EOMONTH(A1;2) >>>> 30.04.2021
 
Upvote 0
Upvote 0
try Maxifs

Maxif.xlsm
ABC
11-Jan-21Jan-219-Jan-21
26-Jan-21Feb-218-Feb-21
37-Jan-21Mar-213-Mar-21
48-Jan-21Apr-2128-Apr-21
59-Jan-21
61-Feb-21
78-Feb-21
83-Mar-21
94-Apr-21
1022-Apr-21
1128-Apr-21
1a
Cell Formulas
RangeFormula
C1:C4C1=MAXIFS($A$1:$A$11,$A$1:$A$11,">="&B1,$A$1:$A$11,"<="&EOMONTH(B1,0))
 
Upvote 0
try Maxifs

Maxif.xlsm
ABC
11-Jan-21Jan-219-Jan-21
26-Jan-21Feb-218-Feb-21
37-Jan-21Mar-213-Mar-21
48-Jan-21Apr-2128-Apr-21
59-Jan-21
61-Feb-21
78-Feb-21
83-Mar-21
94-Apr-21
1022-Apr-21
1128-Apr-21
1a
Cell Formulas
RangeFormula
C1:C4C1=MAXIFS($A$1:$A$11,$A$1:$A$11,">="&B1,$A$1:$A$11,"<="&EOMONTH(B1,0))

Hi Dave, thanks. What are the formulas for column B. I mean B1, B2, B3 and B4.
 
Upvote 0
Could this be what you are after?

22 01 13.xlsm
ABC
101-Jan-2109-Jan-21
206-Jan-2108-Feb-21
307-Jan-2131-Mar-21
408-Jan-2128-Apr-21
509-Jan-21 
601-Feb-2106-Jun-21
708-Feb-21 
804-Apr-2114-Aug-21
922-Apr-21 
1028-Apr-21 
1106-Jun-21 
1202-Jun-2115-Dec-21
1315-Dec-21
1412-Dec-21
1514-Aug-21
1631-Mar-21
1701-Mar-21
18
Last in month
Cell Formulas
RangeFormula
C1:C12C1=IFERROR(MAX(FILTER(A1:A100,MONTH(A1:A100)=ROWS(C$1:C1))),"")
 
Upvote 0
Hi everyone, I think I haven't been able to explain my issue clearly. The following is the image:

Column A
For Dec 2017, the last day is 12/31/2017
For Jan 2018, the last day is 1/31/2018
For Feb 2018, the last day is 2/25/2018
For Mar 2018, the last day is 3/26/2018
For April 2018, the last day is 4/29/2018

The desire is that in Column B
For Dec 2017 all dates, the last day i.e. 12/31/2017 should show.
For Jan 2018 all dates, the last day i.e. 1/31/2018 should show.
For Feb 2018 all dates, the last day i.e. 2/25/2018 should show.
For Mar 2018 all dates, the last day i.e. 3/26/2018 should show.
For April 2018 all dates, the last day i.e. 4/29/2018 should show.

Thanks everyone for your help so far.
 

Attachments

  • Mr. Excel help.png
    Mr. Excel help.png
    13.5 KB · Views: 6
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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