ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. Age Group Formula in Excel: Put Ages Into Bands

Age Group Formula in Excel: Put Ages Into Bands

By ExcelReady Team·Updated November 2, 2026·6 min read

The short answer

The simplest age group formula in Excel is IFS, tested from the youngest band up: =IFS(B2<18,"Under 18",B2<30,"18-29",B2<45,"30-44",B2<60,"45-59",TRUE,"60+"). For many bands, or bands that change, put the lower limits in a table and use =VLOOKUP(B2,$E$2:$F$6,2,TRUE). Then count each band with COUNTIFS.

Key takeaways

  • IFS checks the bands in order and stops at the first one that is true, so start with the youngest band.
  • Use < with the next band's lower limit (B2<30) so no age falls between two bands.
  • A band table with VLOOKUP and TRUE is easier to change than a long formula; sort the lower limits smallest first.
  • For equal 10-year bands, =FLOOR(B2,10)&"-"&FLOOR(B2,10)+9 builds the label for you.
  • Count people per band with COUNTIFS and two conditions, such as >=30 and <45.
On this page+
  1. The quick answer: an IFS age group formula
  2. How the bands work: order and boundaries
  3. Age groups with VLOOKUP and a band table
  4. Equal 10-year bands with FLOOR
  5. Get the age first if you only have a birth date
  6. Count how many people are in each age group
  7. Practise it

An age group formula in Excel turns an exact age, like 34, into a band, like 30-44, so you can count and compare groups in a survey, a customer list or an HR report. The quickest way is IFS. For bands that change often, a small lookup table with VLOOKUP is easier to maintain. This guide shows both, plus a one-line formula for equal 10-year bands and how to count each group.

The quick answer: an IFS age group formula#

IFS checks a list of conditions in order and returns the value for the first one that is true. For five age bands, type this in C2 and fill it down:

Excel formula
=IFS(B2<18,"Under 18",B2<30,"18-29",B2<45,"30-44",B2<60,"45-59",TRUE,"60+")

All the examples use this list:

ABC
1NameAgeAge group
2Rosa3430-44
3Tom17Under 18
4Aiko6260+
5Malik4545-59
6Jens2918-29
7Nadia3030-44
8Pete5845-59

For Rosa, 34 is not under 18 and not under 30, but it is under 45, so IFS returns 30-44 and stops. The last pair, TRUE,"60+", catches everything left, because TRUE is always true. IFS needs Excel 2019, Excel 2021 or Microsoft 365; the IFS function guide and the article on the IFS function cover the syntax.

How the bands work: order and boundaries#

The order of the tests matters. IFS stops at the first true condition, so start with the youngest band and work up. If you put B2<60 first, everyone under 60 would land in "45-59".

Each test uses less than the next band's lower limit. Look at the edges:

  • Jens is 29: 29 < 30 is true, so he is in 18-29.
  • Nadia is 30: 30 < 30 is false, 30 < 45 is true, so she is in 30-44.
  • Malik is 45: he moves up to 45-59.

Because each test starts where the last one ended, no age can fall into a gap or into two bands. Avoid labels that overlap, such as "18-30" and "30-45": a 30-year-old can't be in both.

In older Excel, nest IF functions in the same order. It works everywhere, but the brackets are easy to get wrong:

Excel formula
=IF(B2<18,"Under 18",IF(B2<30,"18-29",IF(B2<45,"30-44",IF(B2<60,"45-59","60+"))))

The same pattern turns test scores into letter grades; see the grade formula guide.

Age groups with VLOOKUP and a band table#

When you have many bands, or the bands might change, put them in a table and look them up. Each row holds the lowest age in the band and its label, sorted from smallest to largest:

EF
1FromGroup
20Under 18
31818-29
43030-44
54545-59
66060+

Then in C2:

Excel formula
=VLOOKUP(B2,$E$2:$F$6,2,TRUE)

TRUE turns on approximate match: VLOOKUP finds the largest "From" value that is less than or equal to the age. For 45 that's the 45 row, so the result is 45-59. For 30 it's 30-44. The $ signs lock the table so it stays put when you fill the formula down.

To change the bands, edit the table; every formula updates. Two rules: the first column must be sorted smallest first, and the first row must cover the lowest possible age (0 here), or young ages return #N/A. The VLOOKUP function guide and VLOOKUP approximate match explain the details. In Excel 2021 or Microsoft 365, =XLOOKUP(B2,$E$2:$E$6,$F$2:$F$6,,-1) does the same, and the table doesn't need to be sorted.

Equal 10-year bands with FLOOR#

If every band is the same width, you don't need a list of bands at all. FLOOR rounds a number down to a multiple you choose:

Excel formula
=FLOOR(B2,10)&"-"&FLOOR(B2,10)+9

For 34, FLOOR(34,10) is 30, so the result is 30-39. For 58 it's 50-59. The & joins the pieces into one label. Change both 10s to 5 for five-year bands. This is quick, but you can't make a special "Under 18" or "60+" group with it.

Get the age first if you only have a birth date#

Many lists hold dates of birth, not ages. Work out the age in a helper column first, then band it. With the birth date in B2 and the report date in H1:

