Help With my Formula in Column I

Lukma

Board Regular
Joined
Feb 12, 2020
Messages
240
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi friends

Good day, please I need help with my formula in COLUMN I, I don't know if I got it right.
to explain all I need the formula to do is two criteria
IF Column F4=NO and Column G4 is greater Than 3Hrs before Column C4, then Subtract Column G From Column E
IF Column F4=Yes and Column G4 is greater Than 3Hrs before Column C4, then Subtract Column G From Column C


But what am getting is false I need the FALSE to show negative or time.

Appreciate any help and could solve this or a better formula

Thanks

OSMS-Onshore Jetty Operations vessels Tracking.xlsx
ABCDEFGHI
1NO
2YES
3Mus NumSupply VesselVessel Arrive Fairway Buoy Date&TimeMUS Channel Status C/OManifest Date & TimeManifest passed On TimeControl Tower Permission Date & TimePerm Granted On Time Permission Hours
41154CECILIE-K01/05/23 10:0001/05/23 12:40NO01/05/23 12:44Met0:04
51155Z-OCEAN01/05/23 14:3001/05/23 13:40NO01/05/23 13:51Met0:11
61156SWISSCO RUBY02/05/23 06:0001/05/23 21:57YES01/05/23 22:40MetFALSE
71157LCT-SHEWELEH01/05/23 16:0001/05/23 15:00NO01/05/23 18:27Not Met3:27
81158A-RANGER01/05/23 20:0001/05/23 16:57YES01/05/23 17:00MetFALSE
91159ADNOC-S0201/05/23 21:1001/05/23 20:14NO02/05/23 03:00Not Met6:46
Sheet1
Cell Formulas
RangeFormula
H4:H9H4=IFERROR(IF(G4>E4+TIME(3,0,0),"Not Met","Met"),"")
I4:I9I4=IF(F4=$A$1,IF(G4>C4-TIME(3,0,0),G4-E4,IF(F4=$A$2,IF(G4>C4-TIME(3,0,0),G4-C4))))
F4:F9F4=IFERROR(IF(E4>C4-TIME(3,0,0),"NO","YES"),"")
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
What you want to return if non of above two condition are met?
 
Upvote 0
What you want to return if non of above two conditions are met?
Hi Sufiyan

Thank you for your response if both are met I need to show the negative hours permission was grated in column I
to display the negative time



ABCDEFGH I
1156SWISSCO RUBY02/05/23 06:0001/05/23 21:57YES01/05/23 22:40YES-7:20

Regards
 
Upvote 0
Looks not good but works

Try

Excel Practice 05.22.2023.xlsx
ABCDEFGHI
1NO
2YES
3Mus NumSupply VesselVessel Arrive Fairway Buoy Date&TimeMUS Channel Status C/OManifest Date & TimeManifest passed On TimeControl Tower Permission Date & TimePerm Granted On Time Permission Hours
41154CECILIE-K45047.4245047.53NO45047.53Met0:04
51155Z-OCEAN45047.645047.57NO45047.58Met0:11
61156SWISSCO RUBY45048.2545047.91YES45047.94Met-07:20
71157LCT-SHEWELEH45047.6745047.63NO45047.77Not Met3:27
81158A-RANGER45047.8345047.71YES45047.71Met-03:00
91159ADNOC-S0245047.8845047.84NO45048.13Not Met6:46
10
Sheet1
Cell Formulas
RangeFormula
H4:H9H4=IFERROR(IF(G4>E4+TIME(3,0,0),"Not Met","Met"),"")
I4:I9I4=IF(IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4))<0,"-"&TEXT(ABS(IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4))),"hh:mm"),IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4)))
F4:F9F4=IFERROR(IF(E4>C4-TIME(3,0,0),"NO","YES"),"")
 
Upvote 0
Solution
Looks not good but works

Try

Excel Practice 05.22.2023.xlsx
ABCDEFGHI
1NO
2YES
3Mus NumSupply VesselVessel Arrive Fairway Buoy Date&TimeMUS Channel Status C/OManifest Date & TimeManifest passed On TimeControl Tower Permission Date & TimePerm Granted On Time Permission Hours
41154CECILIE-K45047.4245047.53NO45047.53Met0:04
51155Z-OCEAN45047.645047.57NO45047.58Met0:11
61156SWISSCO RUBY45048.2545047.91YES45047.94Met-07:20
71157LCT-SHEWELEH45047.6745047.63NO45047.77Not Met3:27
81158A-RANGER45047.8345047.71YES45047.71Met-03:00
91159ADNOC-S0245047.8845047.84NO45048.13Not Met6:46
10
Sheet1
Cell Formulas
RangeFormula
H4:H9H4=IFERROR(IF(G4>E4+TIME(3,0,0),"Not Met","Met"),"")
I4:I9I4=IF(IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4))<0,"-"&TEXT(ABS(IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4))),"hh:mm"),IF(AND(F4=$A$1,G4>C4-TIME(3,0,0)),G4-E4,IF(AND(F4=$A$2,G4>C4-TIME(3,0,0)),G4-C4,G4-C4)))
F4:F9F4=IFERROR(IF(E4>C4-TIME(3,0,0),"NO","YES"),"")
Dear surfiyan

good day, many thanks to you just perfect as I needed it.
I appreciate your support

thanks
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,069
Members
449,092
Latest member
ipruravindra

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