+ Reply to Thread
Results 1 to 12 of 12

Formula to show every tuesday and friday

  1. #1
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Formula to show every tuesday and friday

    Howdy

    Bear with me

    * Every bill is expected to be paid on a due date, which is the next tuesday after it was received

    Lets take this as an example

    Bill received__________Expected payment date
    31/01/2019__________=formula????

    What is the formula to display the next tuesday after the date "bill received"?

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Formula to show every tuesday and friday

    Assuming Bill received date in A2.
    =A2+7-WEEKDAY(A2-3)

    Edit: Oh wait. You want following Tuesday if received date is Tuesday? If so...
    =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)
    Last edited by CK76; 01-31-2019 at 10:40 AM.

  3. #3
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Re: Formula to show every tuesday and friday

    Quote Originally Posted by CK76 View Post
    Assuming Bill received date in A2.
    =A2+7-WEEKDAY(A2-3)

    Edit: Oh wait. You want following Tuesday if received date is Tuesday? If so...
    =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)

    First time was what I needed
    Let me put again
    Regardless of the date received, the payment date should be the next tuesday

    In =A2+7-WEEKDAY(A2-3)
    I assume the reference to tuesday should be the "-3"
    What would be the correspondence to every other day of the week?

    EDIT:
    Expanding a little bit

    Date received_________Expected Payment date_______________Days late
    31/01/2019__________=formula to bring out next tuesday_____=today-expected payment date
    25/12/2018__________=formula to bring out next tuesday_____=today-expected payment date
    Last edited by KarelMusa; 01-31-2019 at 10:49 AM.

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Formula to show every tuesday and friday

    What's your expected result for each line? I'm not sure I understand your requirement fully.

  5. #5
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Re: Formula to show every tuesday and friday

    Quote Originally Posted by CK76 View Post
    What's your expected result for each line? I'm not sure I understand your requirement fully.
    Date received_________Expected Payment date__________________________Days late
    31/01/2019__________=formula to bring out next tuesday(05/02/2019)_____=today-expected payment date
    25/12/2018__________=formula to bring out next tuesday(01/01/2019)_____=today-expected payment date


    The field expected payment date should bring the tuesday after the field date received

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula to show every tuesday and friday

    not elegant but
    =A1+7-IF(WEEKDAY(A1)=3,0,WEEKDAY(A1-3))

    then if the above is in b1
    =today()-b1

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Formula to show every tuesday and friday

    So, then my 2nd formula works for your sample.

    What else is needed?

  8. #8
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Re: Formula to show every tuesday and friday

    Quote Originally Posted by davsth View Post
    not elegant but
    =A1+7-IF(WEEKDAY(A1)=3,0,WEEKDAY(A1-3))

    then if the above is in b1
    =today()-b1
    This kind worked, but help me out to understand what is happening here
    I'm not very logic driven nor excel savy, so this isn't very clear
    =A1+7-IF(WEEKDAY(A1)=3,0,WEEKDAY(A1-3))
    A few questions
    -> What does the "=3" represents?
    -> What does the "-3" represents?
    -> If they represent tuesday - is it a hard reference to the week day (example: Excel understand that tuesday=3, wednesday=4...) or the decision to this particular number takes in account the present day?

  9. #9
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Re: Formula to show every tuesday and friday

    Quote Originally Posted by CK76 View Post
    So, then my 2nd formula works for your sample.

    What else is needed?
    Does your formula takes in account the received date as tuesday, because what i need is a formula that doesn't take in account when the bill was received. In other words, regardless of the received date, the payment date should be the exact next tuesday of the received date.

    And if the bill doesn't get paid the next proposed tuesday, it should then start counting late dates with the =X-Y formula

    On using =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)
    What if i were to change the payment date to friday?

  10. #10
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Formula to show every tuesday and friday

    In WEEKDAY() function, without optional argument for return type, Sunday is considered first day of week.
    Sun to Sat is assigned numbers 1 to 7.

    There is 7 days in a week... so by adding 7 to current day, you are in next week on same day '2/7/2019'.
    Subtract Tuesday's value (3) from current date's weekday value (ex. Today '1/31/2019' = 5).
    This will give you number of days to go back to Tuesday.
    So '2/7/2019' - 2 = '2/5/2019'.
    If function is used to check if the date in A1 falls on Tuesday. If it does, just add 7 to current date to get next Tuesday.

    Same logic is used for =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)
    As false in Excel evaluate to 0. If A2 is Tuesday...
    =A2+7-(2)*(0)
    =A2+7

    Otherwise...
    =A2+7-(2)*(1)

  11. #11
    Registered User
    Join Date
    01-23-2019
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Windows 2016
    Posts
    49

    Re: Formula to show every tuesday and friday

    Quote Originally Posted by CK76 View Post
    In WEEKDAY() function, without optional argument for return type, Sunday is considered first day of week.
    Sun to Sat is assigned numbers 1 to 7.

    There is 7 days in a week... so by adding 7 to current day, you are in next week on same day '2/7/2019'.
    Subtract Tuesday's value (3) from current date's weekday value (ex. Today '1/31/2019' = 5).
    This will give you number of days to go back to Tuesday.
    So '2/7/2019' - 2 = '2/5/2019'.
    If function is used to check if the date in A1 falls on Tuesday. If it does, just add 7 to current date to get next Tuesday.

    Same logic is used for =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)
    As false in Excel evaluate to 0. If A2 is Tuesday...
    =A2+7-(2)*(0)
    =A2+7

    Otherwise...
    =A2+7-(2)*(1)
    Awesome
    I now understand the 2nd formula you proposed
    Worked as expected.

    Another question, how can i sum months?
    like
    01/01/2019 + =formula????? = 01/01/2019
    01/02/2019 + =formula???? = 01/02/2019

  12. #12
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Formula to show every tuesday and friday

    Hmm? Not sure I get you.

    But if you mean that you want to add x number of months to given date...
    =EOMONTH(Date,#ofMonth-1)+Day(Date)

    Ex: Where A2 holds Jan 2nd 2019 and add 1 month.
    =EOMONTH(A2,1-1)+Day(A2)
    =1/31/2019+2 = 2/2/2019

    Alternately, where +1 is # of month to add.
    =Date(Year(A2),Month(A2)+1,Day(A2))

+ 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: 24
    Last Post: 04-21-2021, 10:14 AM
  2. Count Tuesday as Business day when Today() = Friday
    By bhenlee in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-29-2016, 01:23 PM
  3. today() = following tuesday or Friday
    By jackf-nc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-18-2016, 10:43 PM
  4. How to show only Working Day on expire date (Friday + 2 = Tuesday)
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2013, 01:01 PM
  5. How to count all dates in column A using last friday and and next friday friday
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2011, 04:33 PM
  6. Calculate 1st Tuesday or 3rd Friday of month
    By BRISBANEBOB in forum Excel General
    Replies: 3
    Last Post: 11-11-2009, 05:51 PM
  7. [SOLVED] Date functions-first Friday or even the last Tuesday?
    By Dale in forum Excel General
    Replies: 5
    Last Post: 04-10-2005, 09:06 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