+ Reply to Thread
Results 1 to 7 of 7

Sum IF and Countif Combined based on Separate Sheets

  1. #1
    Registered User
    Join Date
    01-04-2016
    Location
    uk
    MS-Off Ver
    10
    Posts
    49

    Question Sum IF and Countif Combined based on Separate Sheets

    Hi All,

    I have an excel file with data in that is updated on a daily basis, I need to be able to review the last 5 sales within that data.

    I can do this manually with filters but wondered if there was a formula where I could pull the data automatically, even after adding new data?

    By playing around with sumif and countifs, I believe there must be a way, I just cannot work out how.

    Please see attached example.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sum IF and Countif Combined based on Separate Sheets

    I don't understand your results. If I filter the Data for Dave I see he has 1 Re-order, 4 First Sales and 3 Returned, vs your 0,2,3.

    Please clarify and add some more results.

    Have you considered a Pivot Table?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-04-2016
    Location
    uk
    MS-Off Ver
    10
    Posts
    49

    Re: Sum IF and Countif Combined based on Separate Sheets

    Hi Richard you're correct

    13/08/2016 Dave Returned
    14/08/2016 Dave FirstSale
    16/08/2016 Dave FirstSale
    20/08/2016 Dave FirstSale
    27/08/2016 Dave Reorder


    I had the filter set up wrong. Only looking for the last 5 sales

    So should be 1 Returned, 3 Firstsale and 1 Reorder.
    Last edited by formexcel; 01-06-2017 at 10:41 AM.

  4. #4
    Registered User
    Join Date
    01-04-2016
    Location
    uk
    MS-Off Ver
    10
    Posts
    49

    Re: Sum IF and Countif Combined based on Separate Sheets

    adding an updated excel with more examples.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,531

    Re: Sum IF and Countif Combined based on Separate Sheets

    This proposed solution employs a helper column (E) which could be moved for convenience and/or hidden for aesthetic purposes.
    The array entered formula* that populates the helper column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula that populates the table is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formulas are activated by simultaneously pressing the Ctrl, Shift and Enter keys while the cell is in edit mode.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sum IF and Countif Combined based on Separate Sheets

    Hi,

    I've added a Pivot Table solution which you may find gives you a lot more flexibility.
    I added a helper column to your data to identify the last 5 - it assumes the data is in ascending order of dates.
    I've also created a dynamic range name 'Data' which will automatically adjust to cater for new data.
    There's a one line macro which will refresh the Pivot Table every time you go to look at it. Hence this is a .xlsm file type

    Use the Slicers to filter the PT by Name or Sale Type and if you want to see all Sales not just the last 5 remove the Filter on the 'Last 5' slicer.
    Attached Files Attached Files

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sum IF and Countif Combined based on Separate Sheets

    ...and forgot to add that if you want the Sales Types in columns in the PT just drag the Sales Type field from the Row Labels area of the PT Field List to the Column Labels area.

+ 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. Trying to combined data from separate sheets
    By jeck876 in forum Excel General
    Replies: 3
    Last Post: 12-29-2015, 03:38 PM
  2. Separate and align rows from two separate sheets based on a cell value.
    By Sonny Crockett in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2015, 09:15 PM
  3. [SOLVED] Pulling Data from two separate sheets based on criteria on both those sheets
    By mlbdc2012 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2015, 03:57 PM
  4. Replies: 3
    Last Post: 11-09-2014, 11:09 AM
  5. Replies: 4
    Last Post: 11-22-2010, 12:57 PM
  6. Excel 2007 : Separate Combined Numbers and Text
    By bw1 in forum Excel General
    Replies: 3
    Last Post: 01-07-2010, 01:30 PM
  7. VLookup and Hlookup combined using separate workbooks
    By trentonm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2008, 03:18 PM

Tags for this Thread

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