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 there is nothing in Date Override & no PAID, then there will always be one date in either the Pub date-6days, Delivery date or other adv date
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Nicole,

Until now I can't figure out when it is supposed to be the payment day. I just noticed it must be in the closest Friday... But closest to what?

I created a scenario like this:

Publishing date Expected payment date Closest Friday
(15 days after publishing)
01-05-2014 16-05-2014 16-05-2014 (because it will be a Friday)
18-02-2014 05-03-2014 (it's a Tuesday) 07-03-2014 (the very next Friday)
25-04-2014 10-05-2014 (it's a Saturday) 16-05-2014 (it will be the next Friday)

Is this ok for you?

Vândalo
 
Upvote 0
Hi Nicole,

Until now I can't figure out when it is supposed to be the payment day. I just noticed it must be in the closest Friday... But closest to what?

I created a scenario like this:

Publishing date Expected payment date Closest Friday
(15 days after publishing)
01-05-2014 16-05-2014 16-05-2014 (because it will be a Friday)
18-02-2014 05-03-2014 (it's a Tuesday) 07-03-2014 (the very next Friday)
25-04-2014 10-05-2014 (it's a Saturday) 16-05-2014 (it will be the next Friday)

Is this ok for you?

Vândalo

It needs to be:

- If the date is already on a friday then it needs to stay on this date
- If it is not a friday then take it to the next available friday

Many Thanks.
 
Upvote 0
Nicole,

Let me know if I understood you.
If publishing date it's already a Friday, it will be the payment day, if not then calculate the next Friday. Is it?

Vândalo
 
Upvote 0
Please try this.

=IF(WEEKDAY(AG76;16)=7;AG76;AG76+(7-WEEKDAY(AG76;16)))

where AG76 it's the publishing date

The formula will evaluate if the weekday of publishing date it's a Friday. If so it will be the payment day, otherwise will look for the next Friday.

Hope this helps.

Vândalo
 
Upvote 0
Please try this.

=IF(WEEKDAY(AG76;16)=7;AG76;AG76+(7-WEEKDAY(AG76;16)))

where AG76 it's the publishing date

The formula will evaluate if the weekday of publishing date it's a Friday. If so it will be the payment day, otherwise will look for the next Friday.

Hope this helps.

Vândalo

That doesnt include the rest of the formula that still needs to be included...
 
Upvote 0
Hi again,

I'm following your post from the beggining in order to understand your question.
I notice when your payment status = "Paid", the payment day should present "Paid" in it. Right so far? Good! Otherwise, if date override has something in it it should be the value for paymente day field. Still right? If so, what is the criteria for date override?

Vândalo
 
Upvote 0
Here all is ok.

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

Markmzz

Hi Nicole87,

I'm sorry, my mistake. Try this:

Code:
=IF([@[PAYMENT STATUS]]="PAID","PAID",
IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],[COLOR=#0000ff]SUM(J9,K9,L9)[/COLOR])+
6-MOD(IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(J9,K9,L9)),7))

Markmzz
 
Last edited:
Upvote 0
Hi Nicole87,

I'm sorry, my mistake. Try this:

Code:
=IF([@[PAYMENT STATUS]]="PAID","PAID",
IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],[COLOR=#0000ff]SUM(J9,K9,L9)[/COLOR])+
6-MOD(IF([@[DATE OVERRIDE]]<>"",[@[DATE OVERRIDE]],SUM(J9,K9,L9)),7))

Markmzz

Excellent - that works thankyou!!

Wondering whether it is possible to add in a criteria at the start so that along with if = PAID, PAID to also have if = DO NOT PAY, DO NOT PAY & if = DUE,"DUE"?
 
Upvote 0

Forum statistics

Threads
1,215,179
Messages
6,123,495
Members
449,100
Latest member
sktz

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