+ Reply to Thread
Results 1 to 3 of 3

Custom Function from worksheet result

  1. #1
    Registered User
    Join Date
    06-03-2008
    Posts
    2

    Custom Function from worksheet result

    Probably should be under programming but I am looking for a way to do this without writting code.

    What I have is a worksheet that does a few complicated calculations based on very few input cells. The calculations involve getting the maximum and minimum of columns, average and a few conditional sums.
    The result is one number, put on cell A2.
    The main variable is input on cell A1.
    The area used for calculations is roughly C1:J100
    All other data variables are on the A column A3:A12
    Now what I want is to create a custom function that relates those two cells. Say, if I call Func(5) it should go put 5 in A1 and return the value of A2.
    I utterly want to create a table with those A1, A2 values but it would be extremely complicated to do all those calculations in a row and autofill.
    If this can be done with one cell (A1) can it be done with multiple input variables (A3:A12). It will still have to output one number only.
    Thank you all in advance for your help.

  2. #2
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    If you already have the formula setup in A2 to return a result based on A1, why not just fix the references to all cells except A1 and drag it over as far as you need? Then B1 on could be the numbers you want to return the values of.
    I'm not aware of a way to get your own custom function in without code. You can have formulas that are shortened to look like custom formulas by using the name manager tool, but you can't create one with an input.
    For your last question, there's no way we can really answer that without knowing what you're trying to accomplish. Can you please provide an example workbook of what you're trying to do (including an explanation of how the other variables would affect the formula) along with expected results?

  3. #3
    Registered User
    Join Date
    06-03-2008
    Posts
    2
    Maybe what I need is actually a macro.
    Check this file I attach.
    Give a number in A1 and it returns the result in A2
    The actual workbook is more complicated. I made this as a simple example of what I am trying to do.
    What I want is to create a function that puts the input variable in A1, reads A2 and returns it as result.
    In that way I can construct a table having 1,2,3,4,5,6,7,8,9,10 on the first column and the appropriate A2 values on the second. I can do that by using multiple instances of the C1:G9 table and dragging the required cells one under the other. The final workbook though is much more complicated and it would really be painful to work that way.
    Attached Files Attached Files

+ 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