+ Reply to Thread
Results 1 to 5 of 5

CountIF help

  1. #1
    Registered User
    Join Date
    09-12-2016
    Location
    Bradenton Florida
    MS-Off Ver
    16
    Posts
    2

    CountIF help

    Hello everyone and thank you for taking the time to help me, My question is I am trying to figure out the probabilities of a coin flip that is flipped 4 times. I know there are 16 possible outcomes. here is my excel question.

    I am trying to count how many time the letter H appears 1 time, 2 times, 3 times in a cell. I am trying to use the CountIF b1:b16"*h*" and that works for counting the cells that have an H. My problem is I need to know how many cells contain 1 h, then how many contain 2 h's etc... I have done it manually but I need it in excel. Thank you in advance.

    John

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: CountIF help

    I think it would help to be clear exactly what you have. What does your input look like? It sounds like it is a single text string like "hhth" or "tthh" or similar, is that correct?

    If that is correct, my first thought is -- is there some external requirement that requires the input to be in a single cell like that? If I were doing this without restriction, I would enter the result of a single toss in a single cell. A group of four would then span across 4 columns. With each toss in its own cell, counting the h's (and t's if desired) is a very simply countif() function. Then, with that column of counts, another "frequency table" where I compute the frequency of the number of h's in sets of 4 (using either the frequency() function or a series of countif() functions)

    If I was required to enter the data as a single text string, my first step would probably be to separate the 4 character text string into 4 one character cells (probably using the MID() function), then proceed as above.

    Please Login or Register  to view this content.
    Your question focused on counting the number of H's in a set of 4. Note that the result of both examples I gave is 2. Is order important, or would these two sets of 4 be treated as equivalent in your analysis?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    09-12-2016
    Location
    Bradenton Florida
    MS-Off Ver
    16
    Posts
    2

    Re: CountIF help

    My Data is as follows,
    Results of coin flips
    HHHH THHH

    HHHT THHT

    HHTH THTH

    HHTT THTT

    HTHH TTHH

    HTHT TTHT

    HTTH TTTH

    HTTT TTTT

    Out of this I need to see what the probability of getting 1 H is 2 H's and so on. So I am trying the CountIF b1:b16"*H*" That counts all the cells with an H but I do not know how to restrict the value to 1 h or 2h's. Sorry for the confusion I hope that make more sense. I am new to excel so this is a bit challenging but fun to learn.

    Thank you for your help,

    John

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: CountIF help

    As I indicated, the approach I would likely take is to split the 4 character text string into 4 single character text strings. Whether you prefer to hand enter them in like that, or use the MID() function to split the text up. Did you understand how I used the MID() function to split the text up?

  5. #5
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: CountIF help

    You can use this formula :
    Please Login or Register  to view this content.

+ 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. [SOLVED] match # against row, countif -1 otherwise countif
    By jackf-nc in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2016, 12:15 AM
  2. Faster if/countif formula for flagging uniques - countif too slow
    By Speshul in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2015, 01:44 PM
  3. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM
  4. Combining a Date Range COUNTIF and a general COUNTIF
    By jacobtom in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 05:06 PM
  5. Adding a CountIF to a formula that is already Countif
    By Cmorgan in forum Excel General
    Replies: 4
    Last Post: 06-01-2011, 09:34 AM
  6. [SOLVED] COUNTIF or not to COUNTIF on a range in another sheet
    By Ellie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2005, 05:06 PM
  7. Countif w/ Multiple Criteria-How do I use countif
    By Patrick_KC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2005, 05:05 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