+ Reply to Thread
Results 1 to 3 of 3

Simplify IF statement

  1. #1
    Registered User
    Join Date
    01-27-2010
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Simplify IF statement

    Trying to get the average of 3 cells (D41,F41,H41)with formulas in each based on the following conditions:

    ("blank" is not really blank but the formula in each cell is set up to return blank upon certain conditions)
    • If D41,F41 AND H41 are all three blank, leave blank
    • IF D41,F41 are blank, give me H41
    • If H41, F41 are blank, give me D41
    • If D41, H41 are blank, give me F41
    • If D41 is blank, give me (F41+H41)/2
    • If F41 is blank, give me (D41+H41)/2
    • If H41 is blank, give me (D41+F41)/2
    • If not, give me (D41+F41+H41)/3

    This is what I had done so far:

    =IF(AND(ISERROR(VALUE($D$41)),ISERROR(VALUE($F$41)),ISERROR(VALUE($H$41))),"",IF(AND(ISERROR(VALUE($F41)),ISERROR(VALUE($H41))),$D41,IF(AND(ISERROR(VALUE($D41)),ISERROR(VALUE($F41))),$H41,IF(ISERROR(VALUE($D$41)),SUM($F$41,$H$41)/2,IF(ISERROR(VALUE($F$41)),SUM($D$41,$H$41)/2,IF(ISERROR(VALUE($H$41)),SUM($D$41,$F$41)/2,SUM($D$41,$F$41,$H$41)/3))))))

    I need to simplify to "squeeze" one more IF statement.
    Thanks for your help!
    Last edited by cch70; 07-30-2010 at 04:28 PM. Reason: add on

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Simplify IF statement

    Maybe =IF(COUNT(D41,F41,H41)=0, "", AVERAGE(D41,F41,H41))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-27-2010
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Simplify IF statement

    lol!!!
    Thanks a million.

+ 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