How to compare any cell in a range with another range?

Ed Harris

New Member
Joined
Dec 9, 2017
Messages
49
Office Version
  1. 2010
Platform
  1. Windows
Can anyone help? I need to find out if any of the times in the left three cells of a row are within some number (say ten seconds) of any of the times in the right three cells of the row then report in another column or highlight the two close cells.
I tried making an IF statement but couldnt work out how to compare any of the cells in the two ranges. Actually it could be to compare all cells in the row as I know the cells in each triplet will never match.

Experiment index.xlsx
ANAOAPAQARASAT
10410:48:4110:48:1110:47:4110:48:3110:47:5110:47:11
10522:16:3822:16:0822:15:3822:16:2722:15:4722:15:07
10605:50:5105:50:2105:49:5105:50:4005:50:0005:49:20
10722:23:4522:23:1522:22:4522:23:3222:22:5222:22:12
10804:31:2304:30:5304:30:2304:31:0904:30:2904:29:49
10913:31:1113:30:4113:30:1113:30:5713:30:1713:29:37
Sheet2
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hows this?
Book1
ABCDEFG
212/09/19 10:48:4112/09/19 10:48:1112/09/19 10:47:4112/09/19 10:48:3112/09/19 10:47:5112/09/19 10:47:11
313/09/19 22:16:3813/09/19 22:16:0813/09/19 22:15:3813/09/19 22:16:2713/09/19 22:15:4713/09/19 22:15:07
414/09/19 05:50:5114/09/19 05:50:2114/09/19 05:49:5114/09/19 05:50:4014/09/19 05:50:0014/09/19 05:49:20
528/09/19 22:23:4528/09/19 22:23:1528/09/19 22:22:4528/09/19 22:23:3228/09/19 22:22:5228/09/19 22:22:12
604/10/19 04:31:2304/10/19 04:30:5304/10/19 04:30:2304/10/19 04:31:0904/10/19 04:30:2904/10/19 04:29:49
704/10/19 13:31:1104/10/19 13:30:4104/10/19 13:30:1104/10/19 13:30:5704/10/19 13:30:1704/10/19 13:29:37
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:G7Expression=OR(ABS(E2-$A2:$C2)<=TIME(0,0,10))textNO
A2:C7Expression=OR(ABS(A2-$E2:$G2)<=TIME(0,0,10))textNO
 
Upvote 0
Solution
jasonb75 Thats great, and you forced me to find out about conditional formatting! Thanks
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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