Excel formula
=DATEDIF(B2,$H$1,"y")

DATEDIF with "y" returns the number of full years between the two dates. Use a fixed report date, not TODAY(), if the groups must match a report from a set day. The guide to calculating age and tenure covers months and days too.

Count how many people are in each age group#

Once each person has a band, count the bands. COUNTIFS with two conditions counts straight from the ages:

Excel formula
=COUNTIFS(B2:B8,">=30",B2:B8,"<45")

This returns 2 (Rosa and Nadia). Or count the labels in column C: =COUNTIF(C2:C8,"45-59") also returns 2 (Malik and Pete). Build a small summary table with one row per band, and the counts make a quick chart. The frequency table guide shows the full layout.

Watch for these common mistakes:

  • Ages stored as text. "34" as text is not less than 45, so the formula returns the wrong band. Convert the column with VALUE first.
  • Blank ages. A blank cell counts as 0, so it lands in "Under 18". Wrap the formula: =IF(B2="","",IFS(...)).
  • Labels turning into dates. If you type a label like 1-12 straight into a cell, Excel may change it to a date. Labels inside a formula's quotes are safe.

Practise it#

Banding values with IF, IFS and lookup tables is a favourite job-test task, because it checks logic and lookups at once. Practise nested IF and IFS in a live spreadsheet: you type the formula and it checks it instantly. Then build a band table in the VLOOKUP approximate match lesson, or try the exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

In C2, use IFS to put the age in B2 into a band: Under 18, 18-29, 30-44, 45-59 or 60+. Test the youngest band first and use TRUE for the last one.

fx
ABCD
1
Name
Age
Age group
2
Rosa
34
3
Tom
17
4
Aiko
62
5
Malik
45
6
Jens
29
7
Nadia
30
8
Pete
58
9
10
11

Tip: Pairs of test and label: B2<18,"Under 18", then B2<30,"18-29", and so on, ending with TRUE,"60+".

Practise this in a lesson

LessonNested IF and IFSHandle more than two outcomes, like letter grades or commission bands, with nested IFs or the cleaner IFS.LessonVLOOKUP approximate matchUse VLOOKUP with TRUE to place values into tiers like commission bands, tax brackets or grades.Function guideIFSReplace messy nested IFs with Excel's IFS function. Examples for grades, tiers and SLAs, the catch-all trick, and a live exercise.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

How do I group ages in Excel?

+

Add a column with a formula that returns the band for each age, such as =IFS(B2<18,"Under 18",B2<30,"18-29",TRUE,"30+"), and fill it down. Then count or summarise by that column with COUNTIFS or a PivotTable.

How do I write an age group formula with IF?

+

Nest the IFs from the youngest band up: =IF(B2<18,"Under 18",IF(B2<30,"18-29",IF(B2<45,"30-44",IF(B2<60,"45-59","60+")))). This works in every Excel version, including those without IFS.

How do I count how many people are in each age group?

+

Use COUNTIFS with a lower and upper limit, for example =COUNTIFS(B2:B8,">=30",B2:B8,"<45") for the 30-44 band. Or count the band labels with =COUNTIF(C2:C8,"30-44").

Can I make age groups in a PivotTable?

+

Yes. Put Age in the Rows area, right-click an age, choose Group, and set the start, end and band size, such as 10. This makes equal-width bands only.

Sources

  • IFS function - Microsoft Support
  • VLOOKUP function - Microsoft Support
  • COUNTIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. The quick answer: an IFS age group formula
  2. How the bands work: order and boundaries
  3. Age groups with VLOOKUP and a band table
  4. Equal 10-year bands with FLOOR
  5. Get the age first if you only have a birth date
  6. Count how many people are in each age group
  7. Practise it

Keep reading

Logic· 6 min read

Letter Grade Formula in Excel: IFS or a Lookup Table

To turn scores into letter grades in Excel, use IFS and test the highest grade first: =IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F"). For a scale you may change, put the minimum score for each grade in a sorted table and use VLOOKUP with TRUE: =VLOOKUP(B2,$E$2:$F$6,2,TRUE).

Dates· 6 min read

Calculate Age or Years of Service in Excel

To calculate age in Excel, use =DATEDIF(B2,TODAY(),"Y"), where B2 is the birth date. It counts complete years, so the age only goes up on the birthday. Years of service work the same way with the hire date. For a report that must not change, replace TODAY() with a fixed "as of" date cell.

Lookups· 7 min read

VLOOKUP Approximate Match for Tiers and Bands

A VLOOKUP approximate match uses TRUE as the 4th argument, like =VLOOKUP(B2,$F$2:$H$5,3,TRUE). It finds the largest value in the first column that is less than or equal to your number, so 62,000 lands in the band that starts at 50,000. The first column must be sorted from smallest to largest.

More on logic

  • AND, OR and NOT in Excel With IF
  • How to Calculate a Bonus in Excel With IF
  • The CHOOSE Function in Excel
  • Excel Comparison Operators: =, <>, >, <, >=, <=
  • What the Double Negative (--) Does in Excel Formulas
  • IF with AND in Excel: Check Two Conditions at Once
All logic articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free