+ Reply to Thread
Results 1 to 3 of 3

Nested CountIF

Hybrid View

  1. #1
    Registered User
    Join Date
    06-14-2010
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    70

    Nested CountIF

    I have a tab full of data and want to create a formula that will search 2 cells within each row to search for specific words.

    I was using a formula (when I only had one word I needed to search for):

    =IF(COUNTIF(G2:H2,"*cloud*"),"cloud","")
    However, now I need to create a new column which will look in the same 2 columns but for other words. I tried to use a nested IF(CountIF formula, but no luck.

    Oranges
    Apples
    Pears
    Cranberries
    Pumpkins

    Ultimately, I want to look in G2&H2 and if any of those words appear, I'd like the formula to return the word "Fruit", otherwise, leave the cell blank. Thanks very much for your help.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Nested CountIF

    Koda7,

    Give this a try:
    =IF(SUMPRODUCT(COUNTIF(G2:H2,"*"&{"oranges","apples","pears","cranberries","pumpkins"}&"*")),"Fruit","")
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-14-2010
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Nested CountIF

    thanks so much! Worked like a charm!

+ 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