1. #1
    cincy
    cincy's Avatar Become A Pro!
    Join Date: 09-30-07
    Posts: 403
    Betpoints: 1224

    Excel ValuePL function Help

    I have some spreadsheets that use a ValuePLfunction with an equation like the below
    =ValuePL(A1,Tables’!A2:A16,Tables’!B2:B1 6)

    The Tables worksheet may look like thebelow:
    Calc PS Based ON Power Rating Dif
    NFL Adj PS
    -40
    -29
    -30
    -23
    -25
    -20
    -20
    -16.5
    -15
    -13
    -10
    -9
    -5
    -4.6
    0
    0
    5
    4.6
    10
    9
    15
    13
    20
    16.5
    25
    20
    30
    23
    40
    29


    ValuePL is actually a very useful piecewiselinear function that I like better than a lookup table because the result isbasically an extrapolation between two values


    I don’t recall if the ValuePL function is aMacro or an excel function but it only works in some of my spreadsheets (Ithink it only works if I open a spreadsheet where it works and then rename it). How can I enable this to work in otherexisting spreadsheets where it does not work.
    Right now if I have an existing spreadsheetand want to use ValuePL I need to open a spreadsheet where ValuePL works andrename it and then copy all my worksheets to that new spreadsheet and then itworks.


  2. #2
    thom321
    thom321's Avatar Become A Pro!
    Join Date: 06-17-11
    Posts: 112
    Betpoints: 4983

    This is a custom function (User Defined Function) that is not included in Excel. Someone created it using VBA. So in the workbooks that it is working in, the code for the function is added to a module inside the Visual Basic Editor in Excel.

    So you need to copy the code, inside the Visual Basic Editor, for the function and include it in each workbook where you want to use it. If you Google something like "how to copy a UDF to another Excel workbook" it should provide some instructions for how to do it.

    Good luck.

Top