+ Reply to Thread
Results 1 to 10 of 10

Combining an IF function with a WORKDAY function

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2016
    Location
    East of England
    MS-Off Ver
    office 365
    Posts
    7

    Combining an IF function with a WORKDAY function

    Hi Everyone,

    I currently have a working formula: =IF(E4="P7",D4+10,IF(E4="P6",D4+15,IF(E4="P5",D4+20,IF(E4="P4",D4+25))))
    Where Col D = start date, Col E= Category(relates to how many days the work will take)
    and a completion date is generated in Col F. However, the completion date falls short because it does not exclude weekends, I would like to insert the Workday function into the formula to increase the accuracy, but all my attempts so far have only resulted in Err messages, is it possible to combine the Workday function with the formula in its current form? Or do i need to go back to the drawing board?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698

    Re: Combining an IF function with a WORKDAY function

    So if E4="P7" do you want to add 10 workdays to the date.....or just add 10 days and then move to next workday if a weekend results?

    For the former...

    =WORKDAY(D4,IF(E4="P7",10,IF(E4="P6",15,IF(E4="P5",20,IF(E4="P4",25)))))

    or the latter

    =WORKDAY(D4+IF(E4="P7",10,IF(E4="P6",15,IF(E4="P5",20,IF(E4="P4",25))))-1,1)
    Last edited by daddylonglegs; 11-27-2017 at 08:29 PM.
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-27-2016
    Location
    East of England
    MS-Off Ver
    office 365
    Posts
    7

    Re: Combining an IF function with a WORKDAY function

    Hi,
    Thanks for the quick reply. Yes, if E4 = "P7" then the work would take 10 workdays from the date entered in Col D. I have attempted to use:=WORKDAY(D4,IF(E4="P7,10,IF(E4="P6",15,IF(E4="P5",20,IF(E4="P4",25))))) but it is still returning an Err message.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,698

    Re: Combining an IF function with a WORKDAY function

    Sorry, I missed a quote around P7 - try this corrected version

    =WORKDAY(D4,IF(E4="P7",10,IF(E4="P6",15,IF(E4="P5",20,IF(E4="P4",25)))))

    format result cell in required date format. Note that WORKDAY doesn't count the first day, so if you want to include D4 in the 10 workdays then change D4 to D4-1

  5. #5
    Registered User
    Join Date
    11-27-2016
    Location
    East of England
    MS-Off Ver
    office 365
    Posts
    7

    Re: Combining an IF function with a WORKDAY function

    That worked like a charm, thanks ever so much, especially for the D4-1, i had not even considered this!

  6. #6
    Registered User
    Join Date
    07-07-2018
    Location
    London, England
    MS-Off Ver
    Google Sheets
    Posts
    2

    Re: Combining an IF function with a WORKDAY function

    Hi there, I hope no one minds me reactivating this thread!

    I'm currently using the below formula to build a simple Gantt chart in Sheets, which ultimately places an x along my timeline based on the start date, duration (in days), and predicted end date of a task within a project:

    =if(and(K$5>=$E6,K$5<=$I6),"x","")

    From this, I then use conditional formatting to fill the boxes marked with x, which creates a simple bar chart. In this formula, K is the date along the top of my table (January 1st, January 2nd, and so on) and I is the estimated end date of that specific task.

    This is working great for me, but ideally I'd like it to exclude weekends and move to the next working day if at all possible. Could anybody kindly help? Thank you in advance!

  7. #7
    Registered User
    Join Date
    10-22-2020
    Location
    Komlo, Hungary
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Re: Combining an IF function with a WORKDAY function

    Hi there,
    I have a similar problem, did you find a solution? Did you post a new thread?
    thanks,

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,480

    Re: Combining an IF function with a WORKDAY function

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    10-22-2020
    Location
    Komlo, Hungary
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    10

    Re: Combining an IF function with a WORKDAY function

    Hi there,
    I have a challenge here. I need to create a table where different deparments can see if they have something to do
    I have the following function

    =IF(F$1-$B2<=0;"";IF(F$1-$B2=1;"P1";IF(F$1-$B2=2;"P2";IF(F$1-$B2=3;"sz";IF(F$1-$B2=4;"L";IF(F$1-$B2>4;IF(F$1-$B2<10;"T";"");""))))))

    Is anyone have an idea how to make this work using only workdays?

    B2-> =today()
    F1-> arrival date

    Many thanks,

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Combining an IF function with a WORKDAY function

    Quote Originally Posted by vegendas View Post
    Hi there,
    I have a challenge here. I need to create a table where different deparments can see if they have something to do
    I have the following function

    =IF(F$1-$B2<=0;"";IF(F$1-$B2=1;"P1";IF(F$1-$B2=2;"P2";IF(F$1-$B2=3;"sz";IF(F$1-$B2=4;"L";IF(F$1-$B2>4;IF(F$1-$B2<10;"T";"");""))))))

    Is anyone have an idea how to make this work using only workdays?

    B2-> =today()
    F1-> arrival date

    Many thanks,
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Combining an IF function and WORKDAY function
    By rider2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2017, 10:32 PM
  2. Nested IF Function with WORKDAY function
    By marielouise1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2014, 03:00 PM
  3. Workday.INTL or Workday function issue
    By junoon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2013, 03:14 PM
  4. Workday function
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-31-2011, 09:56 AM
  5. WORKDAY function
    By gn!uz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-07-2007, 08:25 AM
  6. [SOLVED] Workday function
    By RUSH2CROCHET in forum Excel General
    Replies: 4
    Last Post: 05-17-2006, 02:40 PM
  7. [SOLVED] Excel Workday Function with another function
    By Monique in forum Excel General
    Replies: 2
    Last Post: 04-27-2006, 08:15 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1