+ Reply to Thread
Results 1 to 12 of 12

Formula for IF it's the 2nd or 4th thursday of the month

  1. #1
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Arkansas
    MS-Off Ver
    Microsoft Excel 2016
    Posts
    252

    Formula for IF it's the 2nd or 4th thursday of the month

    I thought the formula that Tony Valko gave me last night worked, but it didn't. It will work if you manually type in the date in J1, but I need that date to auto populate, =NOW().

    The formulas in H15 and H16 are what I need help with. I have attached what I am working on.
    Attached Files Attached Files

  2. #2
    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
    28,208

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    try

    In H15

    =IF((EOMONTH($J$1,-1)+1)+14-WEEKDAY((EOMONTH($J$1,-1)+1)+2),Data!C30,"")

    in H16

    =IF((EOMONTH($J$1,-1)+1)+28-WEEKDAY((EOMONTH($J$1,-1)+1)+2),Data!C30,"")

    OR

    =IF(EOMONTH($J$1,-1)+15-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    =IF(EOMONTH($J$1,-1)+29-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    The first formulae were just to reminder that the calculation started from 1st of a month
    Last edited by JohnTopley; 07-28-2016 at 12:17 PM.

  3. #3
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Arkansas
    MS-Off Ver
    Microsoft Excel 2016
    Posts
    252

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Quote Originally Posted by JohnTopley View Post
    try

    In H15

    =IF((EOMONTH($J$1,-1)+1)+14-WEEKDAY((EOMONTH($J$1,-1)+1)+2),Data!C30,"")

    in H16

    =IF((EOMONTH($J$1,-1)+1)+28-WEEKDAY((EOMONTH($J$1,-1)+1)+2),Data!C30,"")

    OR

    =IF(EOMONTH($J$1,-1)+15-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    =IF(EOMONTH($J$1,-1)+29-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    The first formulae were just to reminder that the calculation started from 1st of a month
    Doesn't seem to work John. They both populate no matter what date populates.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Try

    =WORKDAY.INTL(INT(J1)-DAY(J1),2,"1110111")
    Change the 2 to 4 to get the 4th thursday.


    If you can change J1 to =TODAY() instead of =NOW(), then
    =WORKDAY.INTL(J1-DAY(J1),2,"1110111")

  5. #5
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Arkansas
    MS-Off Ver
    Microsoft Excel 2016
    Posts
    252

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Quote Originally Posted by Jonmo1 View Post
    Try

    =WORKDAY.INTL(INT(J1)-DAY(J1),2,"1110111")
    Change the 2 to 4 to get the 4th thursday.


    If you can change J1 to =TODAY() instead of =NOW(), then
    =WORKDAY.INTL(J1-DAY(J1),2,"1110111")
    Tried this with the =NOW(), but it populates no matter what day I change the computer to:

    =IF(WORKDAY.INTL(INT(J1)-DAY(J1),2,"1110111"),Data!C30,"")

  6. #6
    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
    28,208

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    TRy

    =IF(INT(J1)=EOMONTH($J$1,-1)+15-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    =IF(INT(J1)=EOMONTH($J$1,-1)+29-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C31,"")

  7. #7
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Arkansas
    MS-Off Ver
    Microsoft Excel 2016
    Posts
    252

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Quote Originally Posted by JohnTopley View Post
    TRy

    =IF(INT(J1)=EOMONTH($J$1,-1)+15-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C30,"")

    =IF(INT(J1)=EOMONTH($J$1,-1)+29-WEEKDAY(EOMONTH($J$1,-1)+3),Data!C31,"")
    That's it!!
    Thank you very much!!!

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Tried this with the =NOW(), but it populates no matter what day I change the computer to:
    =IF(WORKDAY.INTL(INT(J1)-DAY(J1),2,"1110111"),Data!C30,"")
    Tried this with the =NOW(), but it populates no matter what day I change the computer to:
    You forgot the 2nd half of the if expression...
    That is basically saying IF Workday Then...
    You need to say IF Workday equals something Then...

    =IF(WORKDAY.INTL(INT(J1)-DAY(J1),2,"1110111")=INT(J1),Data!C30,"")

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

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    I didn't download your file.

    If the cell contains the NOW() function then it returns BOTH the date and time.

    Do you actually need the time returned?

    If not, then you can replace NOW() with TODAY() which returns the date only. Then the formula I suggested will return the correct result.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Arkansas
    MS-Off Ver
    Microsoft Excel 2016
    Posts
    252

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Quote Originally Posted by Tony Valko View Post
    I didn't download your file.

    If the cell contains the NOW() function then it returns BOTH the date and time.

    Do you actually need the time returned?

    If not, then you can replace NOW() with TODAY() which returns the date only. Then the formula I suggested will return the correct result.
    You are correct sir, thank you. I've been using NOW() forever, I guess it's time to change.

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Quote Originally Posted by jmcole View Post
    I guess it's time to change.
    Not really time to change.
    Just recognize the difference between the two functions, and use the one that is appropriate to each situation.

    If you need the time value included with the date, use NOW.
    If not, use Today.

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

    Re: Formula for IF it's the 2nd or 4th thursday of the month

    Good deal. Thanks for the feedback!

+ 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] Formula for IF it's the second Thursday of the month
    By jmcole in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-27-2016, 08:02 PM
  2. Display all Thursday dates in month
    By badincite in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-25-2014, 08:22 PM
  3. Replies: 6
    Last Post: 09-03-2014, 02:06 PM
  4. Number of Thursday left in a month
    By Gibby13 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-23-2012, 02:54 PM
  5. how do you count the number of thursday from whole month of April 2007
    By LEX@EXCELTIP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-13-2007, 11:21 AM
  6. 2nd Thursday of the month
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2006, 12:10 AM
  7. next thursday formula?
    By Ctrl in forum Excel General
    Replies: 3
    Last Post: 02-16-2006, 03:31 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