Time Clash formula not working

eli_m

Board Regular
Joined
Jun 2, 2022
Messages
155
Office Version
  1. 365
Platform
  1. Windows
Hi,

I currently have this data:
1691382149592.png


I have both these conditional formatting to show red::
=AND(COUNTIF($AY$3:$AY$200,AY3)>1,NOT($AY3=""),COUNTIF($AQ3,"Planning Time Approved*")=0,$AX3="No")
=AND(ROW()>1,ABS($V3-$V2)*1440<29,$AX3="No",COUNTIF($AQ3,"Planning Time Approved*")=0)

for both V and AY columns.

Why does this not show up as RED?

It shows RED for another row but it is not correct as the dates are not the same:

1691382306766.png


Any help/reworking would be greatly appreicated.

Thanks!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Why does this not show up as RED?

It shows RED for another row but it is not correct as the dates are not the same:
Well, for one thing, the formulas refer to columns AX and AQ which we cannot see.

Generally when unusual rows show up with Conditional Formatting it is because the cells selected and the formula applied when the CF is set up do not match.
For example, if you had all of column AY selected when you applied this CF formula =AND(COUNTIF($AY$3:$AY$200,AY3)>1,NOT($AY3=""),COUNTIF($AQ3,"Planning Time Approved*")=0,$AX3="No") then everything will be off by 2 rows because the active cell was AY1 but the formula refers to AY3 & AQ3.

We cannot tell much from a picture. If still problems, post the samples again with XL2BB
 
Upvote 0
Well, for one thing, the formulas refer to columns AX and AQ which we cannot see.

Generally when unusual rows show up with Conditional Formatting it is because the cells selected and the formula applied when the CF is set up do not match.
For example, if you had all of column AY selected when you applied this CF formula =AND(COUNTIF($AY$3:$AY$200,AY3)>1,NOT($AY3=""),COUNTIF($AQ3,"Planning Time Approved*")=0,$AX3="No") then everything will be off by 2 rows because the active cell was AY1 but the formula refers to AY3 & AQ3.

