+ Reply to Thread
Results 1 to 5 of 5

Sum revenues by year

Hybrid View

  1. #1
    Registered User
    Join Date
    02-26-2007
    Posts
    22

    Sum revenues by year

    Is there a function that will sum all of the above entries IF a corresponding cell's (previous row) date is between a certain period?

    Im trying to get a sum of all revenue by year. I have a column with the date of the revenue, and then the next column has the revenue amount in it.

    Thanx Guys!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =SUMPRODUCT((YEAR($A$1:$A$2000)=2007)*($B$1:$B$2000))

    Note Sumproduct can be used for whole Column

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-26-2007
    Posts
    22
    That doesnt seem to be working. Im thinking I need some sort of SumIf statement, but I cant seem to get it right. Any other ideas?

  4. #4
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166
    This can be done one of two ways (See attached file to follow along):

    Book1.zip

    1) Use a SUMIF function:
    =SUMIF($A$2:$A$25,$A29,$B$2:$B$25)

    2) Use a CSE (Control+Shift+Enter) funtion (also called an array function):
    =SUM(IF($A$2:$A$25=$A29,$B$2:$B$25))

    *NOTE: you must press Ctrl+Shift+Enter for this to work, otherwise you'll get a #VALUE! Error

    Good luck!

  5. #5
    Registered User
    Join Date
    02-26-2007
    Posts
    22
    Sorry, I should have described my spreadsheet a little better. Those methods would work except that my dates are in mm/dd/yyyy format. I can always do a =Year() function in a seperate column, but it would look a little cluttered. Will the sumif() or the sum(if()) work with a full date?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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