It's 2:27 AM now. Got my graveyard shift now. And boss gave me a task. It looks simple yet it's very frustrating since i have to deal with crazy disorganized arrays of data. For example, the first row is a data at 2 Sept 2008 08:02:00 AM. But the next row is data at 1 Sept 2008 23:10:26 PM, then continue with 2 Sept 2008 00:10:27 AM. See the image

By the way, im dealing with sea level height data, sent by tsunami buoy. And in this post, i will use example of three data row. You can apply it for thousands of data (as long as the data fit in excel, cause excel limited the number of data row to 65000 or so). As you can see, the date, hour, minute and second placed separatelly. This is an advantage (at least for me, hehe). Here's the idea. I want to combine the date, hour etc. into a single cell. What im doing here is write this formula:

I multiply the minute with 100, hour with 10000 and date with 1000000 and then add them all (with second too), in a single cell. Then copy it to other rows. What does this step for? It's to give the ID to the each of time parameters, so there will be no same ID for each of time parameters.
This ID is very important for the further steps. Copy the ID column, Paste Special(Values) it on the left of all data. We give the name 'ID' to make it looks simple.

Now, copy the 'ID' column to another sheet. And then, sort them ascending or descending, depend to your liking. I prefer ascending. Now, we use VLOOKUP formula. This is how it works. The table that we placed sorted ID is Table 2, and the original one named Table 1. VLOOKUP searches for a ID value in the Table 2, and then searches the same ID value in the Table 1. If it finds a same value, we can 'catch' the data from that row. If you confuse with the explanation (not a good explanator through, hehe) let's get down to the practical use. In the Table 2, place a formula like this:

I will explain each of the parameter. The first value (A2), is the ID, the value that we will looking for in Table 1.
The second one (Sheet2!$A$2:$H$1370) is the Table 1. I have my Table 1 at Sheet2, the rows of the table is 1369 (from 2 to 1370) and the column from A to H. We placed $, so the table selection will stay in that position if we copy-paste the VLOOKUP formula to another row.
Third parameter is '8', which is the number of the column that we want to 'catch' the data. Look at the previous pic. The 'height' data is in the 8th column. If you want to take the 'hour', you can replaced it with '5'.
And at last, the last parameter is 'FALSE', it means that if the ID value from Table 2 didn't match with the Table 1, it will finds the closest value. You can see Microsoft Excel Help for more information about VLOOKUP.
Once you get the formula right, just copy and paste it to another rows. That's it from me. Hope this trick is helpful. Cheers
Komentar
ka dito rekues turorial MATLAB euy,,
salam2 buat mamah di rumah
(jiga rikues di radio wae..hahah)
for beginer nya hahahaha