+ Reply to Thread
Results 1 to 6 of 6

Stripping out unwanted data

  1. #1
    Registered User
    Join Date
    06-14-2008
    Posts
    3

    Stripping out unwanted data

    I have a csv file of dtata that I can open in Excell.

    The data is timestamped in coloumn D and is taken every two minutes.

    I.e. the format shown in "D" is 01/01/2008 06:00:00

    I need to strip out all the data apart from the ones on the hour.

    One months data is 22141 rows so would take ages manually.

    I tried to use the filter and put ends in 00:00 but everything dissapears.

    Any help appreciated

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Text to columns > delimiter would be space or

    =TIME(HOUR(D1),MINUTE(D1),SECOND(D1))
    Format cell as time

    or

    =TEXT(D1,"HH:MM")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    i think mpb1955 means strip the non whole hours out from say
    01/01/2008 06:00:00
    01/01/2008 06:02:00
    01/01/2008 06:00:09
    01/01/2008 06:00:07
    01/01/2008 06:00:03
    01/01/2008 07:00:00

    to leave just
    01/01/2008 06:00:00
    01/01/2008 07:00:00
    if thats the case and the cells havent been formatted as time when it was imported, try in an empty column say AA
    Please Login or Register  to view this content.
    and drag fill down to last row
    then copy AA and paste it back special /values into same column(AA)
    then sort whole sheet by column AA
    that should bring all the full hour ones to top
    delete everything after them

  4. #4
    Registered User
    Join Date
    06-14-2008
    Posts
    3

    Still need help

    martindwilson

    Your description of my needs are correct.

    I tried the code you posted and it does not work.

    The "D" column has been formatted to a date & time and seems to be automatic when opening the original csv file.

    dd/mm/yyyy hh.mm

    Your code does not bring any values to sort by.

    Any help appreciated.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =RIGHT(TEXT(A1,"H:MM"),2)="00"
    Change A1 to the start of your data and drag down. Filter on True to only show whole hrs

    VBA Noob

  6. #6
    Registered User
    Join Date
    06-14-2008
    Posts
    3

    Thanks

    VBA Noob

    Great solution

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1