+ Reply to Thread
Results 1 to 12 of 12

Formula total of selected month in filter

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Formula total of selected month in filter

    Hello,

    See attachment worksheet sample.

    First, I need help to set the formula which will total the month that I select in the filter. Let say if I filter the month of January of 2023 that will give me only the total of the cell from D9 only for the January month. Then if I unfiltered by selecting all then it will return to the total including everything feb, march etc. in the column D9.

    Second, need also a formula in cell D2,D3,D4,D5 which I also need a total of how many banana, apple or orange total from cell C9 down. Same scenario above when I filtered for the month of January 2023 it will give me the total of how many banana, apple, orange was entered in the C9 and if I unfiltered then it will total up the entire total including all the months.

    I am not sure if it needed to have a message box to switch from filter to unfiltered or just a straight formula in cell.
    Greatly appreciated in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,822

    Re: Formula total of selected month in filter

    You can use this formula in D9:

    =SUBTOTAL(9,D9:D49)

    I'll have to think about part two of your question.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,961

    Re: Formula total of selected month in filter

    You have blank descriptions in Column C. How are these to be handled? What do they represent?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Hi Pete,
    The first formula works perfectly
    Please Login or Register  to view this content.
    Can you please work the second formula with the total of banana, apple....? Thank you in advance.

  5. #5
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Pete,
    This is what I have so far.
    Please Login or Register  to view this content.
    The code only work for the entire month but if I filter for specific month like January it does not add up for that month. See attachment.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Hello All,
    So far this is what I have but I needed to add to sum up when I filter the month. Let say If I filter the month of January 2023. The total for the month of January 2023 should be 11 but If I unfiltered then the total should be 14 including the Februayr 2023.

    Please Login or Register  to view this content.
    Please Help! Thank you in advance.
    Attached Files Attached Files

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,961

    Re: Formula total of selected month in filter

    Please respond to post #3

  8. #8
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Respond to this: You have blank descriptions in Column C. How are these to be handled? What do they represent?
    Sometimes, when I receive a report that when I type the data in. It can be blank sometimes until I received the report.

    Hope it answer this question.
    Thanks.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,961

    Re: Formula total of selected month in filter

    Using Power Query

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.

    Excel 2016 (Windows) 64 bit
    F
    G
    H
    2
    Month Name Column3 Totals
    3
    January BANANA
    54
    4
    January APPLE
    16
    5
    January PEACH
    13
    6
    February BANANA
    0
    Sheet: Jan 2023
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Wow! I think this is more confusing for me.

    Is there a code that will be similar to this:
    Please Login or Register  to view this content.
    I am thinking I could just separate and create a new column for just total for when I filter the month.

    I tried to add 9 to it as a filter but it did not work.

    Thank you

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,961

    Re: Formula total of selected month in filter

    If you follow the links and read a bit about PQ, you will find it is very straight forward and not at all confusing. However, if you are determined to stay on the formula program, then I wish you well. Good Luck.

  12. #12
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Formula total of selected month in filter

    Ok.. Thank you and to all.

+ 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. Getting the Total for the last entry for the selected month
    By cjtemple7273 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-04-2021, 11:32 PM
  2. [SOLVED] Need formula to calculate days used in month initiated in previous and selected month
    By Ochimus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2021, 05:54 AM
  3. Replies: 5
    Last Post: 12-08-2016, 04:24 AM
  4. [SOLVED] Need help tweaking current formula to sum up total hr's for each selected month.
    By ElmerFud in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-02-2016, 10:59 AM
  5. Replies: 1
    Last Post: 05-13-2015, 12:52 PM
  6. Formula to filter non-selected rows and update total sum without disappearing
    By aimeecrystalaid in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-05-2013, 11:37 PM
  7. Replies: 1
    Last Post: 11-22-2005, 11:15 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