Is this what you want:
=IF(OR(D2="B"),(H2-E2),IF(OR(D2="S"),(E2-H2)))
--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile:
http://www.thecodecage.com/forumz/member.php?userid=73
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=45752