Results 1 to 5 of 5

Thread: NEED A Code for my Excel sheet to calculate year total for each items in the list.

  1. #1

    Post NEED A Code for my Excel sheet to calculate year total for each items in the list.



    Register for a FREE account, and/
    or Log in to avoid these ads!

    hi everyone,

    i need a VBA code for my sheet. and in that sheet i need the sum of each items year qty, i have attached a example sheet to this request. in this sheet i have three items in the first columns and there value are given in date wise columns. i need a code to add the values of each item for each year. please have a look and suggest me a code.
    Attached Files Attached Files

  2. #2
    It sounds pretty basic. However, I can't open your file because I'm stuck at office 2003.
    If you could repost with a .xls file, I could help.

  3. #3
    Hi Dave,

    i am uploading the 2003 version of the file so that you can see.
    Attached Files Attached Files

  4. #4
    Conjurer CheshireCat's Avatar
    Join Date
    Dec 2011
    Location
    Victoria, Canada
    Posts
    121
    Articles
    0
    Excel Version
    Microsoft Excel 2013
    No need for VBA, a formula will do the job.

    In cell B11 paste:

    Code:
    =SUMPRODUCT(--(YEAR($B$1:$H$1)=B$10),INDEX($B$2:$H$4,MATCH($A11,$A$2:$A$4,0),0))
    Copy/autofill across & down.

  5. #5
    Thanks a lot it is solving my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •