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!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try this:

Excel 2012
AB
128/03/201428/03/2014
Sheet1
Cell Formulas
RangeFormula
B1=IFERROR(IF(WEEKDAY(A1,15)=1,A1,A1+(8-WEEKDAY(A1,15))),0)
 
Last edited:
Upvote 0
actually there is even shorter formula:


Excel 2012
ABC
101/03/201407/03/201407/03/2014
Sheet1
Cell Formulas
RangeFormula
B1=IFERROR(IF(WEEKDAY(A1,15)=1,A1,A1+(8-WEEKDAY(A1,15))),0)
C1=IFERROR(A1+(7-WEEKDAY(A1,16)),0)
 
Upvote 0
Do you need two extra cells for the second one though? I need to keep it to one cell

I think the first one works..
 
Last edited:
Upvote 0
no you dont need second cell

this are 2 different formulas which gives the same result, but the second formula is shorter and dont need IF statement.
 
Upvote 0
Ah ok I c.

Can you combine these two formulas into a shorter one by any chance?

=IF([@[PAYMENT STATUS]]="PAID","PAID",IF(LEN([@[DATE OVERRIDE]])>0,[@[DATE OVERRIDE]],SUM(AT97,AS97,AU97))) - looks at 3 different cells and picks up the first three unless there is a date in the fourth (date override)

&

The formulas you provided above to bring it to the nearest Friday?

Many Thanks,
Nicole
 
Upvote 0
1* I don't think that your formula can be changed to be shorter

2* Yes it brings nearest Friday

Rich (BB code):
Rich (BB code):
=WEEKDAY(A1,16)
=IFERROR(A1+(7-WEEKDAY(A1,16)),0)

option 16 in WEEKDAY makes week Saturday (1) - Friday (7) so if you have currently Fryday it will take todays day then + (7 - weekday of friday (7)) = 0 so it stays in same day. if today is saturday then it is Today + 6 days (7-1) and so on
 
Upvote 0
instead of what?

something like this?
Code:
IF([@[PAYMENT STATUS]]="PAID","PAID",IF(LEN(IFERROR(A1+(7-WEEKDAY(A1,16)),0))>0,IFERROR(A1+(7-WEEKDAY(A1,16)),0),SUM(AT97,AS97,AU97)))
 
Upvote 0
That doesnt seem to work. So I want to use the formula below and add in the rule to make the result the nearest Friday:

=IF([@[PAYMENT STATUS]]="PAID","PAID",IF(LEN([@[DATE OVERRIDE]])>0,[@[DATE OVERRIDE]],SUM(AT97,AS97,AU97))



 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,465
Members
448,965
Latest member
grijken

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