Solved

Workday (use preceeding workday)

Posted on 2014-11-07
6
127 Views
Last Modified: 2014-11-07
Hello,

What do I need to change in the below to return the workday before and not the next workday?  I could need 2 days before and not only 1 day.  I dont know if it's as simple as changing a sign on the -1 and if you want 2 days before then change the 1 to a 2.

Here is the formula with an explanation from another expert (Barry Houdini)
=WORKDAY(EDATE(I34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))-1,1)

<When the original formula gives you a weekend date that will jump to the next working day

Thank you.
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40428258
=WORKDAY(EDATE(I34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))+1,-1)
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40428267
Hi,

it should be

=WORKDAY(EDATE(I34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))-1,-1)

Regards
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40428270
Rgonzo, that will change a Friday to a Wednesday. My code will keep a Friday to a Friday.

I'm assuming you want Sunday -> Friday, Saturday ->Friday, Friday ->Friday, Thursday->Thurday.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:pdvsa
ID: 40428312
Philip, yes.  And what if it's 2 days before?  Please bold what is edited
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40428319
Depends on what you mean.

If it's two working days before:

=WORKDAY(EDATE(I34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))+0,-2)

This results in:

Mon      Thu
Tue      Fri
Wed      Mon
Thu      Tue
Fri      Wed
Sat      Thu
Sun      Thu

If it's two calendar days before, and then the previous working day, then

=WORKDAY(EDATE(I34,CHOOSE(MATCH(D35,{"annually","quarterly","semi-annually","monthly"},0),12,3,6,1))-1,-1)

This results in:
Mon      Fri
Tue      Fri
Wed      Mon
Thu      Tue
Fri      Wed
Sat      Thu
Sun      Fri
0
 

Author Closing Comment

by:pdvsa
ID: 40428451
thank you once again....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question