+ Reply to Thread
Results 1 to 7 of 7

Counting and formulas with text strings

  1. #1
    Registered User
    Join Date
    12-07-2012
    Location
    Houston, TX, USA
    MS-Off Ver
    Excel 2016
    Posts
    58

    Counting and formulas with text strings

    I am compiling the results of a survey and my cells are text. In the Gender column, I have Male and Female. I want a count of M's and F's. How do I get M to represent Male and F to represent Female. In another column I want to count the word struggles, and 3 other words. How do I do this? Thank you.
    Last edited by phillyfilly; 12-08-2012 at 06:59 PM. Reason: SOLVED. Thank you.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Counting and formulas with text strings

    if your M's and F's are in A1:A100, try this (adjust your ranges to suit):

    To get M's:
    =COUNTIF($A$1:$A$100,"M")

    To get F's:
    =COUNTIF($A$1:$A$100,"F")


    Of course, if "Male" or "Female" is in the cells, then use "Male" and "Female" in the formulas.

    - Moo
    Last edited by Moo the Dog; 12-08-2012 at 01:42 AM.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Counting and formulas with text strings

    if you are just wanting to count, as Moo assumes, then his suggestion is spot on. If on the other hand, you want to CHANGE the M's to Males and F's to Females, probably the easiest way would be to use find/replace ctrl H

    a slight twist on Moo's formula would be something like this, which you could also modify/add to to find your other 3 words...

    =COUNTIF($A$1:$A$100,"M")&" Males "&COUNTIF($A$1:$A$100,"F")&" Females"
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Counting and formulas with text strings

    Regarding the counting of 4 different words in a range, you could try something like this - again, adjust for your ranges:

    =SUM(COUNTIF(C2:H25,{"struggles","word2","word3","word4"}))

    That will total up the number of times those words appear in the range. If you want to total up each individual word separately, then you can use:

    =COUNTIF(C2:H25,"word1")

    - Moo

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting and formulas with text strings

    You also can use pivot table for that.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Registered User
    Join Date
    12-07-2012
    Location
    Houston, TX, USA
    MS-Off Ver
    Excel 2016
    Posts
    58

    Re: Counting and formulas with text strings

    Thank you.

  7. #7
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Counting and formulas with text strings

    Glad to help

    - Moo

+ 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