Formula needed please

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
Hi

Can I please trouble someone for some help with a formula.

With a date in A1 I would like the next date in A2 to show the next 28th of the month providing it is a weekday. If it is a weekend then show the previous Friday.

So with A1 containing 2nd January 2017 A2 would now show Friday 27/1/17.

Just to clarify I would the formula to always show a Friday if the 28th falls on a weekend.

Many thanks for any help that you can provide
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
maybe:

=IF(WEEKDAY(DATE(YEAR(A1),MONTH(A1),DAY(28)),2)>5,WORKDAY(DATE(YEAR(A1),MONTH(A1),DAY(28)),-1),DATE(YEAR(A1),MONTH(A1),DAY(28)))
 
Upvote 0
Try this:
Code:
=IF(WEEKDAY(DATE(YEAR(A1),MONTH(A1),28),3)>4,DATE(YEAR(A1),MONTH(A1),28)-(WEEKDAY(DATE(YEAR(A1),MONTH(A1),28),3)-4),DATE(YEAR(A1),MONTH(A1),28))
 
Upvote 0
Hi Barry & Joe

Many thanks for showing an interest in my problem.

Not sure if I'm doing something wrong or I didn't explain the question properly.

With a date in A1 the formula does produce the correct answer in A2 but if I want to extend the list on it only repeats the value in A2.

So with 2/1/17 in A1, 27/1/17 is the correct answer in A2 but that is repeated onwards when I would like the 28th of February, March etc. or whatever the correct date for the 28th is.

My apologies for not making this clear.
 
Upvote 0
Where are you extending this (what cell addresses)?
How are out are you going?
 
Upvote 0
Tetra

With a slight tweek your formula works fine - changed the first -1 to 0 after putting in the first correct date manually and then I can copy it down as far as I need and get the correct dates. Thank you, much appreciated.

Joe & Barry my sincere thanks for taking an interest. Sorry that I didn't make it clear exactly what I wanted.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

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