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

Similar Messages

  • 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

  • How can I count the number of unique cells?

    I have a column in my spreadsheet that looks like this:
    Date
    Items
    3/25
    Item A
    3/27
    Item A
    3/29
    Item A
    3/25
    Item A
    4/25
    Item B
    6/1
    Item B
    7/13
    Item B
    8/9
    Item B
    3/5
    Item C
    1/2
    Item C
    5/15
    Item D
    3/25
    Item D
    What I want is something that will list all the unique items that I have and count the number of times that Item shows up in my spreadsheet.  For example, the results should look like this:
    Item A: 3
    Item B: 4
    Item C: 2
    Item D: 2
    I thought for sure that I can do a chart in numbers and it would count the number of items but no, not so much.

    I apologize. When I pasted the table in Numbers running in French the values of column B were treated as dates.
    I leave the screenshot untouched because the contents of this column changes nothing to the calculations.
    In cell D2 of the main table, the formula is :
    =IF(ISBLANK(C),0,IF(COUNTIF($C$2:$C2,"="&$C2)=1,COUNTIF(C,"="&$C2)+(ROWS(A)-ROW( ))/100000,0))
    Apply Fill Down
    In cell A2 of table aux, the formula is :
    =IFERROR(LARGE(main :: D,ROW()-1),"")
    In cell B2 of table aux, the formula is :
    =IF(A>0,LOOKUP(A2,main :: D,main :: C),"")
    In cell C2 of table aux, the formula is :
    =INT(A)
    Apply Fill Down
    Yvan KOENIG (VALLAURIS, France) samedi 6 août 2011 23:33:10
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How can I count the number of times a timed loop finished late?

    I am getting occasional timing errors in a timed loop under windows XP and would like to count the number of errors, but I can't find a simple software counter vi

    The timed loop has a terminal (boolean) to indicate if the previous iteration finished late. Just increment an integer shift register if this happens.
    The attached shows a very simple demo (LabVIEW 7.1).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LateCounter.vi ‏76 KB

  • Applescript - how can I count the number of records in a Word data source?

    I have written a script in AppleScript to open Word and then perform a mail merge from a data source and everything is working fine.
    One thing I want to do but am struggling with is to return the number of records in the mail merge.
    I am trying things like:
    get last record of datasource of mydatasource
    and also haven't been able to find anything in the AppleScript 2004 Word Reference Guide.
    Can anyone help as I have been searching the web and trying things all day and I am sure it can't be difficult.
    Thank you.

    I don't think there is an automatic way to get a line count, but I don't have any problem just counting the lines on a page. Maybe some more information about what you are trying to do and why you can't do it would help someone to come up with a helpful suggestion.

  • 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

  • Can I "count" the number of rows excluding the header and footers

    I have some tables that consist of a different number of rows, as the number is part of an equation I need to know the number of rows excluding the header and footers. I have the work around in =ROWS(ColumnG)-3, but is there a tidier way? I want to be able to add footers (or headers) too and not have these counted.
    Many thanks
    Lee

    Hi Lee,
    Add a column to your table (for purposes of this discussion, the new column is placed before column C, and becomes the new column C). enter the formula below in all regular cells, but NOT in header or footer cells:
    =1
    Use the formula below, placed anywhere (except in a regular cell in column C) to get the number of non-header, non-footer cells:
    =COUNT($C)
    The first formula will automatically be placed in cells added to column C, and the results will change to reflect the added rows.
    Regards,
    Barry

  • How can I count the number of values in one column which answer to a condition in another column?

    I'm using Numbers 3.2 and would like to count the names in a column which satisfy a condition in a different column. There are 3 "streams" through which these names have come to me, and I would like to easily identify how many have come from each stream. Any help?

    Hi DirtyDawg,
    COUNTIF is your friend here.
    If your source is in column C and your streams are 1, 2 and 3:
    =COUNTIF(C,"=stream1")
    =COUNTIF(C,"=stream2")
    =COUNTIF(C,"=stream3")
    These need to be in a footer or header row or in a different column than C.
    hope this helps,
    quinn

  • How can I get the number of computers that a specific user had add to domain?

    Greetings
    In Win Srv 2K8 I know how to increase\decrease the total number of computers that any user can add to domain.
    (http://support.microsoft.com/kb/243327/en-us)
    but there is any way to get the number of computer accounts that a user had add?
    thank you in advance

    Hi,
    Regarding your request, maybe we could use the 'ms-DS-CreatorSID' attribute to verify the computer number that a specific has joined to the domain. Please understand that for a
    computer account created by domain users, the account has 'ms-DS-CreatorSID' attribute to indicate the creator user. When a user adds a computer to the domain, a process enumerates the 'ms-DS-CreatorSID' attribute on every computer account in the domain and
    calculates if the sum exceeds the current quota for that user.
    The 'ms-DS-CreatorSID' and 'ms-DS-MachineAccountQuota' with default value 10 are also available in Windows Server 2008 AD DS.
    Note: The 'ms-DS-CreatorSID' attribute will be unset in the computer account that is pre-created in Active Directory Users and Computers MMC or joined by domain administrators.
    Auditing on the computers container should work for collecting information of joining computer into the domain.
    For details, please refer to the following similar thread.
    How to find computers joined by an user (ms-ds-creatorsid) using powershell
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/68db87d8-0890-4d23-af9f-4693ccc1074d/how-to-find-computers-joined-by-an-user-msdscreatorsid-using-powershell?forum=winserverpowershell
    Regards,
    Andy Qi
    Andy Qi
    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 can I count the number of pixels in a non-rectangular selection?

    I need to know the exact number of pixels that I select for a size comparison. It's a non-rectangular selection similar to a cloud.
    I'm using CS2 but could upgrade if needed.

    Thank You
    Michael D. Sutton
    (435) 723-3566
    (435) 720-2878
    [email protected]

  • How can i count the number of data patches in a numeric array

    Hi All

    BobLondn wrote:
    Can I build a 2d array where I can store on one column the index of each data patch and on the second column to store the length of elements of relevant data patch.
    Here's a quick example (LabVIEW 9.0) that stores the start index and length of all negative patches in a 2D array.
    (modified from this old code)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FindNegativeSegments.JPG ‏30 KB
    GetNegativeStretches.vi ‏16 KB
    FindNegativeSegmentsFP.JPG ‏52 KB

  • How can I count the number of cans of liquids that I packed in Production?

    Hello everyone,
    I used the production module to produce a paint mixture. The final formulation/mixture is batch managed upon release. Now that the final mixture is completed, I used the final mixture again as a child item together with 1-liter cans and 1-gallon cans, also as child items, to form the final product, where the liquid will be packed depending on how many 1-liter cans and 1-gallon cans issued to production. Once completed, I could not see where I could track how many 1-liter cans I have, or how many 1-gallon can I have. Where should I see this information?
    Thank you,
    Derrick

    Hi,
    If I've understood the scenario correctly then
    1. You have a Production BOM for Liquid Paint BOM which you receive from production.
    2. You have BOM for 1 Ltr Can as parent item and Liquid Paint as Child Item this way you convert Liquid Paint FG into 1 Ltr Can.
    3. Similarly you do the same for 1 Gallon Can.
    Now,
    4. You should create Sales type BOM for Package with 1Ltr Can and 1 Gallon Can as Child items. So you can check the inventory of cans at any moment.
    In Administration>System Initialization>Document Settings, select "Price and Total for Parent Item Only" in the option "For a Sales BOM in Documents, Display".
    Regards,
    Sibasish

  • Count the number of elements in an Arraylist

    My arraylist has these elements inside it.
    [house,tom:, agent,, person,, untidy,jack:, ordered,, tidy,, tiled,roof,tom:, agent,, person,,.....]. The list continues like this.
    How can I count the number of elements after each tom upto before each jack and same for all words after jack and upto before tom? [for example in the first case there are 3 words after tom and there are 4 words after jack.]
    Thanks

    don't collapse your lists together. They represent separate data entities and should be kept separate. Go check your [other thread|http://forums.sun.com/thread.jspa?threadID=5416414&tstart=0].
    Edited by: DeltaGeek on Nov 17, 2009 11:07 AM

  • Count the number of records between two key values (BTREE)

    How can I count the number of keys between two values?
    I'm using python driver, and BTREE access method.
    ====>
    ideally what I want is to average a whole time-series data set (the intervals can change) to a given number of points. The keys are the time stamps and the values are the data that needs to be averaged. I need to count the number of records between two time stamps so that I can divide that number by the number of points i need, and average the data. What is the best way to do this?  Or should I just keep the intervals for the time stamp constant and use RECNO access method?
    Thank you
    (first post btw.. and why aren't there many people in stackoverflow who answer Berkeley DB questions?)

    BDB is an embedded db and it does not have any internal counters or statistics that you could grap to use for this.    You will need to do it manually.
    You can create a cursor, grap the records you want, each time you get the next record you bump a counter.
    If you are using RECNO, you can use a cursor to get the record number of the record (DB_GET_RECNO), and if all you data is in
    sequentail records with no missing records you can figure out the total count by take last rec # - initial rec # + 1 to get a total count.
    If you switch over to the SQL API, you can issue a SQL query to give you a count.  Select count(*) Where .......
    Since you have to grab the data anyway, then best may be to count records as you go along.
    thanks
    mike

Maybe you are looking for

  • Query regarding database reorganization

    Hi All, I have been asked to reorganize the database( size 220GB Dev, size 460GB Qua, size 500GB Production) Database is Oracle 10G, SAP version is ECC 6.0. I tried this via BRtools on a test system(size 130GB,Oracle 10G) and nothing happens.Assuming

  • Undoing superscript shortcut

    Hi folks. I'm a high school science teacher so I use both superscripts and subscripts pretty often. I know the keyboard shortcuts to sub/superscripts but is there a keyboard shortcut to return the font to normal?

  • Exception in newInstance in windows NT (CORBA persistent server)

    I have used this code for CORBA persistent server....its working fine in Solaris OS ,but getting exception in newInstance call in the following code.Code fragment and Exception are given below,....pls help private org.omg.PortableServer.Servant loadM

  • How to set the actionname property in B2B 11g

    I have an outbound file sent via AS2 over http. I gather from other b2b forums/documents that for preserving the file name I have to set the actionname property. I have a BPEL process which is setting the fromTP, toTP, document TYPE etc, and then inv

  • Trying to use iDVD 4.0.1 with OS 10.6.6

    Hi I can't open iDVD 4.0.1 and I'm guessing it won't work with OS 10.5.6. Can you confirm this is the case? I only bought Leopard in order to run my new iPod. Now it seems I have to buy iLife just to burn a movie I've made in Final Cut. Is this right