Solved

25th of every month

Posted on 2016-10-04
7
68 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 50

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 50

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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