# excel micros (1 Viewer)

#### mahen

##### Registered User.
would need a micro to group ages by entering the date of birth.Under 8 - Date of birth (DOB) on or after 1st Sept 1998Under 10 - DOB between 1st Sept 1998 and 31st Aug 2000Under 12 - DOB between 1st Sept 1996 and 31st Aug 1998Under 14 - DOB between 1st Sept 1994 and 31st Aug 1996Under 16 - DOB between 1st Sept 1992 and 31st Aug 1994Under 19 - DOB between 1st Sept 1989 and 31st Aug 1992Under 25 - DOB between 1st Sept 1983 and 31st Aug 1989Over 25 - DOB on or after 1st sept 1983 Under 30 - DOB between 1st Sept 1978 and 31st Aug 1983Under 35 - DOB between 1st Sept 1973 and 31st Aug 1978Under 35 - DOB between 1st Sept 1973 and 31st Aug 1978Under 40 - DOB between 1st Sept 1968 and 31st Aug 1973Over 40 - DOB on or after 1st sept 1968So when you enter the date of birth it should give the age group.Thank you.

#### Brianwarnock

##### Retired
Something along the lines of

Public function fagegroup(DOB as date) as integer

If Dob >= #1/september/1998# then
fagegroup = 8
ELSEIF DOB > #1/september/1998# and dob <= #whatever then
fagegroup =10
elseif etc

end function

#### mahen

##### Registered User.
Brian,Thank you. I will have a go. Do I need a table to cover all the ranges?regards, - Mahen

#### mahen

##### Registered User.
Brian,Doesn't seems be wokring. Can you enter two lines in an excel sheet and send please. I will do the rest. Thanks- Mahen

#### Brianwarnock

##### Retired
The attached shows 3 methods.

I think that the 1st date range in post 1 was incorrect

Under 8 - Date of birth (DOB) on or after 1st Sept 1998

Should be

Under 8 - Date of birth (DOB) on or after 1st Sept 2000

Brian

#### Attachments

• mahen.xls
36 KB · Views: 73

#### mahen

##### Registered User.
Brian,I will check and come back to you. Thanks a lot.

Replies
4
Views
103
Replies
5
Views
78
Replies
16
Views
3,042
Replies
16
Views
423
Replies
9
Views
393