Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to use two formulas in one line. The aim is to sum two columns, A and B, in C with two conditions:

First, if cells in A or B are blank, then formula in column C will return blank.
Second, if B is greater than A, then leave cell blank.

Both formula should be used in the same cell simultaneously.

share|improve this question

2 Answers 2

Try this (in C2):

=IF(OR(A2="",B2=""),"",IF(B2>A2,"",SUM(A2:B2)))

You can then fill this formula down column C.

share|improve this answer
    
Thanks a lot. it worked perfectly well. Just i changed –  Abrar Nov 20 '12 at 22:34

You could check for 2 numbers with COUNT, e.g.

=IF((COUNT(A2,B2)=2)*(B2<=A2),A2+B2,"")

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.