+ Reply to Thread
Results 1 to 8 of 8

Count most recent 12 values in a column that are >0 when values are added monthly

  1. #1
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Count most recent 12 values in a column that are >0 when values are added monthly

    Hi,
    I have a list of monthly investment returns in a column. I'm looking for a formula that will count the number of positive returns for most recent 12 months, such that when I add data in subsequent months, the formula will still work. I can do this with helper columns but it would be much more efficient to use a single formula.
    Any help would be appreciated.
    Thanks,
    Phillycheese
    Last edited by Phillycheese5; 09-03-2014 at 04:32 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    An example would be nice.
    Absent that....
    With A1:V5 containing this list:
    Please Login or Register  to view this content.
    This regular formula, copied down, begins summing the last up-to-12 positive values in the row
    Please Login or Register  to view this content.
    In that example, these are the results:
    492
    415
    340
    367

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Hi Ron,
    Thanks for the reply. I'm looking to get a count for the data that is arranged in more of a column structure than across the row. I'm attaching a spreadsheet where you can see at the bottom I'll continue to add months to the dataset. Maybe the formula you provided could be adapted?
    Thanks,
    Phillycheese
    Attached Files Attached Files

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Using your posted workbook, this regular formula returns the count of positive values in the last 12 entries
    Please Login or Register  to view this content.
    In your sheet, that formula returns: 9

    Is that something you can work with?

  5. #5
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Ron,
    That works great, thanks!
    I appreciate the help!!
    Phillycheese

  6. #6
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Hello!
    The above formula works great, until I tried to adapt it slightly by doing two things:
    ---adjusting the index reference from the entire column to the range above my computations
    ---creating a version that counts the most recent negative values for the most recent 12, 36, 60 months
    I have attached a file where I am trying to get the formulas (highlighted in orange) to match the results which are highlighted in green.
    I'd appreciate any help.
    Thanks,
    Phillycheese
    Attached Files Attached Files

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Got it...
    The formulas in your workbook are looking for the last 12 value >0...but you want to count the non-blank cells. Consequently, we need to skip the header row and use these formulas (and copy them across to the right):
    Please Login or Register  to view this content.
    Does that help?

  8. #8
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Count most recent 12 values in a column that are >0 when values are added monthly

    Ron,
    That solves the issue!
    Thank you so much!!
    Phillycheese

+ 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. Count Unique values in Column based on values in other columns
    By dmschave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2014, 11:06 AM
  2. Replies: 10
    Last Post: 07-16-2013, 03:19 PM
  3. Replies: 3
    Last Post: 04-24-2013, 05:33 PM
  4. Replies: 1
    Last Post: 04-24-2013, 05:21 PM
  5. Replies: 3
    Last Post: 06-10-2010, 11:54 AM

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