+ Reply to Thread
Results 1 to 5 of 5

Creating a function to simplify a more complex function

  1. #1
    Registered User
    Join Date
    05-28-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Creating a function to simplify a more complex function

    Greetings. I am a mid-level sort of Excel user, but I don't often create my own functions. I'm familiar with VBA for Access, but not for Excel.

    Anyway, I don't know if this is possible, but I have a formula that I'd like to make into its own function. I've tried looking up how to do this, but I can't find anything.

    The formula:
    Please Login or Register  to view this content.
    What I'm trying to do is make it so that rather than copying the cell again and again to where I need the formula, I can just create a new function, called FldPos, that will allow me to type "FldPos()" into a cell and have it behave as though this formula is in the cell (excelpt with relative cell references rather than specific ones

    Is that possible? If so, how can it be done?

    Thanks for any help anyone can give!
    Last edited by mk74; 05-28-2011 at 09:20 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Creating a function to simplify a more complex function

    Which cell would originally have contained that formula?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Creating a function to simplify a more complex function

    Pending Ron's question, your formula can be shortened a bit
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-28-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Creating a function to simplify a more complex function

    It would be in cell N1751 in this case.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Creating a function to simplify a more complex function

    If cell N1751 would contain your formula...try this

    • I believe this will work just like your formula:
    N1751: =IF((A1751<>"")*(B1751<>""),IF(A1750<>"",N1750,A1748),0)

    • Select cell 1751
    • Insert.Name.Define
    ...Names in workbook: FldPos
    ...Refers to: =IF((A1751<>"")*(B1751<>""),IF(A1750<>"",N1750,A1748),0)
    ...Click: OK

    Now you have a "named formula":
    • replace the formula in N1751 with this:
    N1751: =FldPos

    You should see the same results.

    Now...you can select any cell in Col_N and use the formula: =FldPos
    and it will be like you copied the original formula into that cell.

    Is that something you can work with?

+ 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