+ Reply to Thread
Results 1 to 9 of 9

If, And, Or Confusion!

  1. #1
    Registered User
    Join Date
    03-27-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    7

    If, And, Or Confusion!

    Hello - I'm confused as to which function, or combination of functions, I should be using to get the figures I want... I am using excel 2007.

    I am working on employee payroll budget for the next 60 months (5 years) and need to factor in a salary increase if the employee has been with the company for at least 9 months in that particular calendar year.

    I have a fixed salary increase for each year of employment (year1=3%, year2=5% ect).

    Employees who work for a minimum of 9 months are entitled to the increase.

    Increases will be effective in the Jan payroll each year (Month 13,25,37,49).

    So I need a formula, starting in month 13, that says the following in Month 13 :
    If Start month is less than 4 use $4000 plus 5%
    If start month is equal to 13 and greater than 4, use $4000
    If start month is greater than 13 use 0

    I Can do all of the above separately but run into problems when combining... I tried the if/and function but it is limited to only a true and false output and I need 3 different outputs...

    Any help is greatly appreciated!

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: If, And, Or Confusion!

    Hello,

    There are several approaches that can be used, but I am having trouble following the logic. Could you upload a dummy workbook showing the results if you manually calculated it.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: If, And, Or Confusion!

    Quote Originally Posted by amyindubai View Post
    I Can do all of the above separately but run into problems when combining... I tried the if/and function but it is limited to only a true and false output and I need 3 different outputs...
    The trick is to do the steps separately, then combine them. Do this in separate starting cells, then in another results cell create one formula that gives you the answer that refers to your starting cells. Then in you results cell, replace the references to the starting cells with the formulas from those starting cells.

    Also note you can next if statments together like this.

    =if(A1=5,Answer, Alternative answer). then just replace Alertnative answer with another if statement like this.

    =if(A1=5,Answer, if(A1=3,Alternative answer 1, Alternative answer 2).

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If, And, Or Confusion!

    .. and just to correct a small typo make sure you have as many closing brackets as there are IFs

    =if(A1=5,Answer, if(A1=3,Alternative answer 1, Alternative answer 2))
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    03-27-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If, And, Or Confusion!

    Hello and thank you for your help thus far...

    Attached is a sample workbook with:

    1) An assumptions page

    2) An example of how the "actual payroll" would look based on the assumptions (manually enetered/no formulas)

    3) An attempt to solve the problem that did not work - I am fine until I get to month 13 when I have to decide whether or not the employee has earned the increase for that year.

    Thanks for your continued assistance!
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If, And, Or Confusion!

    Hi,
    You have a circular argument in your note re row 13. You want a formula in C13 and one of its condition includes the value of C13, i.e. SUM(C2:C13>40000).

    Now there's nothing inherently wrong with a circular formula but it's usually best to try and avoid them. And your assumption sheet doesn't seem generalised enough to reflect the Employee title.

    It seems to me that you would be better putting actual month end dates on row 2 of the Payroll Budget, adding extra columns at the beginning for Start date, starting salary, four columns for the Y1-4 % increases, and 4 columns which contain formulae that work out when the increases should cut in.

    With that basic data then you could more easily construct formulae on the payroll budget sheet using the new data mentioned above and using the dates on row 2 in the IF tests you'll need.

    Regards

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: If, And, Or Confusion!

    hi amyindubai, please check attachment, option for formula in C2:C61 in "An attempt" sheet. Change value in A2. The formula has set starting actual salary equal to 5000, amend it if it is different
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: If, And, Or Confusion!

    please check attachment, Sheet "An Attempt", column D formula. The array in question can be represented as a table G19:K24. Hope this helps.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    03-27-2012
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: If, And, Or Confusion!

    Thank you very much Watersev - it's crystal clear now! Much apprecaited!!

+ 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