+ Reply to Thread
Results 1 to 10 of 10

Returning a value based on business days issue

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    Saint Louis
    MS-Off Ver
    Excel 2007
    Posts
    5

    Returning a value based on business days issue

    Hi,

    I am attempting to create a formula that will allow me to come back with a value if a cell is a business day with respect to the day the formula is run.

    So for example,

    A1 through A200 have dates

    I want to create a function that states something to the effect of:

    If A1 equals today and is a business day then "value that I choose"
    If A1 equals today minus 1, then "value that I choose"
    If A1 equals today minus 2, then "value that choose"

    At all times the value of the day minus any number can only be Monday through Friday. Weekends and holidays should be excluded.

    Further clarification, if today was a Monday then by stating A1 equals today minus 1, should designate the previous Friday, not Sunday.

    If this was just a simple formula that did not take into consideration only business days, then I would be set, but I do not know how to only use business days for this type of scenario.

    Thanks for any help.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning a value based on business days issue

    Your post is very confusing!

    Sounds like you need to check out the WORKDAY function.

    For example...

    A1 = 4/15/2014

    =WORKDAY(A1,-1)

    Formatted as Date returns 4/11/2014 (Friday's date)

    You can even exclude holiday dates that you designate.

    J1:J10 = list of holiday dates to be excluded from the calculation.

    =WORKDAY(A1,-1,J1:J10)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-15-2014
    Location
    Saint Louis
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Returning a value based on business days issue

    Let me see if I can clarify a bit.

    Column A has dates. Let's just say all dates are 4/15, 4/14, or 4/11 (Therefore no dates will ever fall on a weekend in column A)

    I want to create a function that allows me to come back with a value based on the date in column A with respect to the day I run the formula.

    So column A has a date of 4/15 I need it to come back with the word "Blue"
    If column A has a date of 4/14 I need it to come back with the word "Red"
    If column A has a date of 4/11/14 I need it to come back with the word "Green"

    I want to be able to do this on a day to day basis where column A will always only include weekdays with no weekend.

    Hope that makes it a little more clear on what I am trying to do. Sorry if I am not as clear since my knowledge of excel is still growing.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning a value based on business days issue

    Sorry, I don't understand.

  5. #5
    Registered User
    Join Date
    01-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Returning a value based on business days issue

    See if this will work. the basic idea is to determine the starting position and then calculate the number of workdays from that starting position. That number can be used with in index to generate your dynamic values.


    DynamicBizDayIssue.xlsx

  6. #6
    Registered User
    Join Date
    04-15-2014
    Location
    Saint Louis
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Returning a value based on business days issue

    See the worksheet I attached to get a better idea of what I am trying to accomplish.

    Column B contains the formula I want to manipulate. Red is a description of what I am having trouble with in column C.
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning a value based on business days issue

    Can you explain the logic of what the "Due for number" means?

  8. #8
    Registered User
    Join Date
    04-15-2014
    Location
    Saint Louis
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Returning a value based on business days issue

    It's just a value I am using based on the days from the current day. Due for 3 would be the current date. Due for 2 would be the previous day. Due for 1 would be associated with 2 days prior to the current date. The issue is getting the "Due for number" to correlate to a business day sequence and not a full week sequence. That is why Due for 1 in my example is the issue. I am trying to correlate Due for 1 to 4/11/14. I want to be able to apply the solution to any day of the week for any number of days in column A.

  9. #9
    Registered User
    Join Date
    04-15-2014
    Location
    Saint Louis
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Returning a value based on business days issue

    I think I just figured it out after messing around myself.

    This is what is working for me now:

    =IF(WORKDAY(TODAY(),0,)=A2,"Due for 3",IF(WORKDAY(TODAY(),-1,)=A2,"Due for 2",IF(WORKDAY(TODAY(),-2,)=A2,"Due for 1")))

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Returning a value based on business days issue

    Good deal. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Adding business days to a business day formula
    By snappytim in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-29-2013, 07:36 PM
  2. Replies: 5
    Last Post: 02-11-2010, 05:13 PM
  3. Returning a result based on an age in number of days
    By MattGriff in forum Excel General
    Replies: 2
    Last Post: 01-14-2010, 10:24 AM
  4. Last business day of month function +1,2,3,4 business days
    By dstock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2008, 06:08 PM
  5. Looking to performa a date calc (based upon business days)
    By magic093 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2006, 02:28 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