If time matches list of time within 5 minutes

skoorBmaS

New Member
Joined
Feb 5, 2016
Messages
34
Hi All, I currently have the below formula:

Code:
[COLOR=#000000][FONT=Inconsolata]=[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]IF[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]AND[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#F7981D][FONT=Inconsolata]R2[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]=[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"c"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]MATCH[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#7E3794][FONT=Inconsolata]D2[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#11A9CC][FONT=Inconsolata]'Activity Report'!$A$3:$A$8[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]MATCH[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata]([/FONT][/COLOR][COLOR=#A61D4C][FONT=Inconsolata]B2[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=#4285F4][FONT=Inconsolata]'Activity Report'!$C$3:$C$8[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"Confirmed"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata],[/FONT][/COLOR][COLOR=green][FONT=Inconsolata]"False"[/FONT][/COLOR][COLOR=#000000][FONT=Inconsolata])[/FONT][/COLOR]

The Cell B2 and the column of C in the Activity Report are time and dates, formatted as (dd/mm/yyyy hh:mm:ss). Effectively, when I am matching B2 to the column of C in the Activity report, what I would actually like to do is to count as a match if it is within 5 minutes of the time. With both data sets, we can't reliably confirm that the two times would match, however they are likely to be within 5 minutes of each other.

Anyone know how to do this?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try this


=IF(AND(R2="c",OR(AND(INDEX('Activity Report'!$A$3:$A$8,MATCH(D2,'Activity Report'!$A$3:$A$8))-"00:05"<=D2,INDEX('Activity Report'!$A$3:$A$8,MATCH(D2,'Activity Report'!$A$3:$A$8))+"00:05">=D2),AND(INDEX('Activity Report'!$A$3:$A$8,MATCH(D2,'Activity Report'!$A$3:$A$8)+1)-"00:05"<=D2,INDEX('Activity Report'!$A$3:$A$8,MATCH(D2,'Activity Report'!$A$3:$A$8)+1)+"00:05">=D2)),OR(AND(INDEX('Activity Report'!$C$3:$C$8,MATCH(B2,'Activity Report'!$C$3:$C$8))-"00:05"<=B2,INDEX('Activity Report'!$C$3:$C$8,MATCH(B2,'Activity Report'!$C$3:$C$8))+"00:05">=B2),AND(INDEX('Activity Report'!$C$3:$C$8,MATCH(B2,'Activity Report'!$C$3:$C$8)+1)-"00:05"<=B2,INDEX('Activity Report'!$C$3:$C$8,MATCH(B2,'Activity Report'!$C$3:$C$8)+1)+"00:05">=B2))),"Confirmed","False")
 
Upvote 0
Maybe...

=IF(AND(R2="c",ISNUMBER(MATCH(D2,'Activity Report'!A3:A8,0)),ISNUMBER(MATCH(1,INDEX(--(ABS(B2-'Activity Report'!C3:C8)<=5/1440),),0))),"Confirmed","False")

Not sure about the 0 (I assumed you need an exact match)

M.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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