+ Reply to Thread
Results 1 to 25 of 25

Date Calculation + 5 / 20 working days depending on what is within a cell

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Date Calculation + 5 / 20 working days depending on what is within a cell

    Hi Guys,

    Looking for your help again.

    In column 5 I have a formula that calculates the 5 working day deadline based from the date inputted into column b.

    However I am now being asked to change this so that.

    Column F calculates from the date in Column B either 5 working day if column d states Stage 1 or 20 working day if Column D says Stage 2.

    Can anyone help?

    Thank you so much.

    Jodie
    Last edited by digbee; 01-07-2021 at 12:19 PM.

  2. #2
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: If Statement Help

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,801

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    It looks like you have been a member of the forum for 18 months or so, so you should know that thread titles are very important here - they should describe concisely what you are trying to achieve. Please amend yours to comply with the Forum Rule #1 (which you can see in the drop-down at the top of the page).

    Also, it helps if you attach a sample Excel workbook, and the yellow banner at the top of the screen describes how to do this.

    Hope this helps.

    Pete

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,801

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Thanks for changing the thread title.

    Did you see the second part of my post, about attaching a sample workbook?

    Pete

  5. #5
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Hi Pete, yes I did I am currently remove 'sensitive' information from the sheet prior to sharing.

  6. #6
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Please see attached sample spreadsheet,

    As previously explained, in Column F I need it to calculate either 5 working days or 20 working days depending on what Column D states
    Stage 1 - 5 working days from date received (column b)
    Stage 2 - 20 working day from date received (column b)

    any help will be greatly appreciated.

  7. #7
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Try this:

    =WORKDAY(B5,IF(D5="Stage 1",5,20),'Drop Down Lists'!$A$2:$A$5)

  8. #8
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Hi thank you for that, what I was looking for was column F to automatically populate 5 working days from the date in b5 if you select "Stage 1" and then if you took out stage 1 and lets say selected "Stage 2" it would calculate the date in Column F as 20 working days from the date in column b. I hope this makes sense.

    Thanks again.

  9. #9
    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,139

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    In f5, copied down;

    =IF(A5="","",WORKDAY(B5,IF(D5="Stage 1",5,20),'Drop Down Lists'!$A$2:$A$5))
    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

  10. #10
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Thanks Glenn just another query to throw in the mix as last night I was a little frazzled (again), I also want it to calculate 5 working days if enquiry, spso and complaint are selected?

    So e.,g

    Enquiry, SPSO, Complaint, Stage 1 - 5 working days
    Stage 2 - 20 working days

  11. #11
    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,139

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Just swap it round a bit:

    =IF(A5="","",WORKDAY(B5,IF(D5="Stage 2",20,5),'Drop Down Lists'!$A$2:$A$5))

    is this it??

  12. #12
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Superstar again, everything I learn from here I put in a wee notebook and the wealth of knowledge I have gained from this site is amazing.

    Thank you again.

    Jodie

  13. #13
    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,139

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It would also be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

  14. #14
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    What Glenn gave you is exactly what I gave you, just with a check for a blank cell added, so I wonder if you did actually try my suggestion???

  15. #15
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Apologies if I have upset you. I did try yours and copied and pasted but it did not work, I am not sure why probably my error. Again, not sure why you feel I would just ignore a suggestion as all the help I get on here is invaluable.

  16. #16
    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,139

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Ali, so it is! I, for one, didn't notice. I just assumed that whatever it was, it was wrong!!

  17. #17
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    So did the OP, evidently.

    Not a problem as such, just a query, as I am somewhat bemused at the rejection of it.

  18. #18
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Quote Originally Posted by digbee View Post
    Hi thank you for that, what I was looking for was column F to automatically populate 5 working days from the date in b5 if you select "Stage 1" and then if you took out stage 1 and lets say selected "Stage 2" it would calculate the date in Column F as 20 working days from the date in column b. I hope this makes sense.

    Thanks again.
    Yes, it made perfect sense. What was it about te way I presented my suggestion that made you think it hadn't?

  19. #19
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Sorry - I have just seen post #15! I was not looking for an apology (none needed), just an explanation. You see, all you did in your response was restate the requirement - you didn't say whether you'd tried it, what errors you were getting, nothing, so it felt as if you were dismissing it as not suitable. Thanks for clarifying.

  20. #20
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Hello, not sure if am breaching any rules reopening this, but management have come back to me to say they now want SPSO as 20 working days? I am not sure how to amend the formula provided by both of you to allow this to calculate?

    They are looking for Stage 2 and SPSO to be 20 working days and the remaining to be 5.


    =IF(A5="","",WORKDAY(B5,IF(D5="Stage 2",20,5),'Drop Down Lists'!$A$2:$A$5))

  21. #21
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    What is SPSO? This, maybe:

    =IF(A5="","",WORKDAY(B5,IF(OR(D5="Stage 2",D5="SPSO"),20,5),'Drop Down Lists'!$A$2:$A$5))
    Last edited by AliGW; 01-08-2021 at 11:01 AM.

  22. #22
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    apologies SPSO is another criteria they would like added to count 20 working days. I tried to add it in to the formula but it didn't like it. See below.

    =IF(A5="","",WORKDAY(B5,IF(D5="Stage 2", "SPSO",20,5),'Drop Down Lists'!$A$2:$A$5))

  23. #23
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    This:

    =IF(A5="","",WORKDAY(B5,IF(OR(D5="Stage 2",D5="SPSO"),20,5),'Drop Down Lists'!$A$2:$A$5))

  24. #24
    Registered User
    Join Date
    08-08-2019
    Location
    Scotland
    MS-Off Ver
    2019
    Posts
    51

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Thanks very much. that worked a treat!

  25. #25
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: Date Calculation + 5 / 20 working days depending on what is within a cell

    Thanks for the rep.

+ 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 Statement with Multi-Criteria Statement inside a Data Validation List
    By dharvey1978 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2020, 09:10 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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