+ Reply to Thread
Results 1 to 11 of 11

Sumif with multiple criteria of text containing certain words

Hybrid View

  1. #1
    Registered User
    Join Date
    08-15-2016
    Location
    London
    MS-Off Ver
    MAC
    Posts
    3

    Sumif with multiple criteria of text containing certain words

    Hi all!

    I am currently working on a document where I would like to sum the monthly Google searches for certain group of words. For example, for a particular topic like brands, I have a long list of different brands and would like to add the volume searches of all of them.
    I am currently using the following formula:

    =SUM(SUMIF(A3:A1510,{"*best*","*reviews*","*top*","*good*","*recommended*","*effective*"},B3:B1510))

    As some of my lists are very long, I would like to avoid having to type each keywords.
    Also, these are not exact match but I am looking for all cells containing those words or expressions.
    Attached, you will find my file in case I did not explain it clearly enough!

    As I did not find the answer to my question while doing research online, I was hoping maybe you could help?

    Many thanks in advance!
    Attached Files Attached Files

  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 criteria of text containing certain words

    Try this for F51
    =SUMPRODUCT(SUMIF(A3:A1510,"*"&F3:F20&"*",B3:B1510))

    Note, there cannot e any blanks in F3:F20
    Unfortunately, that means you need to aqjust that range for the next formula in G51
    =SUMPRODUCT(SUMIF(A3:A1510,"*"&G3:G9&"*",B3:B1510))

  3. #3
    Registered User
    Join Date
    08-15-2016
    Location
    London
    MS-Off Ver
    MAC
    Posts
    3

    Re: Sumif with multiple criteria of text containing certain words

    Thank you so much Jonmo1 , works perfectly!!!!!

    This is going to save me so much time!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Sumif with multiple criteria of text containing certain words

    Here's my candidate entered as an array formula: =IF(ISBLANK(F3),"",SUMPRODUCT((ISNUMBER(FIND(F3,$A$3:$A$1510))=TRUE) * 1))
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  5. #5
    Registered User
    Join Date
    08-15-2016
    Location
    London
    MS-Off Ver
    MAC
    Posts
    3

    Re: Sumif with multiple criteria of text containing certain words

    Quote Originally Posted by dflak View Post
    Here's my candidate entered as an array formula: =IF(ISBLANK(F3),"",SUMPRODUCT((ISNUMBER(FIND(F3,$A$3:$A$1510))=TRUE) * 1))
    Hi dflak!

    Thanks a lot for helping!
    If I understand well, this one is to count the frequency of each of the expressions right?

  6. #6
    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 criteria of text containing certain words

    You're welcome.

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Sumif with multiple criteria of text containing certain words

    Yes, that is how I interpreted the request.

  8. #8
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Sumif with multiple criteria of text containing certain words

    Hi,
    Jonmo1 's formula sums up the same value several times
    Capture1.JPG

    Try this CSE formula
    Formula: copy to clipboard
    =IFERROR(SUMPRODUCT((MMULT(IFERROR(SEARCH(TRANSPOSE(criteria),$A$3:$A$1510),0),(ROW(criteria)/ROW(criteria)))>0)*$B$3:$B$1510),"")


    where "criteria" name is defined as follows: select cell F2 then, in Formulas TAB ►Name Manager ►Refers to: enter this
    Formula: copy to clipboard
    =OFFSET(Sheet3!F$3,,,COUNTA(Sheet3!F$3:F$50),1)

    Now, you can drag to right without changes


    see attached (in F2 my formula, in F51 Jonmo1 's formula)
    Columns C and D are only for verification, it can be removed
    Attached Files Attached Files

  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 criteria of text containing certain words

    @TudyBTH
    The formula you show as Jonmo1's formula is NOT the formula I posted.
    I think you've misunderstood what the OP wanted the formula to do, and what the formula I posted does.

  10. #10
    Forum Contributor
    Join Date
    05-06-2016
    Location
    Cluj, Romania
    MS-Off Ver
    2007-2010
    Posts
    220

    Re: Sumif with multiple criteria of text containing certain words

    @Jonmo1
    Hi Jonmo1,
    Open the file attached, in F51 I put your formula, the same formula of message #2
    Try this for F51
    =SUMPRODUCT(SUMIF(A3:A1510,"*"&F3:F20&"*",B3:B1510))
    because we obtained different results, I created two columns for verification, see columns C & D in attacehed file (msg #8).

  11. #11
    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 criteria of text containing certain words

    I see your point now.
    Though you had to change the OP's original data in A to reveal the issue.
    This may not be an issue in the OP's real data, given the original formula posted is stated to work as desired.

    So yes, it would count/sum a row multiple times if multiple criteria appear in that cell.
    However, we don't know if that's undesirable or not. Maybe the OP would want 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. SUMIF problem looking for specific words within text
    By james19 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-08-2016, 10:03 AM
  2. SumIF with multiple columns with non-specific text criteria
    By Funky_Finance in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-22-2014, 02:19 PM
  3. SUMIF or SUMIF's formula with multiple criteria
    By jackiemariee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-30-2013, 06:19 PM
  4. Replies: 4
    Last Post: 03-03-2013, 02:35 PM
  5. [SOLVED] SumIf / SumIfs with multiple Contains Text criteria
    By theweirdone in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2012, 05:22 AM
  6. SUMIF with multiple criteria, text and numerical
    By Radman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2008, 12:23 PM
  7. is there any way to have multiple TEXT criteria in a 'sumif' funct
    By datasorter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2006, 02:20 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