+ Reply to Thread
Results 1 to 4 of 4

formula or code to calculate age band

  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    formula or code to calculate age band

    I have Data table with Name, dob, gender, relation and age as per attachment. I also Have Table of Age Band

    I want to Formula or code insert age band in Column F as per age in Column E.

    e.g. cell E2 is 60 hence it fall under age band of 56-60
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: formula or code to calculate age band

    In F2, copied down:

    =VLOOKUP(E2,$H$2:$J$15,3,1)
    Last edited by AliGW; 08-12-2016 at 04:40 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: formula or code to calculate age band

    Excellent.

    I know Basic vlookup.

    Can you please explain me your code. How it works? Just for my knowledge.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,421

    Re: formula or code to calculate age band

    Quote Originally Posted by saravanan1981 View Post
    Excellent.
    Glad to help!

    Quote Originally Posted by saravanan1981 View Post
    I know Basic vlookup.

    Can you please explain me your code. How it works? Just for my knowledge.
    =VLOOKUP(E2,$H$2:$J$15,3,1)

    If you know basic VLOOKUP rules, then you will know that the formula is doing this:

    1. Comparing the value in E2 with the values in H2 to H15 and finding the best match (bigger or equal to E2).
    2. Taking the value from J2 to J15 that corresponds to the match in H and returning it as the answer.

    =VLOOKUP(lookup_value,lookup_array,column_in_array_with_return_value,approximate_match)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula or vba to assign a priceing band to UK postal code.
    By A440 in forum Excel General
    Replies: 15
    Last Post: 11-24-2015, 02:25 PM
  2. [SOLVED] Calculate UK school year band based on student d.o.b
    By M4rk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2015, 09:07 AM
  3. Age Band Formula
    By newbie13 in forum Excel General
    Replies: 4
    Last Post: 05-01-2008, 10:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1