IF Problem

melnexcel

Board Regular
Joined
Feb 19, 2007
Messages
54
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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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

<COLGROUP><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</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)))

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>

Try in G4:

=IF(D4="MGO",0,IF(OR(A4="AT SEA",A4="EOSP",AND(D4="HFO")),(B4+C4)*0,1455))
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top