+ Reply to Thread
Results 1 to 7 of 7

Matching a number in a column and returning a value from another column

  1. #1
    Registered User
    Join Date
    03-28-2016
    Location
    California
    MS-Off Ver
    2007
    Posts
    43

    Matching a number in a column and returning a value from another column

    Hi there.

    I'm new to the site and frankly, new to Excel. Or at least I haven't used it in more than 10 years.

    I have a workbook with two sheets in it. On the first sheet I have a list of employees with birthdates, deduction rates (empty column) and other information, and on the second sheet I have a list of deduction rates by age given by the carrier (I work for an Insurance company). I need to fill the Deduction Rates column on sheet 1 with the corresponding data from sheet 2. The problem is, I have 453 employees and would take me hours to do it manually.

    What I need to do is work on a formula that:

    1- Reads date format in a column on sheet 1
    2- Transforms date format into age, relative to current year 2016
    3- Search on a column on sheet 2 the age that matches for that specific row
    4- Writes on an empty cell at a designated column the matching deduction rate for that age on sheet 2.

    Hopefully I'm explaining myself clear enough.

    I really don't know how to do this or even if this can be done in Excel.

    I'm running Excel 2007 on this computer.

    Any help would be really appreciated.

    Thanks!

    Andreas
    Attached Files Attached Files
    Last edited by Andreas_Zopo; 03-28-2016 at 03:18 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Matching a number in a column and returning a value from another column

    It will help if you can post a small sample file (not image) with some example results.

    To upload file Click "Go Advanced" then "Mage attachments"

  3. #3
    Registered User
    Join Date
    03-28-2016
    Location
    California
    MS-Off Ver
    2007
    Posts
    43

    Re: Matching a number in a column and returning a value from another column

    Thank you John!

    I've attached a simpler, shorter version of what I need to do.

    Sheet 1 contains employee data, Sheet 2 contains the data that needs to be referenced on the Premiums column on sheet 1, depending on age.

    I think I could make it simpler for ages over 64 to simply write them up until, say, 70, so we could have definite numbers to work with. But I guess this file will give you a better idea.

    Thanks again John!

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Matching a number in a column and returning a value from another column

    in F2

    =VLOOKUP(DATEDIF($D2,TODAY(),"y"),Sheet2!$A$3:$C$48,2,1)

    in G2

    =VLOOKUP(DATEDIF($D2,TODAY(),"y"),Sheet2!$A$3:$C$48,3,1)

    Copy down

  5. #5
    Registered User
    Join Date
    03-28-2016
    Location
    California
    MS-Off Ver
    2007
    Posts
    43

    Re: Matching a number in a column and returning a value from another column

    This worked wonders.

    Thanks for the help!!

    Now, I also want to learn. Do you mind explaining those formulas? I want to understand what you did there and how I can use formulas like these in the future.

    Thank you so much, John!

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Matching a number in a column and returning a value from another column

    =VLOOKUP(DATEDIF($D2,TODAY(),"y"),Sheet2!$A$3:$C$48,2,1)

    DATEDIF takes the difference between TODAY() and Birth Date and returns the number of years (the "y" parameter)

    VLOOKUP uses this value i.e. age and matches this against the range A3:C48 on Sheet2. The lookup value (age) is always matched against the first column (A) in the stated range.

    The 2 is the column number from which to return the required value which column B for F2 and 3 for G2 i.e. column C.

    Finally the 1 tells VLOOKUP that the table is in ascending sequence (of A).

    See the description of VLOOKUP in the Excel "Help on this function" when you click the function (fx) button.

  7. #7
    Registered User
    Join Date
    03-28-2016
    Location
    California
    MS-Off Ver
    2007
    Posts
    43

    Re: Matching a number in a column and returning a value from another column

    Thank you John for your patience!

    I'll keep inquiring about that function since I believe it'll be instrumental in upcoming projects.

    Thanks again

+ 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. Replies: 7
    Last Post: 02-01-2016, 03:49 AM
  2. Matching a value to a column, (rounding) and returning offset column value
    By jayinthe813 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2013, 02:42 PM
  3. Replies: 5
    Last Post: 09-12-2012, 01:27 PM
  4. Replies: 3
    Last Post: 01-04-2012, 01:42 AM
  5. Matching dates and returning another column
    By jmoorc in forum Excel General
    Replies: 8
    Last Post: 11-30-2011, 07:49 PM
  6. Replies: 1
    Last Post: 07-25-2011, 01:07 PM

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