[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

25th of every month

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
pdvsa
Asked:
pdvsa
2 Solutions
 
Ryan ChongCommented:
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
 
Ryan ChongCommented:
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
 
Rgonzo1971Commented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
KoenCommented:
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
 
Rgonzo1971Commented:
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
 
Rob HensonIT & Database AssistantCommented:
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
 
pdvsaAuthor Commented:
Nice!  Sorry  for my tardy reply. I got a little sidetracked with my job. I don't like this job anymore
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now