I'll be honest with you, an easier way to do it would be to use a Pivot Table. See my attached file for an example.
If you absolutely need to use formulas, then with some array formulas, you can get the data you need as well.
Formula modifications: If numbers are in A2:A6:
Enter this ARRAY formula in B2 and fill down (Array formulas are applied with Ctrl + Shift + Enter, instead of just Enter):
Then enter this ARRAY formula in cell C2 and fill down (Again, Ctrl + Shift + Enter):
You can take a look at my attached sheet for both examples.
- Moo
Bookmarks