Finding The Closest To A Particular Time

TGM

Board Regular
Joined
Jul 31, 2005
Messages
107
Hello,

I hope someone can help as I haven't a clue about where to start with this one.

I have the following three columns in a worksheet.

I would like to search columns A and B for the cell that is closest in time to 12:00:00.

Once it has found it I would like to have the corresponding ODDS for that time displayed in cell D1.

In this case it would be 3.45 as cell A24 is closest to 12:00:00.
HistoricBetfairDataAnalysis.xls
ABCD
1LATEST_TAKENFIRST_TAKENODDS
203/02/200614:18:1103/02/200614:16:532.72
303/02/200614:18:1603/02/200614:15:292.74
403/02/200614:18:2603/02/200614:15:392.76
503/02/200614:18:2803/02/200614:14:592.78
603/02/200614:18:2903/02/200614:11:502.80
703/02/200614:18:3603/02/200614:11:492.82
803/02/200614:18:4003/02/200614:11:012.84
903/02/200614:18:4103/02/200614:10:592.86
1003/02/200614:18:4303/02/200614:10:542.88
1103/02/200614:18:4703/02/200614:10:212.90
1203/02/200614:18:5002/02/200621:28:182.92
1303/02/200614:18:5203/02/200614:10:012.94
1403/02/200614:20:2903/02/200614:09:402.96
1503/02/200614:20:4302/02/200621:31:282.98
1603/02/200614:20:4302/02/200621:08:493.05
1703/02/200614:20:0902/02/200621:31:023.10
1803/02/200614:04:2803/02/200610:56:203.15
1903/02/200613:52:1002/02/200621:03:143.20
2003/02/200613:32:4602/02/200621:48:513.25
2103/02/200613:08:0802/02/200620:35:013.30
2203/02/200612:22:5002/02/200622:26:093.35
2303/02/200612:15:5702/02/200621:48:513.40
2403/02/200612:14:2102/02/200621:48:513.45
2503/02/200610:09:5802/02/200622:07:103.50
2603/02/200610:08:3702/02/200622:22:373.55
2703/02/200610:11:4102/02/200622:41:593.60
2803/02/200610:09:0902/02/200622:41:593.65
2903/02/200609:19:1402/02/200622:41:593.70
3002/02/200622:42:1602/02/200622:42:073.75
Sheet1


Many thanks for any help,

Scott
 
I went ahead and deleted my post; my formula wasn't quite right. Try Dom's. I didn't test his, but based on his track record I'm guessing it'll be good.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Cheers Domenic,

Works fine, I realise why you asked the last question now.

Many thanks,

Scott
 
Upvote 0
Hello again,

I think I have got my head around the formula now. Cheers once again.

I would like to know though, how would that formula be written in pure VBA?

Many thanks,
Scott
 
Upvote 0
Not 100% clear on what you're lookin' for...<ul>[*]You want VBA to put that array formula into a particular cell?[*]Or you want a UDF that will accomplish what that formula does?[/list]
 
Upvote 0
Hi Greg,

I would like VBA to put the either the array formula or the results of the array formula into a specific cell.

Cheers,
Scott
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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