Try this.
=IF(AND(A1="SJN",C1="SJN"),SUM(B1,D1),IF(AND(A1="S JN",C1<"SJN"),B1,IF(AND(A1<"SJN",C1="SJN"),D1,"" )))
Cheers,
Steve
--
SteveG
------------------------------------------------------------------------
SteveG's Profile:
http://www.excelforum.com/member.php...fo&userid=7571
View this thread:
http://www.excelforum.com/showthread...hreadid=491840