Name

ageclass — This functions will convert an age to an age class category.

Syntax

ageclass(age, periodwidth)
              

The AGECLASS function has the following arguments:

age

The number or integer value of the age which you want to convert to an ageclass category.

periodwidth

The number or integer value of the number or years in the periods to be used for the ageclass categories.

Description

The ageclass function returns a category number representing the planning period that the age falls in to. The category is computed using the formula:

ac = floor((age-1.0) / periodWidth) + 1
                  

Examples

Formula

Description

Result

ageclass(2,5)

Age class for year 2 using a 5-year period width

1

ageclass(0,5)

Age class for year 0 using a 5-year period width

1

ageclass(5,5)

Age class for year 5 using a 5-year period width

2

ageclass(90,10)

Age class for year 90 using a 10-year period width

10

ageclass(99,10)

Age class for year 99 using a 10-year period width

10

ageclass(100,10)

Age class for year 100 using a 10-year period width

11