Count the number of mondays in a specific month

Hey guys,
do you know how I can show the number of mondays in the current month?
Thank you very much.
Marc

I hope that this one will help :
In cell $A$2 is the date used as reference.
I choose this way to start to be able to check with different dates.
In B2 is the main formula.
Don't worry, it seems to be complex but in fact it's simple.
=IF(A-(DAY(A)-1)+MID("1065432",WEEKDAY(A-(DAY(A)-1)),1)>$A$2,"",A-(DAY(A)-1)+MID ("1065432",WEEKDAY(A-(DAY(A)-1)),1))
In B3 is the complementary formula :
=IFERROR(IF(B2+7>$A$2,"",B2+7),"")
Select B3 then drag the bottom_right circular handle until B6
That's all folks!
To be fair, I must add that I used my good old tip : build the formula by small pieces then replace references to cells by the formulas embedded in these cells.
In C2, insert :
=A-(DAY(A)-1)
In D2, insert :
=WEEKDAY(C)
In E2, insert :
=MID("1065432",D,1)
in F2, insert :
=C+E
Now, I'm sure that you understand that the formula is not really complicated
Yvan KOENIG (VALLAURIS, France) jeudi 30 décembre 2010 16:01:19

Similar Messages

  • Can i count the number of Mondays in a specific month with a formula?

    Hi
    I am looking for a streamlined way of calculating an amount to invoice for a job that I am paid for weekly, but for which I invoice monthly, meaning that I am invoicing different amounts each month, depending on how many Mondays fall in a given month (i.e. 4 or 5).
    So I am wondering if there is a function I can use to calculate the number of Mondays in a given month automatically and then I can use this value to multiply by my weekly charge to calculate the amount to invoice each month.
    Thanks
    Nick

    Responses below apply to my earlier post.
    nick_harambee wrote:
    1. What part of the formula do I need to change to do the same for other days of the week, and for other years?
    No change for other years, as the full date is entered.
    I haven't looked at changes necessary to the version above to show results for other days. See below for a new table that does all days.
    2. Would it be possible to construct one table with the calendar for a whole year, which would generate a count for each day of the week, which I could then use as and when needed? Or would it make more sense to construct a separate table for each day of the week (as I am referring to in question 1)?
    Depends what information you need.
    If you need the count for only one week day, then a table showing only the count for that day of week will avoid having to search it out.
    If you need the number of occurrences of each weekday in each month, then a table showing those, with or without an attached calendar, is in order.
    Here's one that shows the count of each weekday for each month. It uses two formulas, derived from the earlier posts by Yvan and Jerry:
    B1: =DATE($A,COLUMN()-1,1)
    B2: =IF(AND(DAY(EOMONTH(B$1,0))>28,MOD(WEEKDAY(EOMONTH(B$1,0))+7-(ROW()-1),7)<(DAY( EOMONTH(B$1,0))-28)),5,4)
    The formula in B1 is filled right to M1, and the cells are formatted to show only the Month and Year. Note that the cells actually contain Date and Time values, which are used in the second formula's calculations.
    The formula in B2 is filled right to M2 and Down to M8.
    Day names in column A are entered directly and are not used in the calculations.
    The 4 digit year number is entered directly in A1. Change this number to change the year.
    <img src="http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countw eekdaysinMonth.png" border="0" alt="Count of weekdays in month(s)">
    Conditional formatting is used to fill cells whose value is equal to 5 with a yellow background.
    Regards,
    Barry
    Edit:
    Direct address to image for use if not showing above.
    http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countweekday sinMonth.png
    Message was edited by: Barry

  • Can I create a list which counts the number of documents of a specific metadata type by the folder they are stored within?

    Running SP2013 Foundation. My users interact by uploading documents to personal folders within a document library, selecting the type of document they have uploaded via a lookup column and SP list. I have two levels of view in my library, a top level view
    and an in-folder view which contains the metadata and standard document information like version and modified date etc.
    Currently I am able to count the total number of documents that have been uploaded of a particular document type against my document type list, but I would also like to include folder along with document type to thoroughly track document returns by folder
    name. The desired output being a list with a count of document type uploaded by folder name.
    I have tried creating an associated user column at the top level view and also uploading an associated user and folder name list.
    Is this possible and how would I go about this?
    Many thanks for any assistance

    Hello MJH9J,
    Thank you for your question.
    We are currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    Best Regards,
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • Looping through a month to count the number of Mondays etc

    Can someone give me some pointers about where I'm going wrong here please? (No, this isn't a homework but I am trying to solve something). I want to be able to loop through the days in the previous month to find out how many Mondays, Tuesdays etc so that I can work out something else. Yes, I have read all the API information about Calendar,GregorianCalendar etc and I have a mental block about loops and the answer is probably very simple so please be gentle!
    import java.util.Date;
    import java.util.*;
    import java.text.*;
    class Dates
      public static void main (String [] args)
           int i;
         int mondayCount;
         int daysInMonth;
        DateFormat reportDateFormat = new SimpleDateFormat("EEEE dd.MMM.yyyy");
         Calendar theDay = Calendar.getInstance();
         theDay.add(Calendar.MONTH,-1);
         daysInMonth=theDay.getActualMaximum(theDay.DAY_OF_MONTH);
         int today = theDay.get(Calendar.DAY_OF_MONTH);
         int dayOfWeek = theDay.get(Calendar.DAY_OF_WEEK);
         mondayCount=0;
         for (i=0;i<daysInMonth;i++)
         if(today==Calendar.MONDAY)
                   mondayCount++;
         System.out.println("Testing "+mondayCount);
           System.out.println("Day of Week"+ dayOfWeek);
         System.out.println("Days in month" +daysInMonth);
         System.out.println("Today" + today);
         System.out.println("theDay"+ theDay);
      I can find out how many days are in the previous month( I think!) and what the code is for today- but what am I not getting here? My loop just gives 0 31 times.
    Any constructive help would be much appreciated.

    you were never actually updating the day of the month.... check out the updated code below....
    import java.util.Date;
    import java.util.*;
    import java.text.*;
    class tester
      public static void main (String [] args)
           int i;
         int mondayCount;
         int daysInMonth;
        DateFormat reportDateFormat = new SimpleDateFormat("EEEE dd.MMM.yyyy");
         Calendar theDay = Calendar.getInstance();
         theDay.add(Calendar.MONTH,-1);
         daysInMonth=theDay.getActualMaximum(theDay.DAY_OF_MONTH);
         int today = theDay.get(Calendar.DAY_OF_MONTH);
         int dayOfWeek = theDay.get(Calendar.DAY_OF_WEEK);
         mondayCount=0;
         theDay.set(Calendar.DAY_OF_MONTH, 1); // set the date to the 1st of the month
         for(i=1;i<=daysInMonth;i++) {          
              if(theDay.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
                   mondayCount++;
              theDay.add(Calendar.DAY_OF_MONTH, 1);
         System.out.println("Monday count = " + mondayCount);      
      }

  • How to count the number of instances a record appears in a string

    I have a move that imports Name, Department and Site from an
    external CSV file, this part I managed to get working after many
    weeks. I would like to be able to count the number of instances of
    a specific Site “Glasgow” appears in the String. This
    way I know how many lines to set.
    Also can you add Dynamic text to a rollover button? I can get
    the the text to display on the root but not on a button.
    I am new to programming and Flash so apologies in
    advance.

    Those which took time to read carefully *_iWork Formulas and Functions User Guide_* are aware of the availability of wildcard characters.
    =COUNTIFI(range;"=text")
    will do the trick.
    Yvan KOENIG (VALLAURIS, France) lundi 26 avril 2010 17:36:34

  • Count the number of instances a record appears in a string

    I have a move that imports Name, Department and Site from an
    external CSV file, this part I managed to get working after many
    weeks. I would like to be able to count the number of instances of
    a specific Site “Glasgow” appears in the String. This
    way I know how many lines to set.
    Also can you add Dynamic text to a rollover button? I can get
    the the text to display on the root but not on a button.
    I am new to programming and Flash so apologies in
    advance.

    Hi,
    length(REGEXP_REPLACE(':XXX:CCC:BBB:','[[:alnum:]]'))counts all kinds of punctuation, spaces, etc., not just colons. Change any (or all) of the colons to periods and it will still return 4. Use '[^:]' instead of '[[:alnum:]]' if you really want to count just colons.
    Also, "SELECT ... FROM dual" is usually needed only in SQL*Plus or similar front end tools. In PL/SQL, you can call functions without a query, like this:
    x := NVL (LENGTH (REGEXP_REPLACE (txt, '[^:]')), 0);

  • How do I count the number of occurrences of a string within a group of cells?

    Hello all, I'm trying to figure out how to count the number of times a child has completed certain tasks.  Here is a sample of the data (it is highly simplified here, but contains what I hope is needed to answer my question):
    Unnamed Table
    Objective
    John
    Ann
    Alex
    Dave
    Eric
    20a 20b 20c
    x
    20a 20b 20c
    x
    20a 20b 20c
    x
    x
    19b 20a
          x
           x
    20c 21b 22
         x
    What I am trying to do is count the number of times each child completed each objective - but I can't figure out how to go about splicing up the "objectives" fields for counting while still being able to compare them to whether or not the "child" has 'an x in the box' in that particular row.

    If I read your example correctly, John's counts should be 2 for 20a, 1 for 19b, 20b and 20c, and 0 for any other objectives listed.
    Here's an example that will work for your data set, assuming that any objective ma occur only once in each row of column A of the Main table. I've added an a to objective 22, but I think it is unnecessary, provided there is no objective 122, 221, etc.
    This uses a two step process.
    The table AUX extracts the objectives completed by each student, using the checkboxes in Main. Note that it also adds a space at the beginning and end of each string. This provides an extra character before the first objective code and after the last objective code in that row, used by the wildcard specification in the formula in the Summary table.
    Formula:
    Aux::B2: =IF(OFFSET(Data :: $A$1,ROW()-1,COLUMN()-1)," "&OFFSET(Data :: $A$1,ROW()-1,0)&" ","")
    Fill right to the last column and down to the last row of Aux.
    Summary uses COUNTIF to count the number of occurrences of each of the objectives listed in column A of that table.
    Formula:
    Summary::B2: =COUNTIF(Aux :: B,"=*"&$A2&"*")
    Fill right and down as the previous formula.
    Regards,
    Barry

  • Count the number of business partners on a non-cumulative key figure

    Dear experts,
    I have a problem. We have an InfoCube in BW in which the Activity Journals are loaded every day. In this Activity Journals it is registered that a Material was listed (available) at a customer (value 0 or 1).
    We have a non-cumulative key figure MXW_LISTN with inflow (MXW_LISTI) and outflow (MXW_LISTO). In time this key figure receives +1 or -1 for a customer, material combination.
    I want to use MXW_LISTN in the query in a specific way. The key figure on itselve tells me how many listings there are. However, I want to know how many business partners there are with a listing.
    I was thinking about an exception aggregation on MXW_LISTN with reference characteristic 0BPARTNER and "Count <> 0". BW however refuses to do so and only lets me do simple aggregations such as AVG, MIN, MAX etc.
    Can you think with me and come with an proper solution to count the number of business partners with a listing?
    Your help is very much appreciated and rewarded!
    Best regards, Hans de Klein

    Would anything with virtual key figures be a solution? Please help me out!
    Best regards, Hans de Klein

  • How to count the number of occurences of a character

    hi
    wat command is used to count the number of occurences of a charcter in a line?
    i have to count the number of '.' in a line

    FIND
    Searches for patterns.
    Syntax
    FIND <p> IN [SECTION OFFSET <off> LENGTH <len> OF] <text>
                [IGNORING CASE|RESPECTING CASE]
                [IN BYTE MODE|IN CHARACTER MODE]
                [MATCH OFFSET <o>] [MATCH LENGTH <l>].
    The system searches the field <text> for the pattern <p>. The SECTION OFFSET <off> LENGTH <len> OF addition tells the system to search only from the <off> position in the length <len>. IGNORING CASE or RESPECTING CASE (default) specifies whether the search is to be case-sensitive. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The MATCH OFFSET and MATCH LENGTH additions set the offset of the first occurrence and length of the search string in the fields <p> and <l>.

  • Count the number of a certain document type in a document-set

    The Content types allowed in my Document-Set are document type A and document type B. How can I count the number of document type A in the document-set with workflows? I need to know if there is at least one document of type A inside the
    document-set. With “Item child count” condition in workflows I can only count the total number of the documents and not the number of specific document type.

    Hi pax123,
    According to your description, my understanding is that you want to count the number od the documents based on Content Types.
    As a workaround, you can create two columns to store the count of documents for your two content types. Then create a loop action to loop all documents, if content type is equal to your content type A, do a calculate to plus 1 to the numberA, then update
    the column numberA. Do a same if condition in the loop for your content type B.
    How to loop through all items
    http://blog-sharepoint.blogspot.com/2010/01/sharepoint-looping-workflow-how-to-loop.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Counting the number of characters entered into a page item

    Is there a way to count the number of characters that are entered into a page item. I've got a field that can contain up to 20 characters. If 20 are entered I can do a = on my search, if less than that, then I have to do a wildcard search. I currently do a substr on the field to see if position 21 is null and position 20 is not null, then I have a 20 character field. Is there a more efficient way to do this and also is there a way to actually show the character count as the page item is being populated

    Hello user8014695 (name please),
    Try coding the select for your search as
    select ...
    from some_table
    where some_field like case when length(trim(:YOUR_ITEM)) = 20 then :YOUR_ITEM else :YOUR_ITEM || '%' end
    Note - I included the trim() assuming blank characters before or after shouldn't count.
    To show the character count as the item is being keyed-in, Google "javascript character count" for lots of ways to do this. To work these solutions into ApEx, check the ApEx help/documentation for incorporating JavaScript into your application - specifically the references on accessing page items using JavaScript.
    Hope this helps,
    John

  • Get the number of tables of a specific database

    Hy, I have to get the number of tables of a specific database. To do this, I connect to the database(mysql) and I get a Connection object.
    I do the next with this object:
    DatabaseMetaData dbmd=connection.getMetaData();
    ResultSet tables=dbmd.getTables(null, null, null, null);
    Now what to do to get the number of tables of the database?-
    Maybe counting the rows of this resultset I would get it
    because each table of the database is represented in one row of
    this ResulSet?
    Thank you!!

    Yes. Count them.

  • Is there a way to count the number of times an array moves from positive to negative?

    I have an array of values, and I need to find the number of times that the array changes signs (from positive to negative, or vice versa). In other words from a graphical standpoint, how many times a certain line crosses the x-axis. Counting the number of times the array equals zero does not help however, because the array does not always equal exactly zero when it crosses the axis (ie, the points could move from .1 to -.1).
    Thanks for you help. Feel free to email me at [email protected] I only have lv 5.1.1 so if you attach any files, they cannot be version 6.0.

    Attached is a VI showing the # of Pos and Neg numbers in an array, with 0 considered as non-Pos. It is easily modifiable to other parameters - including using the X-axis value as your compare point versus only Zero.
    This is a modified VI from LV (Separate Array.vi)
    Compare this with your other responses to find the best fit.
    Doug
    Attachments:
    arraysizesposneg.vi ‏40 KB

  • How do I count the number of records returned in the CMIS query

    How do I count the number of records returned in the query CMIS?
    SELECT COUNT(*) FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition = \'RD_PROJETOS_EXCLUSIVOS\''}
    Euler Homero

    Hi Euler,
    interestingly enough, the reference guide for CMIS ( http://wiki.alfresco.com/wiki/CMIS_Query_Language ) that I found does not mention the COUNT function at all. On the other hand it states that: "The SELECT clause identifies which virtual columns to return in the result set. It can be either a comma-separated list of one or more queryNames of properties that are defined by queryable object types or * for all virtual columns."
    There are, however, some other posts like e.g. http://alfrescoshare.wordpress.com/2010/01/20/count-the-total-number-of-documents-in-alfresco-using-sql/ which state that they could make it working.
    Having asked in the WebCenter Portal forum, I assume that your content repository is WebCenter Content. The CMIS doc for the Content is available here: http://docs.oracle.com/cd/E23943_01/doc.1111/e15813.pdf (no COUNT there either). It does, however, mention explicitly that "CMIS queries return a Result Set where each Entry object will contain only the properties that were specified in the query.". This means your could rather investigate the Result Set. Note that there are also other means than CMIS how to get the requested result set (e.g. calling a search service directly via so-called RIDC).
    In the given context I am also interested what your use case is. OOTB CMIS in WebCenter Portal is used, for instance, in Content Presenter, where it is content rather than "parameters" what's displayed.

  • How to count the number of rows in a cube!!??

    Experts,
    I can somebody tell me how do I count the number of rows in my cube when i am using listcube???..
    Thanks
    Ashwin

    Hi,
    have a look ath this theard too
    Number of Records in Cube
    regards

Maybe you are looking for