# Formula for Statistics

#### KarinaSilich

##### New Member
Hi Everyone. I am new here so I hope I am doing the correct thing. I was wondering if someone could please help me with a problem I am having with my spread sheet for work? I will try and explain this as best I can so please stay with me OK I have column A and Column B. Column A has the sex of my employees and Column B has their ages. I require a formula that will add all the male's in column A plus wether they are >17 but <24. I thought the following formula's might work but the first is coming back as 0 and the second is saying #VALUE!...the first formula is =COUNTIFS(K2:L84,"Male",K2:L84,">17",K2:L84,"<24") or the second formula is =DCOUNTA(K2:L84,">17 <25","Male"). I kinda need the information to automatically populate when a new starter starts so my statics are correct but I am getting completely lost and very frustrated. Am I asking to much of Excel? Is it even possible? your help is very much appreciated everyone Karina

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
maybe something like this ?

Excel 2012
KLMN
1SexAgeCount
2male173
3male19
4female27
5male24
6male22

</tbody>
Sheet3

Worksheet Formulas
CellFormula
N2=COUNTIFS(K2:K6,"male",L2:L6,">17",L2:L6,"<25")

</tbody>

<tbody>
</tbody>

Oh My Goodness...that worked ))) one last question if I may. Do you have any idea how I am meant to add the number that is in the formula so that it is included in the count? for example =COUNTIFS(K2:K84,"male",L2:L84,">17",L2:L84,"<25") it counts everything that is in between >17 and <25 but it does not count 17 and 25. I really hope that makes some sense. Gosh you are a lifesaver )

Just add an equal sign to the formula Weazel gave you. See below:
Excel Workbook
KLMN
1SexAgeCount
2male174
3male19
4female27
5male24
6male22
Sheet

I do not know how to thank you both ) You have just saved me so much stress ) Thank you so very, very much )

Replies
1
Views
127
Replies
5
Views
151
Replies
7
Views
203
Replies
2
Views
154
Replies
6
Views
178

1,203,318
Messages
6,054,712
Members
444,743
Latest member
johncon60

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back