+ Reply to Thread
Results 1 to 6 of 6

Edit date formula

  1. #1
    Registered User
    Join Date
    06-13-2017
    Location
    essex, england
    MS-Off Ver
    2013
    Posts
    11

    Edit date formula

    I am looking for some help with editing a long winded formula. I have attached a worksheet with the formula on so it can be viewed.

    The idea is that a date is entered in Column I, and column AA shows the date +28days. When a date is added in Q or V the clock stops until a date is added in S or X. The number of days is added to AA.

    The problem I have is if the date in S/X is less than 7 days before the date in AA, 7 days from S/X needs to be displayed in AA.

    The formula also references AG, but I can't work it out of the formula.

    Any help would be greatly appreciated my sleepless nights!!!!

    Edit - There is a 28 day period. Within the first 21 days entering dates in q/s & v/x don't affect AA. If the dates entered in s/x are day 22 onwards, then 7 days needs to be added from the date in s/x.

    The dates in q/s & v/x show that papers are being edited so "stopping the clock" until returned.

    It currently looks like the below but I think it is more complicated than it needs to be.

    =IF(I1=0, " ",IF(IF(OR(S1<Q1,X1<V1),"Yes",IF(((I1+28)+(S1-Q1)+(X1-V1))-X1+AG1<7,X1+7,(IF((I1+28)+(S1-Q1)-S1+AG1<7,S1+7,(I1+28)+(S1-Q1)+(X1-V1)+AG1))))=28,TODAY(),IF(OR(S1<Q1,X1<V1),"Yes",IF(((I1+28)+(S1-Q1)+(X1-V1))-X1+AG1<7,X1+7,(IF((I1+28)+(S1-Q1)-S1+AG1<7,S1+7,(I1+28)+(S1-Q1)+(X1-V1)+AG1))))))
    Attached Files Attached Files
    Last edited by dlee70; 06-13-2017 at 03:03 PM.

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Edit date formula

    Welcome to the forum.

    I'm sorry, but I don't quite follow the logic you need.
    AA is I + 28. That's fine.
    A date is added in either Q or V and 'the clock stops' - what do you mean by that?
    If a date is added in R or T, 'The number of days is added to AA' - what 'number of days'? The number of days between I and Q, I and R, Q and R, something else? Or the number of days between I+28 and Q or V or R or T? What happens if there's a date in both Q and V or R and T, but they're different?
    Not only does AG appear in the formula, but there's a V128 in there as well, and TODAY(). Plus 'Yes' appears to be one of the possible answers from the various IF statements. Where do these all fit in?

    Can you try to explain again what it is you want?
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    06-13-2017
    Location
    essex, england
    MS-Off Ver
    2013
    Posts
    11

    Re: Edit date formula

    Edited. Any help appreciated

  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 2406
    Posts
    44,662

    Re: Edit date formula

    Try this out:
    =IF(OR(S2+7>=I2+28+IF(S2="",0,(S2-Q2))+IF(X2="",0,(X2-V2)),X2+7>=I2+28+IF(S2="",0,(S2-Q2))+IF(X2="",0,(X2-V2))),MAX(S2,X2)+7,I2+28+IF(S2="",0,(S2-Q2))+IF(X2="",0,(X2-V2)))

    I tghink it meets all your criteria...
    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

  5. #5
    Registered User
    Join Date
    06-13-2017
    Location
    essex, england
    MS-Off Ver
    2013
    Posts
    11

    Re: Edit date formula

    Thank you. However if the dates entered in S and X are within 21 days of I, then AA needs to stay at I+28. If the dates entered are 22 days onwards, then AA needs to be S+7 or x+7. The date in x will always be later than s.

  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 2406
    Posts
    44,662

    Re: Edit date formula

    Isn't that what it does???

    1) 28 days + stoppage times (maximum 2 occasaions)

    2) If any restart time is <=7 days away from 1), then it returns 1) PLUS 7.

    If that is not what you want, you need to supply more expected results from selected inputs.

+ 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] VBA to stop worksheet after a date (need edit help)
    By richard11153 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-03-2016, 08:59 PM
  2. [SOLVED] Edit of IF formula to only show one date rather than two
    By jonathan.haynes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2013, 10:41 AM
  3. Header Macro - Last Edit Date
    By bentleybob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2011, 06:17 PM
  4. Edit data for a given date
    By wish2excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2010, 03:36 AM
  5. filter/edit time and date
    By Gerryduda in forum Excel General
    Replies: 5
    Last Post: 09-25-2010, 10:17 PM
  6. Append date of last edit to cell
    By chk_tbennett in forum Excel General
    Replies: 5
    Last Post: 11-24-2008, 06:27 PM
  7. Last edit date of a range of cells?
    By Atmogon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-25-2008, 12:57 PM

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