+ Reply to Thread
Results 1 to 6 of 6

WORKDAY using last non-blank date

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    WORKDAY using last non-blank date

    Hi all,

    I'm trying to run a workday formula to generate a list of dates by adding 1 workday onto the date before it which is easy enough...

    In C3: =WORKDAY(C2,1) and fill that down to generate the list of dates.


    What I want to do though is only apply that workday formula to rows where column B is equal to "Yes"

    If column B is blank, then leave the date blank, then when you come to the next row where B is "Yes", use the workday formula to add 1 day to the date of the last row where B was equal to "Yes"


    Hope that makes sense, and if it doesn't I've attached a sample workbook that might explain it better.

    Many thanks,

    Jason


    Expected results...


    ------B---------C---------D---------
    2----Yes----01/07/15--
    3----Yes----02/07/15--
    4-----------------------
    5----Yes----03/07/15--
    6-----------------------
    7-----------------------
    8----Yes----04/07/15
    Attached Files Attached Files

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: WORKDAY using last non-blank date

    =IF(B2="Yes",WORKDAY(C2,1),C2)
    Drag Down & Across..
    Cheers!
    Deep Dave

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: WORKDAY using last non-blank date

    Hi,

    Try the following formula in C3:

    =IF(B3="Yes",WORKDAY(LOOKUP(2,1/(C$2:C2<>""),C$2:C2),1),"")

    See the file attached!
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    Re: WORKDAY using last non-blank date

    Quote Originally Posted by cbatrody View Post
    Hi,

    Try the following formula in C3:

    =IF(B3="Yes",WORKDAY(LOOKUP(2,1/(C$2:C2<>""),C$2:C2),1),"")

    See the file attached!

    Thanks cbatrody. That does the job!

    Whilst the formula you provided generates the date based on the last non-blank cell, is there any way to make it so it looks up the date from the last "Yes"

    Reason I ask is that I'm planning on making it so where the value is false (B3<>"Yes") ,do another workday formula generating the date from the last date where column b is blank.

    i.e...


    ------B---------C---------D---------
    2----Yes----01/07/15--
    3----Yes----02/07/15--
    4-----------02/07/15--
    5----Yes----03/07/15--
    6-----------03/07/15--
    7-----------04/07/15--
    8----Yes----04/07/15

    So the formula in C3 then is somthing like this...

    IF B3 = Yes , WORKDAY FROM LAST ROW WHERE COLUMN B = YES , IF B3 <> Yes , WORKDAY FROM LAST ROW WHERE COLUMN B <> Yes

  5. #5
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: WORKDAY using last non-blank date

    5----Yes----03/07/15--
    6-----------03/07/15--
    7-----------04/07/15--
    8----Yes----04/07/15
    Why is row 7 incremented from 3/7 to 4/7 in this example? Shouldn't row 7 be 03/07/15?

  6. #6
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: WORKDAY using last non-blank date

    I have updated the revised formula as per your requirement in the attached file (Column D):

    In D3:

    =IF(B3="Yes",WORKDAY(LOOKUP(2,1/(B$2:B2="Yes"),D$2:D2),1),D2)
    Attached Files Attached Files

+ 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. Replies: 10
    Last Post: 02-29-2024, 08:55 AM
  2. [SOLVED] Start date must be next workday and non-holiday after previous task end date
    By Verdant in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-04-2015, 04:21 PM
  3. VBA to Calculate Start Date from End Date and Dev Time Using WORKDAY()
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2014, 05:06 PM
  4. [SOLVED] need help to lookup a (workday) date, and then excel output to show that date minus 1
    By Marijke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-23-2013, 11:13 AM
  5. Workday.INTL or Workday function issue
    By junoon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2013, 03:14 PM
  6. workday date function
    By sjayar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2005, 01:20 PM
  7. How can I test if a date is a workday?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-08-2005, 10:06 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