+ Reply to Thread
Results 1 to 8 of 8

Conditional WORKDAY formula

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Conditional WORKDAY formula

    Hi,

    In the attached excel file, i want exact 1 day to be added to the date in cell C2 i.e. 24 hrs excluding the holidays mentioned in Sheet 1.

    However, the time i receive in the cell D2 is always 12:00 AM whereas I want it to be 6:00 PM. i.e. date should change but the time remains as in the cell C2.

    Can some one please guide with the correct formula.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Conditional WORKDAY formula

    One way:

    =IF((AND(A2="Incident",B2="High")),WORKDAY(C2,1,Sheet1!$B$3:$B$19)+MOD(C2,1),IF((AND(A2="Request",B2="High")),WORKDAY(C2,5,Sheet1!$B$3:$B$19)+MOD(C2,1)))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Conditional WORKDAY formula

    Try this:

    =IF((AND(A2="Incident",B2="High")),WORKDAY(C2,1,Sheet1!$B$3:$B$19)+MOD(C2,1),IF((AND(A2="Request",B2="High")),WORKDAY(C2,5,Sheet1!$B$3:$B$19)+MOD(C2,1)))
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Conditional WORKDAY formula

    Since B2 does not influence the outcome, you could also use:

    =SUM(IF(A2={"Incident","Request"},WORKDAY(C2,{1,5},Sheet1!$B$3:$B$19)+MOD(C2,1),0))
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: Conditional WORKDAY formula

    Hi Glenn Kennedy and AliGW,

    Thank you both for the speedy response.

    However, there's one minor issue.

    If the Creation Date (C3) is 02-Jan-2022 02:00 PM which falls on a weekend/holiday, the Deadline (D3) is 04-Jan-2022 02:00 PM. In such a scenario, the time provided is just 2 hours where in fact it should be 24 hours. Here, the working day should start from 04-Jan-2022 thereby giving the deadline as 05-Jan-2022 02:00 PM.

    Is there any way that excel doesn't consider the weekend/holiday as the initial day in this calculation. Also just to inform, the working hours are 12:00 PM to 09:00 PM.

    Thanks in advance.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Conditional WORKDAY formula

    Hi. You are introducing additional criteria. So, please take a moment to update your sheet to cover ALL possible sceanrios, complete with expected answers.

  7. #7
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: Conditional WORKDAY formula

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. You are introducing additional criteria. So, please take a moment to update your sheet to cover ALL possible sceanrios, complete with expected answers.

    Hi Glenn,

    Sorry for the earlier incomplete post.

    You will find the details in the attached excel file. The deadline is to be set based on the category/priority as given in the adjacent table.

    All is perfect if the creation date is a working day. However, if its a holiday, we are getting a problem with the deadline.

    Could you please help in this regard.

    Thank you.
    Attached Files Attached Files
    Last edited by rizwanulhasan; 01-02-2022 at 01:15 AM. Reason: Incorrect Attachment

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Conditional WORKDAY formula

    Please add sample dates and EXPECTED answers, as requested!!

+ 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. [SOLVED] IF WORKDAY Formula - where to add WORKDAY?
    By McCaughley7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-30-2019, 12:56 PM
  2. Conditional formatting use of WORKDAY
    By TRAZ6666 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2018, 08:24 AM
  3. [SOLVED] Workday and conditional formatting?
    By bhogbo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2013, 08:35 AM
  4. [SOLVED] WORKDAY function and conditional formatting
    By okyjelly in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-17-2013, 09:19 PM
  5. Workday formula on a Conditional Formatting
    By Kinna in forum Excel General
    Replies: 5
    Last Post: 05-29-2009, 03:02 PM
  6. Conditional format if not workday
    By ioncila in forum Excel General
    Replies: 4
    Last Post: 05-26-2009, 12:41 PM
  7. WORKDAY function and conditional formatting
    By alexander in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2005, 04:43 PM

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