+ Reply to Thread
Results 1 to 9 of 9

SumIF with multiple columns with non-specific text criteria

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    SumIF with multiple columns with non-specific text criteria

    Hi all,

    Long time lurker but first time poster after finally registering. I am having an issue using SUMIF...

    Column D has people's full names (ex. "KAPLAN BARRY M"). Columns G:R contain numbers. For every instance that "KAPLAN BARRY M" exists in D, I want to sum the values in G:R.

    Here is the kicker...the data in excel is aggregated from multiple sources, so "KAPLAN BARRY M" could also be "BARRY M KAPLAN" or "KAPLAN, BARRY M" for instance. Therefore, I tried using the formula below, to "search" by last name. I know the issue lies within the astericks on either side of the name. Any suggestions?


    =SUMPRODUCT(($D$4:$D$4388="*KAPLAN*")*$G$4:$R$4388)

    TIA,
    Lou

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SumIF with multiple columns with non-specific text criteria

    Sumproduct doesn't work with wildcards like that.

    Try
    =SUMPRODUCT((ISNUMBER(SEARCH("Kaplan",$D$4:$D$4388)))*$G$4:$R$4388)

    Change Search to Find if it needs to be case sensitive.

  3. #3
    Registered User
    Join Date
    01-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SumIF with multiple columns with non-specific text criteria

    That worked, thanks! Now to the more important part...actually understanding what the formula provided is doing.

    Within column D, the formula searches for "Kaplan". The search function provides a number for where the text "Kaplan" begins if it exists in a cell, resulting in a TRUE statement from ISNUMBER. Anywhere we get a TRUE, the SUMPRODUCT sums the corresponding columns (G:R). Am I on the right track?

    Quote Originally Posted by Jonmo1 View Post
    Sumproduct doesn't work with wildcards like that.

    Try
    =SUMPRODUCT((ISNUMBER(SEARCH("Kaplan",$D$4:$D$4388)))*$G$4:$R$4388)

    Change Search to Find if it needs to be case sensitive.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SumIF with multiple columns with non-specific text criteria

    You're welcome.

    And that is pretty much exactly what it does.

  5. #5
    Registered User
    Join Date
    01-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SumIF with multiple columns with non-specific text criteria

    Ok, great. I will have a second part to this question once I get through this workbook. I hope I can pick your brain a bit more!

  6. #6
    Registered User
    Join Date
    01-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SumIF with multiple columns with non-specific text criteria

    Ok, part dos.


    Let's say Barry's name is displayed in the following 3 ways:
    KAPLAN, BARRY M
    KAPLAN BARRY M
    KAPLAN BARRY

    Let's also say there are two "false positives" that get picked up in the formula above due to someone having the same last name:
    KAPLAN ANDREA
    KAPLAN FRED

    How could I go about adjusting that formula so only Barry's data is summed in columns G:R and not Andrea or Fred's?

    See attachment:
    Book4.xlsx

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SumIF with multiple columns with non-specific text criteria

    We can just add another criteria for the first name, just like for the last name

    =SUMPRODUCT((ISNUMBER(SEARCH("Kaplan",$D$4:$D$4388)))*(ISNUMBER(SEARCH("Barry",$D$4:$D$4388)))*$G$4:$R$4388)

  8. #8
    Registered User
    Join Date
    01-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: SumIF with multiple columns with non-specific text criteria

    I never realized it was that easy. Thanks again, rep added.

    Quote Originally Posted by Jonmo1 View Post
    We can just add another criteria for the first name, just like for the last name

    =SUMPRODUCT((ISNUMBER(SEARCH("Kaplan",$D$4:$D$4388)))*(ISNUMBER(SEARCH("Barry",$D$4:$D$4388)))*$G$4:$R$4388)

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: SumIF with multiple columns with non-specific text criteria

    Your welcome.

+ 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. Sumif for multiple criteria in one row and two columns
    By ersterli in forum Excel General
    Replies: 3
    Last Post: 08-10-2011, 07:19 AM
  2. Replies: 4
    Last Post: 05-04-2010, 02:25 PM
  3. SUMIF with multiple criteria, one criteria a specific string
    By Weasel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-03-2008, 05:32 PM
  4. [SOLVED] SUMIF with multiple criteria, by columns
    By Question in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2006, 12:30 AM
  5. SUMIF with multiple criteria for multiple columns to sum a single
    By SavageMind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2005, 11:05 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