# IF Problem

#### melnexcel

##### Board Regular
Can anybody please kindly help me revise the formula I have in cell G4 and I4. For cell G4, I need to get the total of cell B4 and E4 multiplied by 0,1455 if value of cell A4 is equal to “AT SEA” or begins with “EOSP” and value of cell D4 is “HFO”. If value of cell D4 is “MGO” , cell G4 should return a value of 0, even if cell A4 is equal to “AT SEA” or begins with “EOSP”.

The reverse for cell I4. , I need to get the total of cell B4 and E4 multiplied by 0,1455 if value of cell A4 is equal to “AT SEA” or begins with “EOSP” and value of cell D4 is “MGO”. If value of cell D4 is “HFO” , cell I4 should return a value of 0, even if cell A4 is equal to “AT SEA” or begins with “EOSP”.

I hope this can be done because the formulas in cells H2, H3, J2 & J3 are doing these.
Thank you very much in advance for any help.

Excel 2010
ABCDEFGHIJ
1SEAPORTFUELSEAPORTHFO SHFO PMGO SMGO P
2AT PLACE12HFO220.580.00
3AT PLACE12MGO220.000.58
4AT SEA12MGO220.440.44
5AT SEA12HFO220.440.44
Sheet1
Cell Formulas
RangeFormula
H2=IF(A2="AT SEA",0,IF(LEFT(A2,4)="EOSP",0,IF(D2="MGO",0,(C2+F2)*0.1455)))
H3=IF(A3="AT SEA",0,IF(LEFT(A3,4)="EOSP",0,IF(D3="MGO",0,(C3+F3)*0.1455)))
J2=IF(A2="AT SEA",0,IF(LEFT(A2,4)="EOSP",0,IF(D2="HFO",0,(C2+F2)*0.1455)))
J3=IF(A3="AT SEA",0,IF(LEFT(A3,4)="EOSP",0,IF(D3="HFO",0,(C3+F3)*0.1455)))
G4=IF(A4="AT SEA",(B4+E4)*0.1455,IF(LEFT(A4,4)="EOSP",(B4+E4)*0.1455,IF(D4="HFO",(B4+E4)*0.1455,0)))
G5=IF(A5="AT SEA",(B5+E5)*0.1455,IF(LEFT(A5,4)="EOSP",(B5+E5)*0.1455,IF(D5="HFO",(B5+E5)*0.1455,0)))
I4=IF(A4="AT SEA",(B4+E4)*0.1455,IF(LEFT(A4,4)="EOSP",(B4+E4)*0.1455,IF(D4="MGO",(B4+E4)*0.1455,0)))
I5=IF(A5="AT SEA",(B5+E5)*0.1455,IF(LEFT(A5,4)="EOSP",(B5+E5)*0.1455,IF(D5="MGO",(B5+E5)*0.1455,0)))

Last edited:

### Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Can anybody please kindly help me revise the formula I have in cell G4 and I4. For cell G4, I need to get the total of cell B4 and E4 multiplied by 0,1455 if value of cell A4 is equal to “AT SEA” or begins with “EOSP” and value of cell D4 is “HFO”. If value of cell D4 is “MGO” , cell G4 should return a value of 0, even if cell A4 is equal to “AT SEA” or begins with “EOSP”.

The reverse for cell I4. , I need to get the total of cell B4 and E4 multiplied by 0,1455 if value of cell A4 is equal to “AT SEA” or begins with “EOSP” and value of cell D4 is “MGO”. If value of cell D4 is “HFO” , cell I4 should return a value of 0, even if cell A4 is equal to “AT SEA” or begins with “EOSP”.

I hope this can be done because the formulas in cells H2, H3, J2 & J3 are doing these.
Thank you very much in advance for any help.

Excel 2010
ABCDEFGHIJ
1SEAPORTFUELSEAPORTHFO SHFO PMGO SMGO P
2AT PLACE12HFO220.580.00
3AT PLACE12MGO220.000.58
4AT SEA12MGO220.440.44
5AT SEA12HFO220.440.44

</TBODY>
Sheet1

Worksheet Formulas
CellFormula
H2=IF(A2="AT SEA",0,IF(LEFT(A2,4)="EOSP",0,IF(D2="MGO",0,(C2+F2)*0.1455)))
H3=IF(A3="AT SEA",0,IF(LEFT(A3,4)="EOSP",0,IF(D3="MGO",0,(C3+F3)*0.1455)))
J2=IF(A2="AT SEA",0,IF(LEFT(A2,4)="EOSP",0,IF(D2="HFO",0,(C2+F2)*0.1455)))
J3=IF(A3="AT SEA",0,IF(LEFT(A3,4)="EOSP",0,IF(D3="HFO",0,(C3+F3)*0.1455)))
G4=IF(A4="AT SEA",(B4+E4)*0.1455,IF(LEFT(A4,4)="EOSP",(B4+E4)*0.1455,IF(D4="HFO",(B4+E4)*0.1455,0)))
G5=IF(A5="AT SEA",(B5+E5)*0.1455,IF(LEFT(A5,4)="EOSP",(B5+E5)*0.1455,IF(D5="HFO",(B5+E5)*0.1455,0)))
I4=IF(A4="AT SEA",(B4+E4)*0.1455,IF(LEFT(A4,4)="EOSP",(B4+E4)*0.1455,IF(D4="MGO",(B4+E4)*0.1455,0)))
I5=IF(A5="AT SEA",(B5+E5)*0.1455,IF(LEFT(A5,4)="EOSP",(B5+E5)*0.1455,IF(D5="MGO",(B5+E5)*0.1455,0)))

</TBODY>

<TBODY>
</TBODY>

Try in G4:

=IF(D4="MGO",0,IF(OR(A4="AT SEA",A4="EOSP",AND(D4="HFO")),(B4+C4)*0,1455))

In G4, try

=IF(OR(A4="AT SEA",LEFT(A4,4)="EOSP"),IF(D4="HFO",(B4+E4)*0.1455,0),"")

Use the same in I4, changing HFO to MGO.

Thank you very much for your help. The formula is working properly now

Replies
6
Views
315
Replies
10
Views
507
Replies
6
Views
273
Replies
2
Views
522
Replies
8
Views
144

1,196,368
Messages
6,014,854
Members
441,850
Latest member
peh16

### 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