Time approximation in Index Match

snejsnej

New Member
Joined
May 3, 2010
Messages
45
Hi there,

I have a column containing a large-ish number of cells (column "A"). Each cell contains a concatenation of a dollar figure (can be pos or neg) & a card number & a datetime (MM/DD/YY hh:ss). Example:

-2.23|6202xxxxxxxxxxxx|08/06/13 10:02

<tbody>
</tbody>

I have generally been successful looking for an exact match in two other columns (columns "B" & "C") using Index Match.

The problem I have is that the minute portion of the datetime group in the string (i.e. the last 2 characters) may be off by 1 minute in columns B & C compared to what is in column A. For example:

Column A: -2.23|6202xxxxxxxxxxxx|08/06/13 10:02
Column B & C: -2.23|6202xxxxxxxxxxxx|08/06/13 10:01

The data from B & C are from a different system: they are written to this system very shortly before being written to the second system (data in column A).

This means that most of the time, the data match. But every so often they don't (i.e. when the data in the first system is written a few milliseconds before the rollover to the next minute).

Is there a way to do a check with a tolerance of 1 minute on the datetime section of the string? Or how could this best be done?

Many thanks,
Jens
 
Last edited:
Hi Damon,

Sorry about this, but when I wrote yesterday that your UDF worked, I was a little hasty, i.e. I was sure it would work but didn't actually check it (I was in a hurry and wanted to thank you for your efforts...).

Anyway, I'm hoping you can help me out. I tried your macro but nothing is returning, i.e. the cells all remain blank.

I'm using it as follows: matchdatetime(G2,L:L,K:K), where G2 is the value to be searched for in column L, with the corresponding value in column K to be returned in E2 (where I entered the UDF).

Many thanks,
Jens
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Jens,

At the absolute minimum it should be returning "---" if no match occurs. It worked quite well with a test worksheet I made. I am going to PM you with my email address, and if you can email your workbook to me I will debug it.

Damon
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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