How to find every 3rd Friday?

I have a column of consecutive dates that span multiple months.  A second column list the day name for the date.  How do I find every 3rd Friday of any month?  I'd like to have it display some text in a 3rd column next to the particular Friday.
If the formula is generic enough, I'd like to find other types of days such as every 1st Friday, every 2nd Thursday, etc.

I'm assuming that by "every 3rd Friday of any month" you mean "the third Friday of each month," and that your meaning for "every second Tuesday" and "every first Friday" is similar.
The first occurrence of any particular weekday in a particular month will be on one of the first seven days in that month, the second occurrence in the second seven days, and the third occurrence in the third seven days.
The day number within a month is returned by the DAY(date) function.
First:      DAY(date)>0 AND DAY(date)<8
Second: DAY(date)>7 AND DAY(date)<15
Third:     DAY(date)>14 AND DAY(date)<22
Fourth:   DAY(date)>21 AND DAY(date)<29
A number corresponding to the day of the week is returned by the WEEKDAY(date) function. By default, the week starts on Sunday, which is assigned the WEEKDAY value 1.
So for a date to be the third Friday of a month, three things must be TRUE:
WEEKDAY(date) must be 6
DAY(date) must be greater than 14
DAY(date) must be less than 22.
Expressed as a formula, placed in the same row as the date, and with the dates listed in column A,
=IF(AND(WEEKDAY($A)=6,DAY($A)>14,DAY($A)<22),"Third Friday","")
will place "Third Friday" beside the third Friday of each month, and a null string in the other rows.
There should be enough information there to write the formulas for the other cases.
Regards,
Barry

