multiple if statements

G

Guest

My if statement is as follows:

=if(and(a>0,c>0),((a*b)+(c*d))/e,(if(a=o,c*d/e,(if(c=0,a*b/e,"")))))

It works fine for all of the conditions except for the case where none of
the parameters are true. I want it to return a blank space, instead it is
returning "value". I have tried substituting the blank space with a number
or word and it still returns "value". Can anyone see the error.

Thank you
 
K

Ken Wright

Without looking at what the formula is doing, i can see straight off that i
think you have put a=o instead of a=0. is this it?

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------­------------------------------­----------------
It's easier to beg forgiveness than ask permission :)
------------------------------­------------------------------­----------------
 
G

Guest

No, that was a typo. What the formula is trying to do is calculate a
weighted average of two sets of numbers, where if one of the numbers is zero
or both are zero the formula still works. The reason I want a blank cell is
that I use this value in another formula so I need it to be blank - not div/0.

a=a number of values
b=average of those values (a)
c=a number of values
d=average of those values (c)
e=total number of values
formula=weighted average of these two averages

Thanks
 
Z

Zack Barresse

Hi,

Take a look at the SUMPRODUCT function. Barring the interpretation of your
variables (e.g. "a", "b", "c", etc.) this sounds like it may help.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top