ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count Text in Columns (https://www.excelbanter.com/excel-worksheet-functions/192162-count-text-columns.html)

Myjogli

Count Text in Columns
 
I've tried everything and can't seem to get this one.

I have a lot of different rows of text that I need counted a specific way.

I have written an M for a male and F for a female (there are other text
values as well).

I'd like to find some way to count all the M's and all the F's to see how
many Males and Females I have. Then I'd like to determine the % of Males to
Females. Anyway to do this all in one cell? Or is it easier to do it in
separate ones?

I also have number values that correspond to body parts, i.e. a 1 = Ankle, 2
= Knee, etc. So as I would like to count all the 1's to see how many Ankles
I have, and count all the 2's to see how many Knees I have, etc.

Thanks so much for your help, this one is really killin' me.

T. Valko

Count Text in Columns
 
Try these:

Count of males:

=COUNTIF(A1:A20,"M")

Count of females:

=COUNTIF(A1:A20,"F")

Percentage of males to females:

=COUNTIF(A1:A20,"M")/SUM(COUNTIF(A1:A20,{"M","F"}))

Format as Percentage

Count of body parts:

=COUNTIF(A1:A20,1)
=COUNTIF(A1:A20,2)

Adjust range to suit.

--
Biff
Microsoft Excel MVP


"Myjogli" wrote in message
...
I've tried everything and can't seem to get this one.

I have a lot of different rows of text that I need counted a specific way.

I have written an M for a male and F for a female (there are other text
values as well).

I'd like to find some way to count all the M's and all the F's to see how
many Males and Females I have. Then I'd like to determine the % of Males
to
Females. Anyway to do this all in one cell? Or is it easier to do it in
separate ones?

I also have number values that correspond to body parts, i.e. a 1 = Ankle,
2
= Knee, etc. So as I would like to count all the 1's to see how many
Ankles
I have, and count all the 2's to see how many Knees I have, etc.

Thanks so much for your help, this one is really killin' me.





All times are GMT +1. The time now is 07:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com