+ Reply to Thread
Results 1 to 3 of 3

Function with if function in it does not work

  1. #1
    Registered User
    Join Date
    04-16-2014
    Location
    groningen, netherlands
    MS-Off Ver
    excel 2010
    Posts
    19

    Function with if function in it does not work

    Dear users, yet another relatively easy question i think.
    I want to perform a very easy calculation, but i don't want that the calculation gets made if there is a 0 value within in. There are two values who are the main inputs if 1 of those 2 equal zero i don't want the calculation to be made, or when they are both zero.
    So far i came up with the following:=IF(OR(API167=0,API186=0),0,API167-API186)/(API167+API186)/2 that only works if one of the two values is zero.

    Next question is that i want to sum up the row with the values calculated with the formula above, disregarding the zero values. This sum function must be devided by the amount of values which are used as input(so disregarding the zero's)

    Can someone help me please?!
    Thank you in advance

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Function with if function in it does not work

    You need AND() not OR()

    =IF(AND(API167=0,API186=0),0,API167-API186)/(API167+API186)/2

    Next question is that i want to sum up the row with the values calculated with the formula above, disregarding the zero values. This sum function must be devided by the amount of values which are used as input(so disregarding the zero's)
    Try the AVERAGEIF function
    =AVERAGEIF(Range_of_data,"<>0")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    04-16-2014
    Location
    groningen, netherlands
    MS-Off Ver
    excel 2010
    Posts
    19

    Re: Function with if function in it does not work

    thank you very much for your fast reply, it worked! I only needed to add brackets to the second part of the calculation otherwise it would turn up #DIV/0!
    Thanks so much for your fast help

+ 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. [SOLVED] VBA FindNext function does not work in a function
    By ArnolddG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2013, 07:24 PM
  2. Work day/ other function.
    By JamesGale in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2009, 12:05 PM
  3. Work around to the 7 function limit with the IF function
    By Venka in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2008, 07:02 PM
  4. [SOLVED] how do i get the mid function to work with a zero
    By garbold in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-07-2006, 06:00 PM
  5. [SOLVED] why if function does not work?
    By [email protected] in forum Excel General
    Replies: 4
    Last Post: 11-24-2005, 07:55 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