Match columns by second and duplicate values for each match

james_y

New Member
Joined
Aug 14, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have three columns: A (Time), B (Value), C (Time), D (duplicated values from column B)
What I want to do is duplicate a value to column D every time column A and C have the same time.

Column A and C have the same time range. However, there are two problems:
i) column A has 3000 rows for time, but column C has 40,000! That is because it has multiple entries for each second, as the example shows.
ii) column A is sometimes not sequential, i.e., some seconds are missing, 55, 56, 58 etc.

So, the steps that need to happen to solve this are:
1) Interpolate any missing seconds in column A, by inserting missing seconds and duplicating a neighbouring value from column B to fill the gap
2) Duplicate the value from column B and copy to D for every repeating/matching second in column C, i.e., in the example below column D would simply be 13.30 repeated, and so on.


Example of data:

Time Metres Time Metres
23:59:06 13.30 23:59:06 0.00
23:59:07 13.17 23:59:06 0.00
23:59:09 13.13 23:59:06 0.00
23:59:10 12.91 23:59:06 0.00
23:59:12 13.25 23:59:06 0.00
23:59:13 13.36 23:59:06 0.00
23:59:15 13.44 23:59:06 0.00
23:59:16 13.34 23:59:06 0.00
23:59:17 13.08 23:59:06 0.00


Thank you in advance!!
 

Attachments

  • Capture.JPG
    Capture.JPG
    98.2 KB · Views: 11

Excel Facts

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

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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