• Hi,


    Hope someone can help, this has got me going around in circles. Please see table below:
    [TABLE="border: 0, cellpadding: 0, cellspacing: 0, width: 321"]

    [tr]


    [td]

    Apples

    [/td]


    [td]

    Pears

    [/td]


    [td]

    Proportion of Apples to Pears (%)

    [/td]


    [/tr]


    [tr]


    [td]

    10

    [/td]


    [td]

    0

    [/td]


    [td]

    0

    [/td]


    [/tr]


    [/TABLE]

    Under Proportion of Apples to Pears (Cell C2) I have put this formula:


    =IF(ISERROR(A2/B2),0,A2/(A2+B2))


    It should come back with the answer 100% but it comes back as 0.


    I wish to keep the IF ERROR in the formula because if there are 0 Apples and 0 Pears I want it to still return a 0 rather than a #DIV/0 error.


    Can someone help?

  • try this:


    Code
    =IF(AND(A2=0,B2=0),0,IF(ISERROR(A2/B2),1,A2/(A2+B2)))


    note: cell c2 formatted as %

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!