+ Reply to Thread
Results 1 to 8 of 8

Weekday/Weekend Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel
    Posts
    36

    Weekday/Weekend Formula

    I have a formula that is based from certain parameters/criteria. The details have recently changed and I am having difficulty updating the formula to match the criteria.

    Current Criteria for below formula:
    If the request date is the same as the submitted date regardless of the day - Local is responsible
    Anything submitted after 4pm - Local is responsible
    Anything submitted before 8am - Local is responsible
    Anything submitted on Saturday - Local is responsible
    Anything submitted on Sunday between 8a-4pm - Mail is responsible
    Anything submitted between 8a-4pm Mon - Fri - Mail is responsible.

    Current Formula:
    =IF(F3068<>G3068,IF(AND(WEEKDAY(G3068)>1,WEEKDAY(G3068)<7),IF(AND(H3068>=8/24,H3068<=16/24),"Mail","Local"),"Local"),"Local")

    Current Criteria for above formula:
    If the request date is the same as the submitted date regardless of the day - Local is responsible
    Anything submitted after 4pm - Local is responsible
    Anything submitted before 8am - Local is responsible
    Anything submitted on Saturday - Local is responsible
    Anything submitted on Sunday between 8a-4pm - Mail is responsible
    Anything submitted between 8a-4pm Mon - Fri - Mail is responsible.

    Updated Criteria:
    Anything submitted between 8am-4pm, Monday - Friday - Mail is responsible
    All same day requests - Local is responsible
    Same day requests (request date and submitted date are the same) submitted before 8am - Local is responsible
    Same day requests (request date and submitted date are the same) submitted after 4pm - Local is responsible
    Requests submitted Friday after 4pm,for requests submitted for all day Friday, Saturday, Sunday and Monday of the following week - Local is responsible
    Anything submitted between 8am-4pm - Monday - Friday - Mail is responsible
    Anything submitted on Sunday between 8a-4pm - Mail is responsible

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Weekday/Weekend Formula

    Hi nmckever, Please confirm the following conclusions:
    Quote Originally Posted by nmckever View Post
    Updated Criteria:
    Anything submitted between 8am-4pm, Monday - Friday - Mail is responsible
    All same day requests - Local is responsible
    Same day requests (request date and submitted date are the same) submitted before 8am - Local is responsible
    Same day requests (request date and submitted date are the same) submitted after 4pm - Local is responsible

    Requests submitted Friday after 4pm,for requests submitted for all day Friday, Saturday, Sunday and Monday of the following week - Local is responsible
    Anything submitted between 8am-4pm - Monday - Friday - Mail is responsible
    Anything submitted on Sunday between 8a-4pm - Mail is responsible
    Reduces to : "All same day requests - Local is responsible"?
    Reduces to : "Anything NOT SAME DAY submitted between 8am-4pm, Sunday - Friday - Mail is responsible"?

    What does "request submitted for" mean EXACTLY.
    Also, what are your labels for columns F, G, and H. Difficult to fix anything if we don't know where the info is.

    Please attach a small sample workbook, your thread will get more responses. Thanks - Lee
    Last edited by leelnich; 05-19-2017 at 11:14 AM.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,767

    Re: Weekday/Weekend Formula

    Does this not resolve to:

    Anything submitted between 8am-4pm - Monday - Friday - Mail is responsible
    Anything submitted on Sunday between 8a-4pm - Mail is responsible

    Everything other than the above is LOCAL

    and what is in F and G?

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  4. #4
    Registered User
    Join Date
    01-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel
    Posts
    36

    Re: Weekday/Weekend Formula

    Yes those are basically the parameters. I have attached an example
    SCHV2.xlsx

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Weekday/Weekend Formula

    Paste this in I2 and copy down:
    =IF(AND([@[Request Date]]<>[@[Submitted Date]],[@[Submitted Time]]>=8/24,[@[Submitted Time]]<16/24,WEEKDAY([@[Submitted Date]],1)<>7),"Mail","Local")

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-19-2017 at 11:53 AM.

  6. #6
    Registered User
    Join Date
    01-02-2012
    Location
    Georgia
    MS-Off Ver
    Excel
    Posts
    36

    Re: Weekday/Weekend Formula

    Thank you. When I entered the formula the 3rd line item changed to Local when it should be Mail. on the weekend, Local is only responsible for dates requested for same day and the upcoming Friday, Saturday, Sunday and Monday. Any dates requested for future dates past Monday, Mail is responsible for.

    For example, Any request submitted after 4pm on 5/19/17 and the request date is 5/19, 5/20, 5/21, or 5/22 will be handled by Local. If the request is submitted on 5/19, 5/20, 5/21, or 5/22 and it has a request date of 5/23 and onward it will be Mail responsibility.

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Weekday/Weekend Formula

    If submitted after 4 pm on Sunday for NEXT Tuesday = "Mail", then this works:

    =IF([@[Request Date]]=[@[Submitted Date]],"Local",IF(AND([@[Submitted Time]]>=8/24,[@[Submitted Time]]<16/24,WEEKDAY([@[Submitted Date]],1)<>7),"Mail",IF(OR(AND(WEEKDAY([@[Submitted Date]])>2,WEEKDAY([@[Submitted Date]])<6),AND(WEEKDAY([@[Submitted Date]])=6,[@[Submitted Time]]<8/24)),"Local",IF(([@[Submitted Date]]+MOD(9-WEEKDAY([@[Submitted Date]]),7))<[@[Request Date]],"Mail","Local"))))

    If submit date = request date                                              LOCAL
    ElseIf submitted on Sunday-Friday after 8am and before 4pm                 MAIL
    ElseIf submitted on Friday after 4pm or Saturday, Sunday or Monday...
    ...AND request date is the following Tuesday or later                      MAIL
    Else                                                                       LOCAL
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-19-2017 at 10:54 PM.

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Weekday/Weekend Formula

    Ok, If submitted after 4 pm on Sunday for NEXT Tuesday = "Local", then try this: (or see next post for alternative.)

    =IF([@[Request Date]]=[@[Submitted Date]],"Local",IF(AND([@[Submitted Time]]>=8/24,[@[Submitted Time]]<16/24,WEEKDAY([@[Submitted Date]],1)<>7),"Mail",IF(AND(OR(WEEKDAY([@[Submitted Date]])=7,AND(WEEKDAY([@[Submitted Date]])=6,[@[Submitted Time]]>=16/24),AND(WEEKDAY([@[Submitted Date]])=1,[@[Submitted Time]]<8/24)),([@[Submitted Date]]+MOD(9-WEEKDAY([@[Submitted Date]]),7))<[@[Request Date]]),"Mail","Local")))

    If submit date = request date                                              LOCAL
    ElseIf submitted on Sunday-Friday after 8am and before 4pm                 MAIL
    ElseIf submitted on Friday after 4pm or Saturday or Sunday before 8am)...
    ...AND request date is the following Tuesday or later                      MAIL
    Else                                                                       LOCAL
    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-19-2017 at 10:54 PM.

+ 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] Convert date to weekday or weekend
    By RookA1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-15-2017, 01:09 PM
  2. [SOLVED] Have VBA Identify if it is a weekend or weekday
    By jdoerr1021 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2016, 06:37 PM
  3. [SOLVED] Weekday/Weekend count from table
    By Mechanical Pencil in forum Excel General
    Replies: 3
    Last Post: 02-13-2016, 02:20 PM
  4. errors on formula calculating price per weekday vs weekend
    By scott11106 in forum Excel General
    Replies: 5
    Last Post: 08-21-2015, 04:06 PM
  5. Average Last 7 Days by Weekday/Weekend
    By cleone1387 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-28-2014, 01:32 PM
  6. [SOLVED] Calculate Overtime Weekday different from Weekend
    By Lg101 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2014, 04:41 PM
  7. [SOLVED] help please to identify and display 'WEEKDAY' or 'WEEKEND'
    By vin1602 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2013, 06:30 AM

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