Formula question

T

Tommy

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.
 
D

Dave O

If column A will contain ONLY a B or an S, you can write this IF
function:
=IF(A1="b",C1-B1,B1-C1)
 
G

Guest

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top