+ Reply to Thread
Results 1 to 5 of 5

Count non-exact matches in a cell range, dependent upon month and year

  1. #1
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Count non-exact matches in a cell range, dependent upon month and year

    I am attempting to use a SUMPRODUCT formula to count non-exact matches in a cell range, dependent upon the month and year in a list drop down.

    Please see attached.
    Book1.xlsx

    I am fine using exact matches with the following:
    Please Login or Register  to view this content.
    I thought the following would work but it doesn't:
    Please Login or Register  to view this content.
    Any help would be much appreciated.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Count non-exact matches in a cell range, dependent upon month and year

    I worked on this for a solid 20 minutes before the answer did a roundhouse kick out of my computer screen.

    You just need to concatenate the wildcards into your criteria.

    =SUMPRODUCT((Fruits!$B$2:$B$2000= "*"&Apple&"*" )*(TEXT(Fruits!$A$2:$A$2000,"mmm")=$F$4)*(YEAR(Fruits!$A$2:$A$2000)=$H$4)

    This works if you're trying to get all exact and non-exact matches.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Count non-exact matches in a cell range, dependent upon month and year

    Thank you for your time. Your wildcard suggestion works but not for the full formula.

    This produces the correct result for all data in the sheet: =COUNTIF(Fruits!$B$2:$B$2000,"*"&M6&"*") OR =COUNTIF(Fruits!$B$2:$B$2000,"*"&"apple"&"*")

    However it doesn't work in the sumproduct: =SUMPRODUCT((Fruits!$B$2:$B$2000="*"&"Apple"&"*")*(TEXT(Fruits!$A$2:$A$2000,"mmm")=$F$4)*(YEAR(Fruits!$A$2:$A$2000)=$H$4))

    I tried embedding the countif into the sumproduct but this just produced a figure I could not explain.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Count non-exact matches in a cell range, dependent upon month and year

    Hurray!

    =SUMPRODUCT(NOT(ISERROR(FIND(LEFT(M5,LEN(M5)-1),Fruits!$B$2:$B$2000)))*(TEXT(Fruits!$A$2:$A$2000,"mmm")=$F$4)*(YEAR(Fruits!$A$2:$A$2000)=$H$4))

    This automatically compares the Fruit name without the plural, finds all matches, etc.

  5. #5
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Count non-exact matches in a cell range, dependent upon month and year

    Perfect thank you. I would not have got that.

+ 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] count if date in another cell falls in certain month and year
    By ea223 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-18-2012, 07:17 PM
  2. Replies: 0
    Last Post: 08-11-2012, 03:25 PM
  3. Count exact matches in range
    By JuJuBe in forum Excel General
    Replies: 1
    Last Post: 03-09-2010, 08:13 PM
  4. Replies: 1
    Last Post: 06-17-2006, 09:10 PM
  5. count dates within range by year and month
    By Isaiah25 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-04-2005, 06:06 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