View Full Version : If statements


sonny
12-03-2005, 06:18 PM
I have this formula in a cell but dont want it to add the Salaries if one or both of 2 other fileds are empty.

=SUM(D35:D46)+Salaries!C5+Salaries!C6

Salaries!C5 needs to be added only if cell D34 has a value
Salaries!C6 needs to be added only if cell D47 has a value

I cant figure out how the statement would be, any help would be appreciated...

shades
12-04-2005, 12:09 PM
Howdy.

=IF(OR(Salaries!C5="",Salaries!C6=""),"",SUM(D35: D46))

See if this works for you, and if I have understood your setup.

Brianwarnock
12-06-2005, 06:23 AM
You haven't responded to the previous post but the reply was not how I understood the question, I read it that you require

=SUM(D35:D46)+IF(D34<>"",salaries!C5)+IF(D47<>"",salaries!C6)
If a blank is also considered not to be a value then

=SUM(D35:D46)+IF(AND(D34<>"",D34<>" "),salaries!C5)+IF(AND(D47<>"",D47<>" "),salaries!C6)

Brian