Similar Messages

  • Find 3rd friday of the month for a given date

    how to find out 3rd friday of the month for a given date? I can always pass the first day of the month as input
    eg, input date is 01-JAN-09. need to get the 3rd friday 16-JAN-09 (Jan has 5 fridays 02, 09, 16,23,30)
    input date : 01-feb-09, need to get 20-feb-09
    Edited by: user520824 on Apr 1, 2009 12:30 PM

    NLS independent solution:
    SELECT  DT,
            TO_CHAR(DT,'FMDay') day,
            CASE
              WHEN TRUNC(TRUNC(DT,'MM') + 7,'IW') - 3 < TRUNC(DT,'MM') THEN TRUNC(TRUNC(DT,'MM') + 7,'IW') + 18
              ELSE TRUNC(TRUNC(DT,'MM') + 7,'IW') + 11
            END THIRD_FRIDAY_OF_THE_MONTH
      FROM  (
             SELECT  TO_DATE(LEVEL || '/2009','MM/YYYY') DT
               FROM  DUAL
               CONNECT BY LEVEL < 13
    DT        DAY       THIRD_FRI
    01-JAN-09 Thursday  16-JAN-09
    01-FEB-09 Sunday    20-FEB-09
    01-MAR-09 Sunday    20-MAR-09
    01-APR-09 Wednesday 17-APR-09
    01-MAY-09 Friday    15-MAY-09
    01-JUN-09 Monday    19-JUN-09
    01-JUL-09 Wednesday 17-JUL-09
    01-AUG-09 Saturday  21-AUG-09
    01-SEP-09 Tuesday   18-SEP-09
    01-OCT-09 Thursday  16-OCT-09
    01-NOV-09 Sunday    20-NOV-09
    DT        DAY       THIRD_FRI
    01-DEC-09 Tuesday   18-DEC-09
    12 rows selected.
    SQL> SY.

  • How to make applescript to select every 3rd file to move to new folder?

    I have an interesting 'problem' I think.
    As a result of a time-lapse experminent, I have a folder which holds several thousands of pictures from a fixed point, made over several days & nights.
    But there is one issue: the camera made 3 different exposures every 5 seconds.
    This resulted in every 3rd picture 'belonging' to each other. So these have to be selected for going in a seperate folder. Menaing: pictures 1 and 4 and 7 and 10 .... they must go in one folder. 2 and 4 and 8 and 11.. in the second folder. Finally 3 and 5 and 9 and 12 in a third folder.
    How to do this with software (to avoid injury) because of the thousands of pics.
    Is this do-able with applescript? How?
    Tnx

    Hello
    You may try something like the following script.
    Main part is written in shell script for performance sake. AppleScript is only used for user interface.
    Please see comments in script for its usage and behaviour.
    And please test the script first with small subset of your images.
    (Since the script will scan the source folder tree for image files, it is good idea not to create destination folders in source folder tree.)
    Minimally tested with OSX10.2 at hand but NO WARRANTIES of any kind.
    Make sure you have full backup of your images before applying this script.
    Hope this may help,
    H
    image file (jpg) sorter
    v0.2
    Script will let you choose two folders, i.e. -
    a) source folder where images reside (directory tree under the chosen folder is scanned),
    b) destination parent folder where three subfolders will be made (named '0', '1', '2').
    The file number i is obtained by removing extension and non-digts from file name.
    The file with number i (0-based) in source tree will be moved to (i mod 3)'th subfolder in destination.
    e.g.,
    IMG_1440.JPG -> '0' (i = 1440, i mod 3 = 0)
    IMG_1441.JPG -> '1' (i = 1441, i mod 3 = 1)
    IMG_1442.JPG -> '2' (i = 1442, i mod 3 = 2)
    IMG_1443.JPG -> '0' ...
    IMG_9997.JPG -> '1'
    IMG_9998.JPG -> '2'
    IMG_9999.JPG -> '0'
    IMG_0001.JPG -> '1'
    IMG_0002.JPG -> '2'
    IMG_0003.JPG -> '0'
    image file name convention : ZZZZ_9999.jpg
    set src to choose folder with prompt "Choose source folder."
    set src_ to (src's POSIX path's text 1 thru -2)'s quoted form
    set dst to choose folder with prompt "Choose destination parent folder."
    set dst_ to (dst's POSIX path's text 1 thru -2)'s quoted form
    set sh to "
    # source directory
    srcdir=" & src_ & ";
    # destination directories
    dstdir=" & dst_ & ";
    dest=("$dstdir"/{0,1,2});
    # make destinations
    mkdir -p "${dest[@]}";
    # let k = number of destination directories
    k=${#dest[@]};
    # sort files to destinations such that -
    # 1) number i is obtained by removing extension and non-digits from file name; and
    # 2) file with number i is stored in (i % k)'th destination, where i is zero-based.
    # e.g. Given xxxx_9999.jpg, k = 3;
    # i = 9999 and the file is sorted to destination 0 (= 9999 mod 3)
    find "$srcdir" -type f -iname '*.jpg' -print0 | while read -d $'\0' f;
    do
    leaf=${f##*/}; # get file name
    stem=${leaf%.*}; # remove extension
    i=${stem//[^0-9]/}; # remove non-digts from file name
    let i=0+10#$i; # to interpret, e.g., 010 as 10, otherwise 010 is treated as octal.
    # echo "$i $f ${dest[i % k]}"; # for testing
    mv "$f" "${dest[i % k]}"; # move file
    done
    do shell script sh
    display dialog "Done" with icon 1 giving up after 20

  • How do I enter an event in Calendar and repeat it every 3rd day

    How do I enter an event in Calendar and repeat it every 3rd day

    Hello PatrickMaryAnn,
    Thanks for the question, and welcome to Apple Support Communities.
    When editing or creating an event, choose Repeat > Custom… - then choose "Daily" and enter Every 3 days.
    Calendar: Update or delete an event
    http://support.apple.com/kb/PH11509
    Thanks,
    Matt M.

  • How to make every folder in finder snap to grid

    Hi, does anyone know how to make every folder in finder snap to grid? Without having to go one by one into the view options?
    Thanks!

    Open a folder, CMD+J, set it up as you want it, and click on the Use as Defaults button. That will set it for all unopened folders. For those previously opened and having other settings, you'll have to reapply it to each.

  • How to find out average files i am getting every day in a month?

    How to find out average files I am getting every day in a month?

    Do you mean average count of files received?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to finds specific words in each sentence?

    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class FindingWordsSpecific {
         static String[] days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "every Tuesday"};
      public static void main( String args[] ) throws IOException {
               // the file must be called 'myfile.txt'
               String s = "myfile.txt";
               File f = new File(s);
               if (!f.exists())
                    System.out.println("\'" + s + "\' does not exit. Bye!");
                    return;
               BufferedReader inputFile = new BufferedReader(new FileReader(s));
               String line;
               int nLines = 0;
               while ((line = inputFile.readLine()) != null)
                    nLines++;
                   System.out.println(findTheIndex(line));     
               inputFile.close();
           public static String findTheIndex(String sentence){
                String result = "";
                String[] s = sentence.split("\\s");
              for (String s1: s){
                   for (String s2: days){
                        if (s1.equalsIgnoreCase(s2)) {
                             if(s2.matches("every Tuesday")){
                                             }else if (s2.matches("every Wednesday")){
                                              }What is wrong with it because I tried to find "every Tuesday" in
    myfile.txt: "Go fishing every Tuesday and every Wednesday"
    There is big problem with split statement because it takes each word not more than a word.
    I need to have "every Tuesday" not "Tuesday". How to make it correct codes?

    I am going to give you a picture of how the output will look.
    Here are two sentences from myfile.txt:
    Go fishing every Tuesday and every Wednesday
    Meet with research students on Thursday
    I need to read from myfile.txt and to find specific words in each sentences like this output:
    Every Tuesday : Go fishing
    Every Wednesday : Go fishing
    Thursday : Meet with research students
    Ok. make sense? Now I am trying to figure out how to find specific words in each sentence from myfile.txt.
    That is why I have difficult with the splits statement and loops. Like this:
           public static String findTheIndex(String sentence){
                String result = "";
                String[] s = sentence.split("\\s");
              for (String s1: s){
                   for (String s2: days){
                        if (s1.equalsIgnoreCase(s2)) {
                             if(s2.matches("every Tuesday")){
                             }else if(s2.matches("every Wednesday")){
                             }else if(s2.matches("Thursday")){
                             }else{
                                  System.out.println("That sentence is not working");
                return result;
      }So look at the "Thursday" it is working the output because I have split statement to give me only one word not more than
    a word in sentence. So there is big problem with more than a word in sentence like this "every Tuesday" and it won't work at all because of split. Could you please help me how to do that? I appreciated for that help. Thanks.

  • Use automator to select every 3rd file to move to new folder?

    I have an interesting 'problem' I think.
    As a result of a time-lapse experminent, I have a folder which holds several thousands of pictures from a fixed point, made over several days & nights.
    But there is one issue: the camera made 3 different exposures every 5 seconds.
    This resulted in every 3rd picture 'belonging' to each other. So these have to be selected for going in a seperate folder. Menaing: pictures 1 and 4 and 7 and 10 .... they must go in one folder. 2 and 4 and 8 and 11.. in the second folder. Finally 3 and 5 and 9 and 12 in a third folder.
    How to do this with software (to avoid injury) because of the thousands of pics.
    Is this do-able with automator? How?
    Tnx

    This has come up a few times, so I tweaked one of my Automator actions a while back to do this. I thought I had uploaded it before, but the latest version of my *Trim Input Items* action is available on my iDisk here. It keeps or trims the input list to the selected number of items from the beginning, end, interval, or random locations. You may need to sort the input file list to get them into the desired order, since the action just works with the items in the list, and doesn't care what they are.
    I haven't tested it with large file lists, but an example workflow using my action would be:
    1) *Get Specified Finder Items* (or however you want to get the file items)
    2) *Set Value of Variable* { Variable: _File List_ }
    3) *Trim Input Items* { Keep Interval 3 items, starting from item 1 }
    4) *Move Finder Items* { To: _First Location_ } -- move first batch
    5) *Get Value of Variable* { Variable: _File List_ } (Ignore Input)
    6) *Trim Input Items* { Keep Interval 3 items, starting from item 2 }
    7) *Move Finder Items* { To: _Second Location_ } -- move second batch
    8) *Get Value of Variable* { Variable: _File List_ } (Ignore Input)
    9) *Trim Input Items* { Keep Interval 3 items, starting from item 3 }
    10) *Move Finder Items* { To: _Third Location_ } -- move third batch

  • How to find a specific word in sentence in each line?

    How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
    For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
    Go ballet class next Wednesday.
    On the Wednesday is going to swim class.
    We have a meeting on Thursday at Panda's.
    Then it will show the output:
    Wednesday : ballet class
    Wednesday : swim class
    Thursday: meeting at Panda's
    I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.

    I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
    a specific word in sentence but how I should make Output for specific word and some words from sentence.
    For example:
    Input:
    +"On Thursday go to ballet class"+
    +"Swim class on Friday one time a month at 2 p.m."+
    I used the codes for that:
    class FindSchedule{
         String firstline = "On Thursday go to ballet class ";
         String secondline = "Swim class on Friday one time a month ";
         FindSchedule(){
              System.out.println(firstline + findTheIndex("Thursday", firstline));
              System.out.println(secondline + findTheIndex("Friday", secondline));
         public int findTheIndex(String word, String sentence){
              int index;
              index = sentence.indexOf(word);
              return index;
         public static void main (String[] args){
              new FindSchedule();
    }The output will be:
    Thursday: ballet class
    Friday: 14:00 swim class one time a week
    Notice that time is changing in output complete different from input.
    I need to find out how to extract some words from each sentence for output. Do you know how to do it?

  • How to find the number of links in a website

    hi every body
    can any one clear my doubt
    my doubt is that
    in a website how to find the number of links the hole website contains
    is there any navigation tool to find that
    plz help me yar
    i am waiting for the reply

    If you're talking about commercial sites (sites you don't have the source code for) I'm not sure.
    If you want to count the links in site that you have the source code for, it should be relatively easy to write a Java application to do it. All you really need to do is have a list of the files you want to count links in, read each file line by line and check for the existance of the <a> tag in each line. Anywhere their is an <a> tag there is a link.
    Hope this helps.

  • How to find the number of references created for a given  object ??

    How to find the number of references created for a given object in a big application environment.
    That means, if i give any object name (of my application) as input, then how can i find the[b] number of references created for that particular object ??

    Please do not post the same question multiple times.
    As for your original question, there is no direct way to do it.
    Especially not the way you phrased it,
    since objects don't have "names".
    Applications also don't have "names".
    They have classes and instances.
    Also, there are 2 related issues, and I'm not sure which one is the one you asked.
    #1. Finding the number of references to the same object.
    Eg.
    Map<String,String> a = new HashMap<String,String>();
    Map<String,String> b = new HashMap<String,String>();
    Map<String,String> c = a;In this case, there are only 2 objects.
    The first object has (at least) 2 references pointing to it.
    The second object has (at least) 1 reference pointing to it.
    (There may be more, if the HashMap library keeps
    references to these things, or if the HashMap object has
    some internal cyclic references...)
    If you're asking this, then it can't be done.
    It's an active research topic in universities
    and software research labs, called "alias analysis".
    Type it in google, and you'll see people are working hard
    and having little success so far.
    #2. Finding the number of instances created from a class.
    In this case, what you have to do is to add a counter to
    the constructor of the class. Every time an object is constructed,
    you increment the counter. Like this:
       class MyClass
           public static int counter = 0;
           public MyClass( )  { counter++; }
        // Then later in your program, you can do this:
        MyClass a = new MyClass();
        MyClass b = new MyClass();
        System.out.println(MyClass.counter); // It should show 2Note: you won't be able to do this to every class in the system.
    For every class you care about, you have to modify its constructor.
    Also: when an object is deleted, you won't always know it
    (and thus you won't always be able to decrement the counter).
    Finalizers cannot always work (read Joshua Bloch's
    "Effective Java" book if you don't believe me), but basically
    (1) finalizers will not always be called, and
    (2) finalizers can sometimes cause objects to not be deleted,
    and thus the JVM will run out of memory and crash

  • Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two? also I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own?
    Yes, it is possible. 1 apple ID can be associated with up to 10 devices.
    If each has their own does each id have to buy their own music and apps?
    Yes, all purchases are non-transferable.
    How does find my iphone work with one apple id or two?
    Every device associated with one apple ID through Find my iPhone is tied to that Apple ID; Find my iPhone will work in the same way with up to ten devices associated with one apple ID. You cannot enable Find my iPhone for one device across two apple IDs
    I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?
    If you have authorized a computer with the old apple ID, you can transfer old media purchased through the old to other devices via iTunes. This doesn't mean the media purchases through the old apple ID it transferred to the new account. If you plan to make future purchases and don't wish to share them with others, make your own apple ID.

  • How to find whether an Invoice is been posted for a particular PO

    Hi,
    How to find whether an Invoice is been posted for a particular PO.
    I have a scenario where I fetch data into an internal table T_CDHDR(It has PO and other details). For each and every entry(PO) in that internal table I have to see whether an Invoice is been posted or not. They told to use <b>EKBE(Purchasing document history)</b> table. But, I don't know which field to check for and based on what conditions.
    Can someone help me with sample code or some valuable inputs.
    Thanks in advance.
    Regards,
    Paddu.

    HI,
    TABLE IS RIGHT.
    IN THAT TABLE FOR THE FIELD BEWTP CHECK WHETHER ENTRY IS "Q".
    Q STANDS FOR IR-L THAT MEANS INVOICE IS DONE.
    ON THE SELECTION SCREEN OF EKBE TABLE ENTER THE PO NUMBER.
    THEN CHECK WHETHER IT HAS ENTRY FOR BEWTP 'Q'.
    YOU CAN CROSS-CHECK THIS DATA FROM TABLE WITH THAT IN ACTUAL PO IN T.CODE - ME23N.
    ENTER PO NUMBER ,THEN IN ITEM DETAILS , IN HISTORY TAB SEE FOR THAT INVOICE NO.

  • How to find process chain using background job in sm37

    How to find process chain using background job in sm37

    Better is to select the job.
    Select (Define) Step (s) or F6.
    Select the line and Menu Goto>Variant.
    The variant contains the name of the CHAIN and its VARIANT.
    Success
    We faced an old job and via job monitoring we were informed about a cancelled job every 'interval'.
    We noticed that the related chain was deleted but still the job was scheduled each interval again and was cancelled because an event was missing
    We could not find the scheduled job via SM37.
    Via view V_OP, view over tbtco abd tbtcp, we find the related entry.
    We delete these entries via function BP_JOB_DELETE....
    Edited by: Jack Otten on Jul 9, 2010 2:50 PM

  • HT2509 Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the Mac Air? I need to be able to use a pop up window of fonts.

    Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the MacBook  Air? I need to be able to use a pop up window of fonts.

    Unless you've done anything to change it, Google keeps every email that ever passes through their server in your All Mail folder/mailbox/label. Even if you delete stuff, they hold onto it, there. You have to go out of your way to actually delete anything permanently.

Maybe you are looking for

  • CNTL_ERROR while running a custom report program in background mode

    Hi, I am running a report in background on daily basis. I am using cl_gui_custom_container class here and calling the constructor of this class. I am getting a CNTL_ERROR exception at this point. But if i run the same report directly, it is not throw

  • I keep getting error 0xE8000068 ipod error, any ideas of what i should do?

    i keep getting this error everytime i sync my ipod touch 3g to my computer. i have windows vista and i keep turning the ipod on/off, let it charge fully and used different usb ports. idk what else to do. any ideas?

  • Updating acrobat 9.0 Pro

    I purchased Acrobat 9.0 Pro  a few years ago and recently had to get a new laptop ( mother board died). The new laptop has Windows 7 (64 bit). Acrobat does not seem to work properly.  I read that I have to do some updates but there are so many versio

  • Streaming audio on Palm Pixi

    Is it possible to listen to streaming audio from a website on the Palm Pixi? I tried to listen to live audio from a radio station website and it wouldn't play. Do I need to download a player?

  • IPad air won't connect to internet

    new air,  128 gb.  Unusable.  Won't connect to wif with consistencyi.  Won't load on new mail unless  I power off first.  Even then,  it takes forever despite ultra high speed connection. (old iPad works fine). Can't navigate to links from sites or b