View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default Sum of a cell if certain criteria are met.

If A1 can only hold L or S then:

=IF(A1="L",C1-B1,B1-C1)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Steve" wrote in message
...
I know this is probably easy, but for some reason I am having a hard time
with it. Here's what I want to do.

IF A1=L THEN C1-B1
IF A1=S THEN B1-C1

Not that it matters, but L=Long, S=Short (I trade stocks) If I take a
long
position, then I need to subtract the entry price from the exit price and
vice versa.

I would like the sum of that to appear in the cell I put that formula in.

Any help would be great!

Thanks again!