+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    03-31-2009
    Location
    Biggleswade, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    using YEAR and MONTH together

    Hi,

    i'm trying to update a spreadsheet i created at the beginning of this year. the sheet summarises another workbook that records all of the jobs carried out by my company (we repair cranes and excavators).

    currently the summary sheet is set up to only treat the workbook as containing data from a single year, but as we creep up to the new year, i need to find a way of getting the summary to pick out data relevant to a specific year.

    if you take a look at the example workbook that i have included you'll see that the first sheet summarises data from the second sheet in a few ways. specifically, row 5 contains formulas for calculating the value of jobs closed in certain months. however, the forumla currently adds together all values from all years as long as they are within the particular month. how can i rewrite this formula so that it only adds together the values from a certain month in a certain year?
    Attached Files Attached Files

  2. #2
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: using YEAR and MONTH together

    Hi,

    since you're already using the SUMPRODUCT function, simply add another criterion, like

    =SUMPRODUCT(--(MONTH(Date_Closed)=MONTH(B1)),--(YEAR(Date_Closed)=YEAR(B1)),Value)
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  3. #3
    Registered User
    Join Date
    03-31-2009
    Location
    Biggleswade, England
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: using YEAR and MONTH together

    thanks, that appears to be exactly it.

    i knew it would be simple, but i just couldn't get the syntax right. i was trying too hard to get them to be in the same criteria needlessly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0