Change in Excel sum required

Posted on 2011-10-13
Last Modified: 2012-08-14
In the attached spreadsheet is a worksheet named 'Analyse' and in here is some sums.  I need to build into the sum a filter so that I can get more specific results.

In the worksheet named 'Master Sheet' column 'G' are some product codes and I would like to build into the sum the ability to be able to filter results by the start of a product code so that I can see specific results filtered by code.  I don;t want it to search by the whole code though so as an example I have two codes PJ5055DYEC & PJ5055DYEB, rather than the whole code I want to filter by PJ5055DYE as then I get the results for every code starting with these digits.

Any help greatly appreciated.
Question by:Simonrepro
    LVL 50

    Accepted Solution

    Hello Simonrepro,

    if you put the code (e.g. PJ5055DYE) in A1 on Analyse sheet then you can change B2 to this formula copied across and down

    =SUMPRODUCT(--('Master Sheet'!$J$2:$J$385=$A2),--(TEXT('Master Sheet'!$F$2:$F$385,"mmm-yy")=TEXT(B$1,"mmm-yy")),--(LEFT('Master Sheet'!$G$2:$G$385,LEN($A$1))=$A$1),'Master Sheet'!$H$2:$H$385)

    see attached

    regards, barry

    Author Closing Comment


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    VBA double quote escaping question 8 27
    Surpressing messages VBA 9 32
    Match Values and Return to Cell 6 19
    Copy a row 12 19
    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now