View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default Formula question

If your data begins in row 2, then in D2:
if(a2="b",c2-b2,if(a2="s",b2-c2,"?")). Autofill that formula through each
row in column D. If you're confident that ONLY b or s will appear in column
A, you could make this =(c2-b2)*if(a2="b",1,-1).

"Tommy" wrote:

Three columns:

b 1250 1253

s 1250 1253

If column a equals "b" for buy, I want to subtract column b from
column c. If column a equals "s" for sell, then I want to subtract
column c from column b.

I'm looking for a formula in column d that will get the desired
results.

Thanks.