9 Replies Latest reply: Feb 25, 2016 3:50 PM by Ankit Luthra

# Calculating %Female out of Total

Hello,

I am trying to calculate % of females out of my total population. My excel file has columns like Name, ID,....... Gender, etc. and each ID has a gender (male or female).

I tried applying the following formula but it's not working:-

Sum([Gender]={'Female'}) / Sum([Gender]={'Female'}) + Sum([Gender]={'Male'})

Thoughts?

Thanks!

Ankit

• ###### Re: Calculating %Female out of Total

Try this:

Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT ID)

UPDATE: Added DISTINCT in case you have duplicate IDs and you don't want to count them twice

• ###### Re: Calculating %Female out of Total

Hi Sunny,

Thanks for your quick response. Appreciate it!

So, I am trying to show the percentage in a Gauge chart, and the formula still doesn't seem to be working. Here's a snapshot of what I am seeing. I know my data and it should show 49.30% but it shows 0.50%

Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT ID)

Am I doing something wrong?

Thank you!

Ankit

• ###### Re: Calculating %Female out of Total

Are there places where Gender is not filled in?

May be try this:

Count(DISTINCT {<Gender = {'Female'}>}ID)/Count(DISTINCT {<Gender = {'Female', 'Male'}>}ID)

• ###### Re: Calculating %Female out of Total

Silly me. This formula is perfect. I just added *100 at the end to make it a percentage to make it work. The needle does show the correct female representation now.

Thanks a lot!

Ankit

• ###### Re: Calculating %Female out of Total

Count([Gender]={'Female'} PersonField) / (Count([Gender]={'Female'} PersonField) + Count([Gender]={'Male'} PersonField))

*/ precedes +-

• ###### Re: Calculating %Female out of Total

But is the syntax correct Clever? I have never seen a syntax like that before.

• ###### Re: Calculating %Female out of Total

sorry, sunny, I´ve didn´t checked this, only noted /- precedence

Count({<[Gender]={'Female'}.>} PersonField) / (Count({<[Gender]={'Female'}>}PersonField) + Count({<[Gender]={'Male'}>}PersonField))

• ###### Re: Calculating %Female out of Total

No sorry needed my friend. I was just wondering if this syntax actually works

• ###### Re: Calculating %Female out of Total

Thanks for pitching in, Clever! Appreciate it.

Cheers!
Ankit