ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula question (https://www.excelbanter.com/excel-discussion-misc-queries/60036-formula-question.html)

Tommy

Formula question
 
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.

Dave O

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


bpeltzer

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.



All times are GMT +1. The time now is 09:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com