We cannot tell much from a picture. If still problems, post the samples again with XL2BB
Thanks for the tip - I have uploaded the XL2BB:
Book1.xlsx
UVAQAXAY
1Planning DatePlanning TimeNotes:Planning PassedPlanning Clashes - Check for 29 Mins
2Example Row - BlankExample Row - BlankExample Row - BlankExample Row - Blank
39/08/202313:10No09/08/23 01:10 PM
424/09/202313:30No24/09/23 01:30 PM
524/09/202313:15No24/09/23 01:15 PM
628/08/202313:30No28/08/23 01:30 PM
78/08/202313:30No08/08/23 01:30 PM
813/09/202314:00Planning Time Approved by EngineeringNo13/09/23 02:00 PM
921/09/20238:30No21/09/23 08:30 AM
Sheet1
Cell Formulas
RangeFormula
AX3:AX9AX3=IFERROR( IF(ISNUMBER([@[Planning Date]]),IF(NOW()>[@[Planning Date]]+[@[Planning Time]],"Yes","No"), ""), "")
AY3:AY9AY3=IF([@[Planning Date]]="N/A","", IF(ISFORMULA([@[Planning Time]]),"", CONCATENATE(TEXT([@[Planning Date]],"dd/mm/yy")," ",TEXT([@[Planning Time]],"hh:mm am/pm"))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AY4:AY9Expression=AND(ROW()>1,ABS($V4-$V3)*1440<29,$AX4="No",COUNTIF($AQ4,"Planning Time Approved*")=0)textNO
AY4:AY9Expression=AND(ROW()>1,ABS($V5-$V4)*1440<29,$AX5="No",COUNTIF($AQ5,"Planning Time Approved*")=0)textNO
AY3Expression=AND(ROW()>1,ABS($V3-#REF!)*1440<29,$AX3="No",COUNTIF($AQ3,"Planning Time Approved*")=0)textNO
AY3Expression=AND(ROW()>1,ABS($V4-$V3)*1440<29,$AX4="No",COUNTIF($AQ4,"Planning Time Approved*")=0)textNO


I am unsure why AY3, AY6 & AY7 is RED.

I just want it to turn red if theres the same date and time 29 minutes from each other

Thanks in advance
 
Upvote 0
I just want it to turn red if theres the same date and time 29 minutes from each other
None of your CF formulas take account of the date (col U).

See if this works for you
Delete the CF in column AY
Select AY3 down to the end of column AY in the table (not the entire column AY)
Apply this CF

eli_m.xlsm
UVAQAXAY
1Planning DatePlanning TimeNotes:Planning PassedPlanning Clashes - Check for 29 Mins
2Example Row - BlankExample Row - BlankExample Row - BlankExample Row - Blank
39/08/202313:10No09/08/23 01:10 PM
424/09/202313:30No24/09/23 01:30 PM
524/09/202313:15No24/09/23 01:15 PM
628/08/202313:30No28/08/23 01:30 PM
78/08/202313:30No08/08/23 01:30 PM
813/09/202314:00Planning Time Approved by EngineeringNo13/09/23 02:00 PM
921/09/20238:30No21/09/23 08:30 AM
10
11
Sheet1
Cell Formulas
RangeFormula
AX3:AX9AX3=IFERROR( IF(ISNUMBER([@[Planning Date]]),IF(NOW()>[@[Planning Date]]+[@[Planning Time]],"Yes","No"), ""), "")
AY3:AY9AY3=IF([@[Planning Date]]="N/A","", IF(ISFORMULA([@[Planning Time]]),"", CONCATENATE(TEXT([@[Planning Date]],"dd/mm/yy")," ",TEXT([@[Planning Time]],"hh:mm am/pm"))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AY3:AY9Expression=OR(AND(ABS(($U3+$V3)-($U2+$V2))*1440<29,$AX3="No",COUNTIF($AQ3,"Planning Time Approved*")=0),AND(ABS(($U4+$V4)-($U3+$V3))*1440<29,$AX4="No",COUNTIF($AQ4,"Planning Time Approved*")=0))textNO
 
Upvote 0
Solution
None of your CF formulas take account of the date (col U).

See if this works for you
Delete the CF in column AY
Select AY3 down to the end of column AY in the table (not the entire column AY)
Apply this CF

eli_m.xlsm
UVAQAXAY
1Planning DatePlanning TimeNotes:Planning PassedPlanning Clashes - Check for 29 Mins
2Example Row - BlankExample Row - BlankExample Row - BlankExample Row - Blank
39/08/202313:10No09/08/23 01:10 PM
424/09/202313:30No24/09/23 01:30 PM
524/09/202313:15No24/09/23 01:15 PM
628/08/202313:30No28/08/23 01:30 PM
78/08/202313:30No08/08/23 01:30 PM
813/09/202314:00Planning Time Approved by EngineeringNo13/09/23 02:00 PM
921/09/20238:30No21/09/23 08:30 AM
10
11
Sheet1
Cell Formulas
RangeFormula
AX3:AX9AX3=IFERROR( IF(ISNUMBER([@[Planning Date]]),IF(NOW()>[@[Planning Date]]+[@[Planning Time]],"Yes","No"), ""), "")
AY3:AY9AY3=IF([@[Planning Date]]="N/A","", IF(ISFORMULA([@[Planning Time]]),"", CONCATENATE(TEXT([@[Planning Date]],"dd/mm/yy")," ",TEXT([@[Planning Time]],"hh:mm am/pm"))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AY3:AY9Expression=OR(AND(ABS(($U3+$V3)-($U2+$V2))*1440<29,$AX3="No",COUNTIF($AQ3,"Planning Time Approved*")=0),AND(ABS(($U4+$V4)-($U3+$V3))*1440<29,$AX4="No",COUNTIF($AQ4,"Planning Time Approved*")=0))textNO

Thank you so much! That seemed to have done the trick. I'll test it out for a few months and see how it fairs.

Thanks again!
 
Upvote 0
You're welcome. Fingers crossed for the future. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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