+ Reply to Thread
Results 1 to 8 of 8

adding a conditional value to a formula

  1. #1
    Registered User
    Join Date
    03-31-2010
    Location
    Las Vegas, NV
    MS-Off Ver
    Excel 2003
    Posts
    14

    adding a conditional value to a formula

    I am writing a formula and I am a bit stuck on how to progress. The formula I am writing is the sum of 7 cells - the value of another cell. This isnt the problem. The problem is I would like to add a conditional value that any negative numbers should be displayed as "no overpayment" and positive numbers should have the background of the cell changed to be yellow. Is this even possible?

    Thanks,

    Erik
    Last edited by ErikVegas; 05-07-2010 at 12:35 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Is it possible to do this

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: adding a conditional value to a formula

    Surround your current formula with an IF statement

    e.g. =IF(your_formula>0,your_result,"No Overpayment")

    then go to Format|Conditional Formatting, Select Cell Value Is >> Greater than or equal to and enter =0

    Click Format and choose from the pattern tab.

  4. #4
    Registered User
    Join Date
    03-31-2010
    Location
    Las Vegas, NV
    MS-Off Ver
    Excel 2003
    Posts
    14

    re: adding a conditional value to a formula

    I re wrote the formula as this =IF((K2:M2)-G2<0,"no overpayment") and I get a #value error. What am I missing?

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    re: adding a conditional value to a formula

    more like:

    =IF(Sum(K2:M2)-G2<0,"no overpayment",Sum(K2:M2)-G2)

  6. #6
    Registered User
    Join Date
    03-31-2010
    Location
    Las Vegas, NV
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: adding a conditional value to a formula

    The formula worked but the text "no overpayment" also comes out with a red back ground. I set the conditional formating to change to red if cell value is greater than 0. How can get it to not change the background to red on non number entries.

    Thanks,

    Erik

  7. #7
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: adding a conditional value to a formula

    Erik - the solution above should work. Upload what you are seeing and I will take a look at it.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: adding a conditional value to a formula

    Quote Originally Posted by ErikVegas View Post
    The formula worked but the text "no overpayment" also comes out with a red back ground. I set the conditional formating to change to red if cell value is greater than 0. How can get it to not change the background to red on non number entries.

    Thanks,

    Erik
    You are correct.

    Try instead:

    Choose Formula Is, rather than Cell Value Is and then enter formula:

    =AND(ISNUMBER(E1),E1>0)

    Exchanging the E1 for the actual cell you are in and trying to conditionally format.

+ 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