+ Reply to Thread
Results 1 to 8 of 8

Multiple greater than and less than variables

  1. #1
    Registered User
    Join Date
    12-10-2019
    Location
    manchester
    MS-Off Ver
    Office 365
    Posts
    7

    Multiple greater than and less than variables

    Hi,

    I am trying to work out probationary costs for my work.

    For example, in the first month, if he leaves, he will get 0. However if he leaves between 1 month and 6 months, he will get 1 week pay. and anything between 6 months and 4 years he will get 4 weeks pay. Finally after the 4 years, every incremental year worked gains 1 week of payment if he leaves. so if he works for 5 years we pay him for 5 weeks after leaving date, 6years for 6 weeks and so on up until 12 years and then it stops at 12 weeks.

    Can anyone create a formula for this.

    I know its complicated but I am stumped.

    Thanks

    Ryan

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,688

    Re: Multiple greater than and less than variables

    If you attach a sample workbook, then we can see what data you have and how it is laid out. Details of how to do this are given in the yellow banner at the top of the screen.

    Pete

  3. #3
    Registered User
    Join Date
    12-10-2019
    Location
    manchester
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple greater than and less than variables

    Hi,

    sample sheet should be attached now.

    Just want in the A Column, to show that the first name has worked there 6 years so he would get 6 weeks worth of pay so the formula would automatically multiply his weekly rate by 6

    and then the same for the person below but for 2 years which would be 4 weeks of his pay.

    thanks

    ryan
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,688

    Re: Multiple greater than and less than variables

    Put this formula in A3:

    =IF(H3>=12,12,IF(H3>=4,H3,IF(DATEDIF(F3,$G$2,"m")>6,4,IF(DATEDIF(F3,$G$2,"m")>0,1,0))))

    then copy down.

    Hope this helps.

    Pete

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Multiple greater than and less than variables

    Firstly, convert your DATEDIF to depict months

    =DATEDIF($F3,G$2,"m")

    Then in Cell A3 use

    =MIN(LOOKUP(H3,{0,1,6},{0,1,4})+ROUNDUP(MAX(0,H3-59)/12,0),12)

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,688

    Re: Multiple greater than and less than variables

    The formula above will give you the number of weeks entitlement - if you want the severance pay then just multiply by column D, like this:

    =IF(H3>=12,12,IF(H3>=4,H3,IF(DATEDIF(F3,$G$2,"m")>6,4,IF(DATEDIF(F3,$G$2,"m")>0,1,0)))) * D3

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    12-10-2019
    Location
    manchester
    MS-Off Ver
    Office 365
    Posts
    7

    Re: Multiple greater than and less than variables

    You Guys has saved my life, Thanks a lot.

    Thanks

    Ryan

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,688

    Re: Multiple greater than and less than variables

    We are here to help, so it's good to hear that the solution(s) worked for you.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Find The First Value Greater Than X (2 variables)
    By Median in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-04-2019, 11:37 PM
  2. Using Multiple Variables to Return Multiple Variables
    By BillMcSciFi in forum Excel General
    Replies: 12
    Last Post: 04-02-2017, 03:50 PM
  3. [SOLVED] Copy rows from multiple worksheets with multiple criteria - greater than dynamic values
    By stackout in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2015, 04:36 PM
  4. A total of two variables with a greater or lesser percentage
    By Blub blub in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2014, 11:07 PM
  5. Variables to multiple cells on multiple sheets
    By BoBoCoDeR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2012, 05:02 PM
  6. Replies: 1
    Last Post: 07-23-2011, 02:49 PM
  7. Multiple variables:bunch of variables
    By sbq80 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-19-2009, 04:22 PM

Tags for this Thread

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