+ Reply to Thread
Results 1 to 4 of 4

User defined formulas

  1. #1
    Registered User
    Join Date
    07-10-2019
    Location
    New York, NY
    MS-Off Ver
    MS Office 2016
    Posts
    27

    User defined formulas

    I've been creating a lot of budget templates lately and I'd like to create a user-defined function to more easily handle how a capped payroll tax works.

    In the past I've used the following array formula to find this amount:

    {=SUM(IF(Range<Cap,Range,Cap))*Rate}

    (example also attached)

    I'm hoping to create a user-defined function so that I can just select the range, the cell containing the cap amount, and the cell containing the tax rate to easily produce the total amount of the payroll tax, but I'm not quite sure what VBA code to use to achieve this.

    Any help would be much appreciated!
    Attached Files Attached Files
    Last edited by AAnderson4912; 09-09-2020 at 10:26 PM.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: User defined formulas

    You may try something like this...

    Place the following code on a Standard Module like Module1.

    Please Login or Register  to view this content.
    And then use this function like below...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    07-10-2019
    Location
    New York, NY
    MS-Off Ver
    MS Office 2016
    Posts
    27

    Re: User defined formulas

    Brilliant! That seems to have done the job.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: User defined formulas

    Great! Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating a User-Defined Range for Formulas
    By NoPetrol in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-13-2020, 04:32 PM
  2. Replies: 4
    Last Post: 06-28-2016, 05:38 PM
  3. Replies: 2
    Last Post: 06-26-2016, 02:17 AM
  4. Copy, paste, replace- user defined range in all the defined sheets
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 12:28 PM
  5. User-Defined Function & Array Formulas
    By faithcmbs9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2013, 05:46 PM
  6. [SOLVED] VBA - Add Rows with formulas only and Delete Rows with check - User defined
    By polcen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-03-2012, 12:18 AM
  7. Using VBA to populate cells with formulas containing user-defined functions
    By Chinchin in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-29-2011, 12:26 PM

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