I would like to write an IF statement in cell A3 that says, IF cells A1 and A2 are both empty (i.e. neither of them has a numbers in it), then leave cell A3 blank, but if either A1 or A2 (or both) has a number in it, then sum those two cells in A3. To take it one step further, I'd like to wrap it in an IF(ISERROR) function. Any help would be much appreciated.

=IF(AND(A1="",A2=""),"",SUM(A1,A2)) You say you want to wrap it in an ISERROR function but you don't say what you want returned if an error exists.

It would also help if we knew what error you are expecting and/or checking for.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Thanks DerbyDad - I appreciate it. I'm not anticipating any particular errors, just being conservative. I would like the ISERROR function to return a hyphen if there is an error.

I guess this would work... =IF(ISERROR(SUM(A1,A2)),"-",IF(AND(A1="",A2=""),"",SUM(A1,A2)))

BTW...why did you mark the thread solved if you were still looking for more assitance?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

The IF(AND...) part was the more important component for me and the likelihood of errors calculating what I'm calculating is low. Thanks for your help with this.

Ask Your Question

Weekly Poll