Finding nearest Friday formula

Nicole87

New Member
Joined
Feb 18, 2014
Messages
35
Hi,

I have an IF formula that looks to a particular date and brings back the nextFriday however I need to change it so that if the date is already a Friday that is keeps this date rather than taking the following friday.

The current formula I have is:

=IFERROR(IF(WEEKDAY([@[EXPECTED PAYMENT DATE]]) < 6, [@[EXPECTED PAYMENT DATE]] + (6- WEEKDAY([@[EXPECTED PAYMENT DATE]])), [@[EXPECTED PAYMENT DATE]] + 13 - WEEKDAY([@[EXPECTED PAYMENT DATE]])),0)

Thanks!
 
If I understand correctly what you want, maybe this formula can helps:

Code:
In EXPECTED PAYMENT DATE column

=IF([@[PAYMENT STATUS]]="PAID","PAID",
IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(Tab[@[PUB DATE  -6 DAYS]:[OTHER ADV DATE]]))+
6-MOD(IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(Tab[@[PUB DATE  -6 DAYS]:[OTHER ADV DATE]])),7))

Markmzz
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
The correction formula is not bring back the nearest Friday & the text suggestion below is no good as I need it to display to format as shown
 
Upvote 0
Thanks Markmzz but I dont think that is working? Can you write it out without the cell names for the pub date -6 to other adv date?
 
Upvote 0
Thanks Markmzz but I dont think that is working? Can you write it out without the cell names for the pub date -6 to other adv date?

Try this (sex is fri):

Layout

Advance typeAdvance type2PUBLICATION DATEPUB DATE -6 DAYSDELIVERY DATEOTHER ADV DATEDATE OVERRIDEEXPECTED PAYMENT DATE
Publication (PB)PUB01/jan/1526/dez/14sex 26/12/2014
Publication (PB)PUB01/jan/1526/dez/14sex 26/12/2014
Publication (HB)PUB02/abr/1527/mar/15sex 27/03/2015
Publication (HB)PUB03/jul/1427/jun/14sex 27/06/2014
DeliveryDELFALSO01/jun/15sex 05/06/2015
Publication (HB)PUB01/jun/1526/mai/15sex 29/05/2015
DeliveryDELFALSO30/jun/1427/jun/14sex 27/06/2014
Publication (HB)PUB05/mar/1527/fev/15sex 27/02/2015
DeliveryDEL31/mai/1430/mai/14sex 30/05/2014
SignatureSIGFALSO14/fev/14sex 14/02/2014
DeliveryDELFALSO31/mar/1428/mar/14sex 28/03/2014
Publication (HB)PUB01/jan/1526/dez/14sex 26/12/2014
Publication (MMP)PUB02/jul/1526/jun/15sex 26/06/2015
SignatureSIGFALSO14/fev/14sex 14/02/2014
DeliveryDELFALSO31/mar/16sex 01/04/2016
Publication (HB)PUB07/jan/1601/jan/16sex 01/01/2016
Publication (MMP)PUB07/jul/1601/jul/16sex 01/07/2016
SignatureSIGFALSO14/fev/14sex 14/02/2014
DeliveryDELFALSO31/mar/17sex 31/03/2017
Publication (HB)PUB05/jan/1730/dez/16sex 30/12/2016
Publication (MMP)PUB06/jul/1730/jun/17sex 30/06/2017

<tbody>
</tbody>


Formula

Code:
In EXPECTED PAYMENT DATE column (cell N9)

=IF([@[PAYMENT STATUS]]="PAID","PAID",
IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(Tab[@[PUB DATE  -6 DAYS]:[OTHER ADV DATE]]))+
6-MOD(IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(J9,K9,L9)),7))

Markmzz
 
Upvote 0
That is close...although it only works for dates entered in the date override column. The others are coming up with an error #NAME?
 
Upvote 0
That is close...although it only works for dates entered in the date override column. The others are coming up with an error #NAME?

Here all is ok.

Look at EXPECTED PAYMENT DATE column of the post #25 (this is your file with my formula).

Markmzz
 
Upvote 0
This is showing the expected payment dates as day 00-mnth-00 in all the cells still?

This is when you dont have "PAYED" and "@[DATE OVERRIDE]" is empty. this was my query before. In situation like this you are doing SUM of 3 cells. as in the sample there is nothing in those 3 cells. The format of the cell converts 0 to date format
 
Upvote 0

Forum statistics

Threads
1,215,155
Messages
6,123,332
Members
449,098
Latest member
thnirmitha

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