jeff.best
jeff.best

Reputation: 1

Cannot correctly input AVERAGEIF using age and gender

I am using Excel 2016 and I have 3 Columns in a spreadsheet:

Column A = Date of birth

Column B= Gender (values are either M or F)

Column C= Age (Age is determined by =DATEDIF(A1,TODAY(),"Y")

I am trying to get an average age by gender. I have tried =AVERAGE(IF(B:B="F",C:C)) which produces a value of 0 and =AVERAGEIF(B:B,"=F",C:C) which produces $NAME?.

Any help would be greatly appreciated.

Solved it. Thank you BigBen, correct input was AVERAGEIF(B:B,"F",C:C)

Upvotes: 0

Views: 235

Answers (1)

Quinn Haynie
Quinn Haynie

Reputation: 43

Couple of ideas for you, try

C1: ROUNDDOWN(YEARFRAC(A1,TODAY(),0),0)

and then for your average column

D2: =AVERAGEIF(B:B,"M",C:C)
E2: =AVERAGEIF(B:B,"F",C:C) 

Upvotes: 1

Related Questions