+ Reply to Thread
Results 1 to 7 of 7

Vlookup and DatedIf Problem Value not available

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Vlookup and DatedIf Problem Value not available

    Hi

    I'm having a problem using datedif function with Vlookup.

    I have a range of cells where I use datedif to calculate a persons age in years and months (6.11 being 6 years and 11 months)

    I am then trying to vlookup a value in a table based on the age calculated from datedif.

    I keep getting a value not available error #NA. I think the error is due to way the values are shown for the age in the lookup table but I haven't been able to work out how to show they in same details as datedif is answering.


    I have attached a sample spreadsheet, my error is in cells named "normal range", which should show a ranged answer based on the calcuated age.



    Help
    Attached Files Attached Files
    Last edited by AmrsDavid; 10-07-2012 at 11:46 PM. Reason: sample attached and working cleaned up

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Vlookup and DatedIf Problem Value not avilable

    Suggest you post a sample workbook.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-07-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Vlookup and DatedIf Problem Value not avilable

    Hello Alan

    I edited my post and attached a sample spreadsheet.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Vlookup and DatedIf Problem Value not available

    1st, the answers in sheet1 column E are text, so adjust the formula to...=(DATEDIF(D2,$A$2,"y") & "." & DATEDIF(D2,$A$2,"ym"))*1

    however, even when that change is made, it still returns an unexplained NA. despite the fact that the data in sheet2 column J ATE numbers (tested with isnumber) only when you manually overwrite the formula with its value, does the vlookup work. i dont understand it. use "fill range" to replace the formula in K with actual values and everything works fine
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Vlookup and DatedIf Problem Value not available

    or also putting the *1 in the lookup and change to "true"

    =VLOOKUP(E3*1,Data!$J$3:$K$88,2,TRUE)

    note: -> no changes on the different tables
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Vlookup and DatedIf Problem Value not available

    @ vlady nope that still doesnt work. if you still have the file open, check the answer on G6 (6.9). using TRUE returns 15-27, but it should be 13-25. makes no sense to me why its not working based on his formula on sheet2 column J?

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Vlookup and DatedIf Problem Value not available

    J4=TEXT(6,"0.00")
    then below
    J5=TEXT(J4+0.1,"0.00")


    E2=TEXT((DATEDIF(D2,$A$2,"y") & "." & DATEDIF(D2,$A$2,"ym")),"0.00")

    no change in vlookup
    =VLOOKUP(E3,Data!$J$3:$K$88,2,FALSE)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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