+ Reply to Thread
Results 1 to 4 of 4

SUMPRODUCT contains text, using asterisk

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    SUMPRODUCT contains text, using asterisk

    Let's say I have two columns:
    Homeless (column A) & Services (column B)

    Homeless responses can be either "Y" or "N". Service can be "a", "b", or "ab"

    Here is an example:

    Homeless Service
    y a
    y b
    n a
    y ab

    I was hoping to use SUMPRODUCT to calculate clients who are homeless and receiving "a" service. I want to be able to calculate those receiving "a" service even if they are receiving "b" service, so I attempted to use asterisks like I have used prior with the COUNTIF function. Here is what I thought would work:
    =SUMPRODUCT((A2:A5="y")*(B2:B5="*a*"))

    And I expected it to return 2, but I found that I couldn't get the SUMPRODUCT to work with asterisks.

    I am able to get the results I want be creating a new column to sort the services into just those who are homeless and then using COUNTIF, but I'd rather come up with a more streamlined approach.

    Thanks in advance for any help.
    Last edited by commander1; 11-09-2009 at 02:07 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT contains text, using asterisk

    Try

    =SUMPRODUCT((A2:A5="y")*(ISNUMBER(SEARCH("a",B2:B5))))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: SUMPRODUCT contains text, using asterisk

    That worked perfectly! Now I must learn more about the ISNUMBER and SEARCH functions and take my Excel skills to the next level.

    Thanks!

  4. #4
    Registered User
    Join Date
    11-09-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: SUMPRODUCT contains text, using asterisk

    I just wanted to let you know that I read about those two functions and I completely understand how those functions work now and produce the results I wanted. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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