Solved

25th of every month

Posted on 2016-10-04
7
61 Views
Last Modified: 2016-10-06
Experts,

How can I show the 25th of the month based on the current date and if the 25 of the month has passed then use the next month?  

ie:
today = Oct 5
result:  Oct 25

if today = Oct 26 then
result = Nov 25th

==>but if it falls on a Friday or Saturday then use the preceding.

thank you

example
0
Comment
Question by:pdvsa
7 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41829232
try this:

=IF(DAY(TODAY()) <= 25, TEXT(TODAY(), "MMM DD"), TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())+1, 25), "MMM DD"))

Open in new window

0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41829234
you can also use this if you want to return a date value instead.

=IF(DAY(TODAY()) <= 25, DATE(YEAR(TODAY()),MONTH(TODAY()), 25), DATE(YEAR(TODAY()),MONTH(TODAY())+1, 25))

Open in new window


use the Number Format to format the date value accordingly.
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41829310
Hi,

pls try

=EOMONTH(DATE(YEAR(A1),MONTH(A1),DAY(A1)-25),0)+25-WEEKDAY(EOMONTH(DATE(YEAR(A1),MONTH(A1),DAY(A1)-25),0)+25)+MIN(5,WEEKDAY(EOMONTH(DATE(YEAR(A1),MONTH(A1),DAY(A1)-25),0)+25))

Open in new window

Regards
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:Koen
ID: 41829410
try this :

=WORKDAY(IF(DAY(TODAY())<=25;DATE(YEAR(TODAY());MONTH(TODAY());25);DATE(IF(MONTH(TODAY())<12;YEAR(TODAY());YEAR(TODAY())+1);IF(MONTH(TODAY())<12;MONTH(TODAY())+1;1);25));0)

(you might need to replace ; with , depending on your regional settings)
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 250 total points
ID: 41829443
Hi,

pls try (shorter)
=WORKDAY.INTL(EOMONTH(DATE(YEAR(A1),MONTH(A1),DAY(A1)-25),0)+26,-1,7)

Open in new window

Regards
2
 
LVL 32

Assisted Solution

by:Rob Henson
Rob Henson earned 250 total points
ID: 41829573
RGonzo - excellent solution as always!!

Stating the obvious, so no points for this, - to convert to using today rather than fixed cell:

=WORKDAY.INTL(EOMONTH(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())-25),0)+26,-1,7)

Also assumes, Excel 2010 or later. A previous question from pdvsa quoted Excel 2016 so I don't think that will be a problem.
0
 

Author Closing Comment

by:pdvsa
ID: 41831823
Nice!  Sorry  for my tardy reply. I got a little sidetracked with my job. I don't like this job anymore
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now