# IF Statement

#### Stclements1

##### Board Regular
In column P, I want to change the current formula =IF(F3>0;((O3/H3)/F3)+D3;"0"), so that whilst doing the same calculation it also includes the text value in column C. If it says "BUY" it adds D3 and if the value in the relevant C cell says "SELL" it calculates -D3.
I did write IF(C3="BUY";(((O3/H3)/F3)+D3;O3/H3)F3)-D3) but that didn't work.
Please find the worksheet attached. Many thanks.
K
21
Positions

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### diddi

##### Well-known Member
try this

Excel Formula:
``=IF(F3>0,IF(C3="BUY",((O3/H3)/F3)+D3,IF(C3="SELL",((O3/H3)/F3)-D3,"0")))``

#### Stclements1

##### Board Regular
Perfect. many thanks.

Replies
12
Views
124
Replies
13
Views
299
Replies
5
Views
93
Replies
28
Views
673
Replies
3
Views
83

1,140,923
Messages
5,703,178
Members
421,280
Latest member
Jaycee01

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back