+ Reply to Thread
Results 1 to 9 of 9

How to simply sum the 1st 12 rows of a filtered result?

  1. #1
    Registered User
    Join Date
    11-22-2004
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 Family Subscrioption
    Posts
    9

    How to simply sum the 1st 12 rows of a filtered result?

    I would like to find the simplest way to sum the 1st 12 rows of a filtered result.

    The example here shows my list filtered for the "Gas" company. This results in a long list of several hundred rows.
    But I only want to sum the first 12 rows (12 months).

    But since the results of a filtered view is not a new table, Excel does not see the first 12 rows as Rows 1-12. Instead, it sees each row as the number it is in the unfiltered list.
    So it's impossible to use the simple sum function to add up the 1st 12 rows of the result.

    I really don't want to have to copy the data to a new tab just to add up 12 rows.... there must be an easier way!

    Can someone enlighten me?

    Thanks!!

    How to sum 1st 12 rows of Subtotal.jpg

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to simply sum the 1st 12 rows of a filtered result?

    Since you want to filter the year 2023 why not use the filter ['end with' ...23] to get the 12 months?

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: How to simply sum the 1st 12 rows of a filtered result?

    @DJ: one of the dates is in 2022.

    You could maybe use SUBTOTAL.


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: How to simply sum the 1st 12 rows of a filtered result?

    @Btmacdou: what version of Excel are you using?

  5. #5
    Registered User
    Join Date
    11-22-2004
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 Family Subscrioption
    Posts
    9

    Re: How to simply sum the 1st 12 rows of a filtered result?

    The reason I can't use "end with" is that I'm not filtering by date. I'm filtering by the description column or payor (like the gas company).

  6. #6
    Registered User
    Join Date
    11-22-2004
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 Family Subscrioption
    Posts
    9

    Re: How to simply sum the 1st 12 rows of a filtered result?

    I'm using the latest version of Excel that is included Office 365.

    I have attached an example excel file with a simple table of colors and numbers.

    It's easy to see the problem because if you set the filter to any color the result of a "SUM(C9:C21)" is always the same regardless of the filter results.

    -Btmacdou

    How to sum 1st 12 rows of Subtotal.xlsx

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: How to simply sum the 1st 12 rows of a filtered result?

    Please add your Excel version to your forum profile. Do this NOW.

    Change the SUM formula to this:

    =SUBTOTAL(109,C9:C21)
    Last edited by AliGW; 02-29-2024 at 03:50 AM. Reason: Typo fixed.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: How to simply sum the 1st 12 rows of a filtered result?

    Another way,

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to simply sum the 1st 12 rows of a filtered result?

    Do you want just the top 12 by position or the 12 biggest values?

+ 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] Get count of filtered rows and paste result in column
    By cyoder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2021, 04:45 PM
  2. Cell reference to filtered data auto update as Filtered result changes
    By Irajoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-22-2017, 02:17 AM
  3. [SOLVED] Macro to simply drag formula down to last active row - Rows are variable
    By sx200n in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2015, 10:15 AM
  4. [SOLVED] COUNTIFS on multiple rows, I simply can't work it out!
    By chrisandsally in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-05-2015, 10:01 PM
  5. Simply minus calculation, if the result is less than 0, then display 0
    By tiggi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2013, 02:18 PM
  6. [SOLVED] Macro to filter active ws in workbook and paste filtered result in "result" worksheet
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2012, 12:01 PM
  7. VBA programming: Simply trying to select cell-- or not so simply?
    By whiteliyl_111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-10-2005, 01:18 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