+ Reply to Thread
Results 1 to 8 of 8

Help! Is it Possibe to write UDF(custom formula) inside sheet

  1. #1
    Registered User
    Join Date
    11-10-2004
    Location
    India
    Posts
    40

    Question Help! Is it Possibe to write UDF(custom formula) inside sheet

    Hi All,

    Iam a excel newbie. I have a custom formula written as UDF .When iam writting this fucntion inside a sheet iam not able to call it as formula in the same sheet.It's giving ?NAME error But iam writting the UDF inside a module it's working Can any one help in solving the problem.Is it possible to write write custom formula inside a module only ?
    Any one please help

    Thanks in advance
    Xcelion

  2. #2
    Tom Ogilvy
    Guest

    Re: Help! Is it Possibe to write UDF(custom formula) inside sheet

    Yes, the UDF should be in a general module -- not a sheet module or the
    thisworkbook module.

    --
    Regards,
    Tom Ogilvy

    "xcelion" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi All,
    >
    > Iam a excel newbie. I have a custom formula written as UDF .When iam
    > writting this fucntion inside a sheet iam not able to call it as
    > formula in the same sheet.It's giving ?NAME error But iam writting the
    > UDF inside a module it's working Can any one help in solving the
    > problem.Is it possible to write write custom formula inside a module
    > only ?
    > Any one please help
    >
    > Thanks in advance
    > Xcelion
    >
    >
    > --
    > xcelion
    > ------------------------------------------------------------------------
    > xcelion's Profile:

    http://www.excelforum.com/member.php...o&userid=16287
    > View this thread: http://www.excelforum.com/showthread...hreadid=386393
    >




  3. #3
    Registered User
    Join Date
    11-10-2004
    Location
    India
    Posts
    40

    Thanks Tom,Thanks a lot,But one more help

    Hi Tom,
    Thanks Tom
    Thanks a lot
    Your advice has saved me lot of time .But created another problem.Now i have to covert my UDF to excel formula to meet my requirement .My requirement is like this

    I have two input

    1.Job title
    2.salary

    From the JobTile i have to find the Job category from lookup table and from Job category i have to find the salary range from another look table and then apply the PERCENTILERANK fuction on that range and if it falls below range it should give Below,and above if it is greater .Iam attaching the code for the UDF i have written(hope ever one understands my logic )) .Can any one convert it to formula .Is it possible to do my requirement with formula itself or do i have to write UDF?




    Please Login or Register  to view this content.

    Thanks in advance

  4. #4
    Bob Phillips
    Guest

    Re: Help! Is it Possibe to write UDF(custom formula) inside sheet

    the NAME error suggests it cannot find that UDF.

    Did you save the UDF to a standard code module
    ?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "xcelion" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi All,
    >
    > Iam a excel newbie. I have a custom formula written as UDF .When iam
    > writting this fucntion inside a sheet iam not able to call it as
    > formula in the same sheet.It's giving ?NAME error But iam writting the
    > UDF inside a module it's working Can any one help in solving the
    > problem.Is it possible to write write custom formula inside a module
    > only ?
    > Any one please help
    >
    > Thanks in advance
    > Xcelion
    >
    >
    > --
    > xcelion
    > ------------------------------------------------------------------------
    > xcelion's Profile:

    http://www.excelforum.com/member.php...o&userid=16287
    > View this thread: http://www.excelforum.com/showthread...hreadid=386393
    >




  5. #5
    Registered User
    Join Date
    11-10-2004
    Location
    India
    Posts
    40

    Thanks Bob,Tom .One more help

    Hi Bob,

    Tom Suggested that it's not possible to write UDF inside a sheet.So my requirement now is is it possible to covert the UDF i have posted to a normal excel formula


    Thanks
    xcelion

  6. #6
    Bob Phillips
    Guest

    Re: Help! Is it Possibe to write UDF(custom formula) inside sheet

    No, you can't write it in a sheet, but you can put it in a standard code
    module.

    But you should be able to do it with formulae

    =VLOOKUP(VLOOKUP("dogsbody",jobs,2,FALSE),salaries,2,FALSE)

    Assuming that you have an nx2 table of job title and job category called
    jobs, and an nx2 table of job categories and salaries called salaries, that
    formula gives the category salary. You can compare the salary using
    PERCENTILERANK.


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "xcelion" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi Bob,
    >
    > Tom Suggested that it's not possible to write UDF inside a sheet.So my
    > requirement now is is it possible to covert the UDF i have posted to
    > a normal excel formula
    >
    >
    > Thanks
    > xcelion
    >
    >
    > --
    > xcelion
    > ------------------------------------------------------------------------
    > xcelion's Profile:

    http://www.excelforum.com/member.php...o&userid=16287
    > View this thread: http://www.excelforum.com/showthread...hreadid=386393
    >




  7. #7
    Registered User
    Join Date
    11-10-2004
    Location
    India
    Posts
    40

    Thanks Bob

    Thanks BoB

    Thanks for your help,I have used your formula

    Sorry for replying late

  8. #8
    Bob Phillips
    Guest

    Re: Help! Is it Possibe to write UDF(custom formula) inside sheet

    No problems, at least you did let us know how you got on.

    Regards

    Bob


    "xcelion" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Thanks BoB
    >
    > Thanks for your help,I have used your formula
    >
    > Sorry for replying late
    >
    >
    > --
    > xcelion
    > ------------------------------------------------------------------------
    > xcelion's Profile:

    http://www.excelforum.com/member.php...o&userid=16287
    > View this thread: http://www.excelforum.com/showthread...hreadid=386393
    >




+ 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