+ Reply to Thread
Results 1 to 8 of 8

Easy Question - IF, AND, OR, ERROR

Hybrid View

  1. #1
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    Easy Question - IF, AND, OR, ERROR

    Hi Excel Geniuses,

    I'm sure this will be an easy one for you, but I've been struggling with it, so I would really appreciate the help.

    We're currently completing our annual salary review & have given suggested increases to all our employees, however the managers have an oppurtunity to propose a different increase if they request & I'm trying to give them the oppurtunity to enter either a proposed increase amount in column C or a proposed increase % in column D (though if they enter a figure into both columns, I want it to error out).

    In the NEW SALARY column (F), I therefore need a formula that reads as below;

    If Proposed Increase amount (C) AND Proposed Increase % are BOTH NOT BLANK, then error.
    AND
    If Proposed Increase amount (C) AND Proposed Increase % are BLANK, THEN Current Salary (A) + Suggested Increase Amount (B)
    BUT IF Proposed Increase amount (C) is NOT BLANK, THEN Current Salary (A) + Proposed Increase Amount (C)
    BUT IF Proposed Increase % (D) is NOT BLANK, THEN Current Salary (A) + (Current Salary (A) * Proposed Increase % (D))

    I hope that makes sense, it's not that I want to give either the Proposed Increase amount or Proposed Increase % columns prominence over each other, it's just that I want whichever one is filled out to be used in the calculation.

    Workbook attached (I'm sure that would help, I'm not sure my explination above was that clear, sorry... )

    Example workbook.xlsx

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,654

    Re: Easy Question - IF, AND, OR, ERROR

    Take a look at this solution
    Try to change or fill both percentages
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    Re: Easy Question - IF, AND, OR, ERROR

    Hi Willem,

    Thank you for this!

    I really liked your data validation idea, I've implemented that & I like that alot.

    However I'm not sure your If statement has all the conditions I need.

    The problem is the Proposed Increase amount column is a currency column & the Proposed Increase % column is a % column. So I think I need an extra piece of formula that will be able to treat them differently..

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Easy Question - IF, AND, OR, ERROR

    I have taken a different approach and perhaps this will fill the bill:

    Formula: copy to clipboard
    =IF(AND(C5<>"",D5<>""),"Error",IF(AND(C5="",D5=""),A5+B5,IF(AND(C5<>"",D5=""),A5+C5,IF(AND(C5="",D5<>""),A5+A5*D5))))
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    Re: Easy Question - IF, AND, OR, ERROR

    Thanks newdoverman!

    I actually really like the data validation approach that Wilelm has taken, so I'd like to use that idea.

    Is there any way you would be able to re-do that formula without the "Error" element, as that is already taken care of. The formula that I would therefore need would look like below;

    In the NEW SALARY column (F), I therefore need a formula that reads as below;


    If Proposed Increase amount (C) AND Proposed Increase % are BLANK, THEN Current Salary (A) + Suggested Increase Amount (B)
    BUT IF Proposed Increase amount (C) is NOT BLANK, THEN Current Salary (A) + Proposed Increase Amount (C)
    BUT IF Proposed Increase % (D) is NOT BLANK, THEN Current Salary (A) + (Current Salary (A) * Proposed Increase % (D))

    Sorry to be a pain, would you be able to help with that?

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Easy Question - IF, AND, OR, ERROR

    This version uses data validation to trap an error. You can change the message to whatever you like by opening Data Validation and changing the message on the Error tab....there are two data validations so both would have to be changed:

    Formula: copy to clipboard
    =IF(AND(C5="",D5=""),A5+B5,IF(AND(C5<>"",D5=""),A5+C5,IF(AND(C5="",D5<>""),A5+A5*D5)))


    I have applied the data validation down to row 80. This can be extended just by selecting c80 and d80 and filling down as far as you like.
    Attached Files Attached Files
    Last edited by newdoverman; 01-30-2015 at 05:28 PM.

  7. #7
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    Re: Easy Question - IF, AND, OR, ERROR

    Thank you so much! SOLVED!

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Easy Question - IF, AND, OR, ERROR

    Thank you for the feedback.
    To mark as SOLVED: Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Easy Question i think
    By JJJJJJJJJJ in forum Excel General
    Replies: 2
    Last Post: 09-08-2008, 06:43 PM
  2. Easy Question
    By ScottyNM in forum Excel General
    Replies: 6
    Last Post: 12-22-2006, 02:58 AM
  3. [SOLVED] *EASY* question!
    By Laura \( '_' \) in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-25-2005, 08:10 AM
  4. Easy Question
    By dok112 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2005, 07:05 PM
  5. new user with easy question? not easy for me
    By speakeztruth in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-03-2005, 05:05 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