+ Reply to Thread
Results 1 to 4 of 4

Sumproduct with Year Function

  1. #1
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    Sumproduct with Year Function

    Hello,

    I am trying to formulize column G7:G16. In the column now are the numbers I would expect to return. I want to know what purchases I still hold going into the year in column E. Essentially, any position that I held on the last day of the prior year is what I would go into the new year with. Column B are purchases I made, and column c would be the exit date if I exited. In column Z, I have a formula that produces similar results that I want, but by month. This could help as a starting reference.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Sumproduct with Year Function

    Try this:

    G7 =IFNA(LOOKUP(2,1/(YEAR(Y$7:Y$105)=E7-1),Z$7:Z$105),"-")

  3. #3
    Forum Contributor
    Join Date
    07-21-2013
    Location
    washington dc
    MS-Off Ver
    365 MSO
    Posts
    473

    Re: Sumproduct with Year Function

    Thank you, this returned the correct results. Can you explain each part of your formula to help me better understand how it works.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Sumproduct with Year Function

    You're welcome.


    =LOOKUP(2,1/(criteria),return) is a common way of returning the last instance of a criteria match.

    The criteria here was that the year of Y$7:Y$105 was equal to the year before the year from column E.

    The formula then finds the last instance of that match and returns the value from Z$7:Z$105 that is in the same row.

    Since there are no instances where YEAR(Y$7:Y$105) = 2008, the formula would return #N/A in cell G7. IFNA takes care of this by replacing #N/A with -.


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks for the rep!
    Last edited by 63falcondude; 01-25-2018 at 01:39 PM. Reason: Rep added

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] sumproduct to count year values in range based on another cell year value
    By mr_mango81 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-04-2017, 12:46 AM
  2. [SOLVED] Adding YEAR function to Sumproduct(Subtotal(
    By Seve in forum Excel General
    Replies: 7
    Last Post: 05-12-2016, 08:16 AM
  3. sumproduct for 1 year
    By ammartino44 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-21-2014, 07:34 PM
  4. sumproduct+countifs+month year function does not work
    By apskhinda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2013, 07:01 AM
  5. [SOLVED] SumProduct by year Issue
    By JO505 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-03-2013, 06:28 PM
  6. Sumproduct for year totals
    By wnstar21 in forum Excel General
    Replies: 2
    Last Post: 09-08-2009, 04:03 PM
  7. sumproduct in a given year
    By Bumblebee in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-19-2006, 02:05 PM

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