+ Reply to Thread
Results 1 to 8 of 8

max value of a cell nested if statements

  1. #1
    Registered User
    Join Date
    08-27-2008
    Location
    Wisconsin
    Posts
    4

    max value of a cell nested if statements

    Hi,
    first post here so I hope I'm concise, yet thorough enough. I've been playing around with this for a few days and just can't get it.

    On the attached worksheet I have a series of nested IF statements. In one column (F) I only want the value calculated in the formula if it is 12 or under.

    I've tried =IF(F2>12,12,IF(E2>0,E2-F2,IF(E2,"",D2))) but that only returns a 12 in my destination cell. I'd like it to calculate the actual value, as long as it's not over 12.

    Any help would really be appreciated!!
    thank you

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    That formula should give you a result if F2 <=12 and E2>0... but I don't know what you are tring to do with this: IF(E2,"",D2)
    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
    Registered User
    Join Date
    08-27-2008
    Location
    Wisconsin
    Posts
    4
    sorry for the confusion. i only want E2 calculated if there is a number in the cell. otherwise i need it to defer to cell D2.

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

    =IF(F2>12,12,IF(E2>0,E2-F2,D2))

  5. #5
    Registered User
    Join Date
    08-27-2008
    Location
    Wisconsin
    Posts
    4
    i should have explained myself better - sorry again. when i use that formula, the end result in column G gives me 12. what i need it to do is subtract whatever number is in column F (provided it's 12 or lower) from column D, unless there is a number in column E, in which case the number in E should be used.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Still not exactly clear on what to do if there is a number in E2, but I guess...

    =IF(E2>0,D2-E2,IF(F2<=12,D2-F2,12))

  7. #7
    Registered User
    Join Date
    08-27-2008
    Location
    Wisconsin
    Posts
    4
    i think you gave me a fresh way of looking at this - i finally got it to do what i need by just changing a few little things in the formula you listed:

    =IF(E2>0,D2-F2,IF(F2>=12,D2-12))

    now instead of returning the number "12" in my destination cell it's actually subtracting anything higher than 12 as 12 from either column E or D.

    my project just got way easier - thank you!

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    You did not put a second argument on your second IF statement. Therefore if E2=0 and F2<12, you'll get a "FALSE" in your cell. Is this okay with you?

    ChemistB

+ 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. Summing Nested If Statements
    By bruehl10 in forum Excel General
    Replies: 1
    Last Post: 05-15-2008, 12:09 PM
  2. Nested If Statements
    By sudburydave in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-08-2007, 06:39 PM
  3. Change Cell Colour Using in-cell If Statements?
    By shsassy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2007, 02:43 PM
  4. >7 if statements
    By rdej19 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-27-2006, 11:07 AM
  5. Nested IF Statements Linking Problem
    By skratch in forum Excel General
    Replies: 2
    Last Post: 09-14-2006, 06:30 AM

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