Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

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

User generated image
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

try this:

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

Open in new window

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.
Avatar of Rgonzo1971
Rgonzo1971

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
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)
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

Nice!  Sorry  for my tardy reply. I got a little sidetracked with my job. I don't like this job anymore