IF Statement Issue

mrsushi

Board Regular
Joined
Nov 18, 2006
Messages
180
Office Version
  1. 2010
For some reason when the time in Column C (09:15) is greater than Column D (08:15), doesn't return "LATE"

Any ideas pls?

Excel Formula:
=IF(C4>D4, IF(OR(H4="BBA", H4="DRFI", H4="EUR", H4="7 Day EUR LIBID", H4="LGI6"), "Late Delivery", IF(OR(H4="NYFR", H4="NYFR"), "Delayed Delivery PM", IF(OR(H4="SONIA", H4="PFBL98"), "Delayed Delivery AM"))),  IF(C4<D4, "Delivered", "Late"))
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Please post an xl2bb of your worksheet? (link for xl2bb add in is below).

Please verify your time formats and values. what is the value of cells C4 and D4? You may have one on 24 hr day, and one on AM/PM day? Try formatting both columns as hh:mm:ss and see if you see any differences.
 
Upvote 0
Please post an xl2bb of your worksheet? (link for xl2bb add in is below).

Please verify your time formats and values. what is the value of cells C4 and D4? You may have one on 24 hr day, and one on AM/PM day? Try formatting both columns as hh:mm:ss and see if you see any differences.

Hi ,

Cant install as I'm working from a work network.

The table is as per below from Column A to H

Formula in Column E is =IF(C2>D2, IF(OR(H2="BBAR", H2="DRFI_GBP", H2="EURI", H2="E - 7 Day EUR LIBID", H2="LGI6_LATE"), "Late Delivery", IF(OR(H2="NYFRCUST", H2="NYFR"), "Delayed Delivery PM", IF(OR(H2="DRFICUST", H2="PFBL98"), "Delayed Delivery AM", ""))), IF(C2<D2, "Delivered", "Late"))

The last 3 cells need to return LATE, but its returning nothing.

File NameDATE/TIME29/02/24DeadlineStatusPathFile
01/03/2024 05:3109:1508:15Late DeliveryBBAR
01/03/2024 05:3110:0008:15Late DeliveryE - 7 Day EUR LIBID
01/03/2024 05:3111:0008:15Delayed Delivery PMNYFRCUST
01/03/2024 04:1511:4508:15Delayed Delivery AMPFBL98
01/03/2024 04:4509:0008:15CLOSE
01/03/2024 05:3409:0008:15OPEN
02/03/2024 05:3409:0008:15OPEN
 
Upvote 0
When I use your formula I get a blank because that is what it maps to:
=IF(C2>D2,
IF(OR(H2="BBAR", H2="DRFI_GBP", H2="EURI", H2="E - 7 Day EUR LIBID", H2="LGI6_LATE"),​
"Late Delivery",​
IF(OR(H2="NYFRCUST", H2="NYFR"),​
"Delayed Delivery PM",​
IF(OR(H2="DRFICUST", H2="PFBL98"),​
"Delayed Delivery AM",​
""))),​
IF(C2<D2,​
"Delivered",​
"Late"))​
 
Upvote 0
When I use your formula I get a blank because that is what it maps to:
=IF(C2>D2,
IF(OR(H2="BBAR", H2="DRFI_GBP", H2="EURI", H2="E - 7 Day EUR LIBID", H2="LGI6_LATE"),​
"Late Delivery",​
IF(OR(H2="NYFRCUST", H2="NYFR"),​
"Delayed Delivery PM",​
IF(OR(H2="DRFICUST", H2="PFBL98"),​
"Delayed Delivery AM",​
""))),​
IF(C2<D2,​
"Delivered",​
"Late"))​
oK, how can the formula be amended to return the value of "late" for the last 3 rows? Is there a better way of writing this IF function pls?
 
Upvote 0
what are the requirements for all statuses?
 
Upvote 0
what are the requirements for all statuses?
The requirements .....If the times in column C is less than D, then should return "Delivered", otherwise it should return "Late".

However, there in column H, specifies certain files ie BBAR, Open, Close etc, therefore if C is less than D, then return "Delivered", otherwise it should return as follows

BBAR = Late Delivery
E - 7 Day EUR LIBID = Late Delivery
NYFRCUST = Delayed Delivery PM
PFBL98 = Delayed Delivery AM
 
Upvote 0
This is the problem, you are trying to process the EXACT condition twice, it will never get to the second occurrence.
you need to redefine your logic.

The requirements .....If the times in column C is less than D, then should return "Delivered", otherwise it should return "Late".

However, there in column H, specifies certain files ie BBAR, Open, Close etc, therefore if C is less than D, then return "Delivered", otherwise it should return as follows
 
Upvote 0
In general, 2 outcomes are needed based on the time in Col C and D ie Delivered or Late. However, is there no way to base this on criteria in Column H?
 
Upvote 0
try this:

Book3
ABCDEFGHIJKLM
1File NameDATE/TIME2029-02-24DeadlineStatusPathFile
201/03/2024 05:3109:1508:15Late DeliveryBBARBBARLate Delivery
301/03/2024 05:3110:0008:15Late DeliveryE - 7 Day EUR LIBIDE - 7 Day EUR LIBIDLate Delivery
401/03/2024 05:3111:0008:15Delayed Delivery PMNYFRCUSTNYFRCUSTDelayed Delivery PM
501/03/2024 04:1511:4508:15Delayed Delivery AMPFBL98PFBL98Delayed Delivery AM
601/03/2024 04:4509:0008:15CLOSE
701/03/2024 05:3409:0008:15OPEN
802/03/2024 05:3409:0008:15OPEN
9
10
1109:1508:15Late DeliveryLate DeliveryBBAR
1210:0008:15Late DeliveryLate DeliveryE - 7 Day EUR LIBID
1311:0008:15Delayed Delivery PMDelayed Delivery PMNYFRCUST
1411:4508:15Delayed Delivery AMDelayed Delivery AMPFBL98
1509:0008:15LateCLOSE
1609:0008:15LateOPEN
1709:0008:15LateOPEN
Sheet1
Cell Formulas
RangeFormula
F11:F17F11=IF(C11>D11,XLOOKUP(H11,K2:K5,L2:L5,"Late",0,1),"Delivered")
 
Upvote 0

Forum statistics

Threads
1,215,475
Messages
6,125,028
Members
449,205
Latest member
Eggy66

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