Function for grouping range of data

S

supersonikk

Hi all,

Trying to group data of a bunch of kids going to lessons by age group, say
I've got data as follows, left column being the name of the kids and right
column actual age:

Kid 1 09
Kid 2 17
Kid 3 26
Kid 4 23
Kid 5 38
Kid 6 33
Kid 7 18
Kid 8 15
Kid 9 18

Is there a worksheet function to show in the next column as age group, i.e.
00-10
11-20
21-31
etc
 
J

John C

Somewhere, you need to define a table (I usually have a whole separate tab
for Tables, just makes it easier).

Your table would be set up something like this:

0.......'00-10
11.....'11-20
21.....'21-31
32.....'32-42
43.....'43+
I use the apostrophe to ensure Excel doesn't try to autoformat it.
I defined my table (Insert-->Name-->Define) as TblAge.

then, in the column next to the age (my example, cell C2, as column B has
the ages), type the following formula, and copy down as needed:
=VLOOKUP(B2,TblAge,2,TRUE)

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top