Index Match with time range criteria?

sleeplab

New Member
Joined
May 31, 2018
Messages
1
The Problem
So the raw data I'm using looks like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Time[/TD]
[TD]Activity[/TD]
[TD]Code[/TD]
[/TR]
[TR]
[TD][TABLE="width: 124"]
<tbody>[TR]
[TD="class: xl64, width: 124"]8/31/2017 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]16:05[/TD]
[TD]10[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]8/31/2017 [/TD]
[TD]17:13[/TD]
[TD]5[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]9/1/2017[/TD]
[TD]15:00[/TD]
[TD]1[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]

And I'm trying to format it to look like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Activity_15:00[/TD]
[TD]Code_15:00[/TD]
[TD]Activity_16:00[/TD]
[TD]Code_16:00[/TD]
[TD]Activity_17:00[/TD]
[TD]Code_17:00[/TD]
[/TR]
[TR]
[TD]8/31/2017 [/TD]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]9/1/2017[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Criteria: Timestamp on the code must be within 15 minutes of the hour

So I figured I'd use an index match to compare the time stamp to an independent table with times (ie. 15:45/16:15). However I'm running into problems trying to create an array, and being able to select both the activity value, and code value.

Am I using the correct function with a index match, or vlookup?

Thanks.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
It is hard to build a formula that uses the values in the first row. If you can rearrange your values in the first row?

Date Activity_15:00 Code_15:00 Activity_16:00 Code_16:00 Activity_17:00 Code_17:00

to something like this:

Activity_15:00 Activity_16:00 Activity_17:00
 
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