+ Reply to Thread
Results 1 to 6 of 6

Filtering a table by dates, then having it count only specific cells and total amount

  1. #1
    Registered User
    Join Date
    11-09-2019
    Location
    United States of America
    MS-Off Ver
    Office 365
    Posts
    3

    Filtering a table by dates, then having it count only specific cells and total amount

    Hello, I am new to this forum and been trying to figure this out for hours. I have searched google for possible solutions but can't seem to come up with the right formula. I am trying to have my credit card statement in excel table, that simply shows date, price, retail store, and type of purchase. I attached a sample version of the table, I hope it shows what I am trying to do. I want to be able to have it filtered by dates so it shows only purchases made during current statement. I know how to filter it to get what I want visible, but I can't figure the formula for the next part. I want it to add together the total "price" of the "type of purchases" that cells are only visible and not the whole worksheet. Right now the code I have as seen below will calculate the sections for the entire workbook whether the cells are visible or not depending on dates selected. From the second table, I will use these to create a pie chart that shows how the current statement money is divided, that way I can see how my money is being divided and where, Which I have the pie chart currently displaying the what I get from the equation below.

    The code I have been trying to get correct but haven't is: =SUMPRODUCT(D2:D169,SUBTOTAL(109,OFFSET(C2,ROW(D2:D169)-ROW(D2:D169),,1))--(C2:C169="Costumes"))

    Any help would be greatly appreciated. Thanks in advance!

    Date Retail Store Type of Purchase Price
    9/17/2019 Party City Costumes $29.94
    9/18/2019 Walmart Grocery $68.05
    9/18/2019 Sapp Bros Snacks $3.73
    9/19/2019 Casey's Gas $30.59
    9/19/2019 Hy-Vee Grocery $15.67

    Costumes =SUMPRODUCT(D2:D169,SUBTOTAL(109,OFFSET(C2,ROW(D2:D169)-ROW(D2:D169),,1))--(C2:C169="Costumes"))
    Grocery $83.72
    Snacks $3.73
    Last edited by Tigershark007; 11-10-2019 at 11:20 AM. Reason: Took out pictures and added tables, and reworded post to make clearer I hope.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Filtering a table by dates, then having it count only specific cells and total amount

    Hi
    please read the yellow banner....

  3. #3
    Registered User
    Join Date
    11-09-2019
    Location
    United States of America
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Filtering a table by dates, then having it count only specific cells and total amount

    I have removed the attached pictures and added tables and tried to make it clearer to understand. I hope someone can help!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Filtering a table by dates, then having it count only specific cells and total amount

    You could put the start & end date of the current period into two cells & use

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Date Retail Store Type of Purchase Price
    01/09/2019
    30/09/2019
    2
    17/09/2019
    Party City Costumes
    29.94
    Costumes
    29.94
    3
    18/09/2019
    Walmart Grocery
    68.05
    Grocery
    83.72
    4
    18/09/2019
    Sapp Bros Snacks
    3.73
    Snacks
    3.73
    5
    19/09/2019
    Casey's Gas
    30.59
    6
    19/09/2019
    Hy-Vee Grocery
    15.67
    Sheet: Lookup

    =SUMIFS($D$2:$D$6,$A$2:$A$6,">="&$G$1,$A$2:$A$6,"<="&$H$1,$C$2:$C$6,$G2)

  5. #5
    Registered User
    Join Date
    11-09-2019
    Location
    United States of America
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Filtering a table by dates, then having it count only specific cells and total amount

    That works amazing! Thank you! I was wondering based on the end arguments of like $A$6 or $C$6 in your example. Is there a way to phrase this so that will continue to automatically increase every time I add another row for another purchase? That way I don't have to keep going into the formulas each time and adding the next cell? Or when I say insert new row, will it automatically update it as it moves the the cells down when new row is inserted?

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Filtering a table by dates, then having it count only specific cells and total amount

    As it's a SUMIFS you can use whole column references like
    SUMIFS($D:$D,$A:$A,">="&$G$1,$A:$A,"<="&$H$1,$C:$C,$G2)

+ 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. Calculate 10% up to a specific total amount is reached and then stop
    By rhelms01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2019, 04:10 PM
  2. Count the amount of consecutive dates
    By zuprex in forum Excel General
    Replies: 2
    Last Post: 02-09-2017, 01:39 PM
  3. show total amount invoiced per job number between 2 dates
    By TERRYJOHNMATTHEWS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-25-2016, 04:48 PM
  4. [SOLVED] subtract from a specific amount but keep total in same cell?
    By michaelDDW in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-03-2015, 08:37 PM
  5. [SOLVED] Subtract dates to give a total amount of days - Multiple Data
    By t_man000 in forum Excel General
    Replies: 2
    Last Post: 07-23-2015, 11:14 PM
  6. Pivot table/chart: Filtering specific cells without removing whole row
    By AndyPandy in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-12-2015, 10:19 AM
  7. Find cells in a column that total specific amount
    By Donpa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2010, 08:16 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