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.
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?
Bookmarks