closing tag is in template navbar
timefactors watches



TZ-UK Fundraiser
Results 1 to 7 of 7

Thread: One for the Excel experts: stripping Time out of a (text) Date/Time

  1. #1
    Master MakeColdplayHistory's Avatar
    Join Date
    Jul 2013
    Location
    United Kingdom
    Posts
    5,884

    One for the Excel experts: stripping Time out of a (text) Date/Time

    I have some data with events that happened in a format like this:
    07-Jan-2021 08:13:57 GMT
    It has come from .csv into Excel and as far as I can tell is not formatted as Date/Time but is just text, hence the 'GMT'.
    What I really want to do if count these events into hourly buckets - so this one happened between 08:00 and 08:59 and disregard the date.
    I'm sure this is possible and I could probably have done it myself when I used Excel a lot but, for a Friday afternoon, it has me stumped.

    Can anyone assist?
    Or should I just knock off early and go to the pub?

  2. #2
    Master r.dawson's Avatar
    Join Date
    Sep 2009
    Location
    Up North
    Posts
    1,017
    Delimit by space?

    Or =right 12 characters?

  3. #3
    Master MakeColdplayHistory's Avatar
    Join Date
    Jul 2013
    Location
    United Kingdom
    Posts
    5,884
    Quote Originally Posted by r.dawson View Post
    Or =right 12 characters?
    Excellent =right 12 chars gives me just the time (inc GMT) then =left 2 chars gives me just the hour which is what I really want.

    Would you like a pint? (i.e. a fiver to a charity of your choice) Or should I bung it into the fundraiser?

  4. #4
    Master jukeboxs's Avatar
    Join Date
    Apr 2009
    Location
    Scotland
    Posts
    5,457
    Have another column (say X) = INT(MID("date", 13,2)) to give the hour as an integer. And then use COUNTIF to group these into hourly buckets (e.g. COUNTIF("x:x",8) for the number in the 8:00-8:59 time slot.

  5. #5
    Master r.dawson's Avatar
    Join Date
    Sep 2009
    Location
    Up North
    Posts
    1,017
    Quote Originally Posted by MakeColdplayHistory View Post
    Excellent =right 12 chars gives me just the time (inc GMT) then =left 2 chars gives me just the hour which is what I really want.

    Would you like a pint? (i.e. a fiver to a charity of your choice) Or should I bung it into the fundraiser?
    Very generous, stick it in the fundraiser and I'll put a fiver in as well

  6. #6
    Master
    Join Date
    Jan 2010
    Location
    Coming Straight Outer Trumpton
    Posts
    9,385
    How often do you need to do this?

    If a one off then add a new column to the start of the sheet use that a index in case you ever need to view the data in its original sequence. Then use text to columns split the date, hour, minuet fields out and sort by hour.

  7. #7
    Master
    Join Date
    Jul 2011
    Location
    North Wales
    Posts
    4,100
    Quote Originally Posted by r.dawson View Post
    Very generous, stick it in the fundraiser and I'll put a fiver in as well
    Win win excellent , well done guys.

Posting Permissions

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

Do Not Sell My Personal Information