+ Reply to Thread
Results 1 to 5 of 5

Thread: Counting for specific text in a cell

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    guelph
    MS-Off Ver
    Excel 2010
    Posts
    1

    Counting for specific text in a cell

    Hello all, great board;

    I have a list of items a user can select from a list. A short version is;

    Beef
    Sheep
    Corn
    Wheat
    Beats
    Ovine

    In one column we store the results of what they checked so we can have any combination of from the list. eg, [ Beef, Corn, Wheat ] in another row I'll have [ Corn, Sheep, Ovine ].

    I would like to be able to count the rows that have Corn or Wheat or Beats in them and have that row count as 1. I would also like to count the rows that have Beef or Sheep or Ovine in the them and have them count as 1.

    There's 30,000 rows and I would like to know how many have crops, and how many have livestock.

    I've tried =COUNTIF(V2:V30000,"*Wheat*")+COUNTIF(V2:V30000,"*Corn*")

    but I think I'm getting the row counted twice.

  2. #2
    Valued Forum Contributor
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    379

    Re: Counting for specific text in a cell

    Do you need the wildcards in the criteria? Try

    =COUNTIF(V2:V30000,"Wheat")+COUNTIF(V2:V30000,"Corn")

  3. #3
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,365

    Re: Counting for specific text in a cell

    Hi Nickalbu,

    Welcome to the forum.
    In your example, you want to count the rows as 1 which can have Beef, Corn, Wheat. So if I say that basis your data the count for the said category is 1 will that be fine and similarly 1 for other category set?
    I suggest you to put a sample scenario in a sheet and attached for better understanding of forum members. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,192

    Re: Counting for specific text in a cell

    Look formula in G1 (formulas in F column are for checking and can be removed)...

    I use numbers but same will be for words...
    Attached Files Attached Files
    "Relax. What is mind? No matter. What is matter? Never mind!"

  5. #5
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,447

    Re: Counting for specific text in a cell

    Hi Nickalbu, try this,

    =SUMPRODUCT(SIGN(ISNUMBER(SEARCH("corn",V2:V30000))+ISNUMBER(SEARCH("wheat",V2:V30000))))

    This will count 'wheat' or 'corn' contains, BUT if both 'wheat' or 'corn' contains in a cell will count as 1 NOT 2
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

+ 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.2.0