Question

I've got some data from a database that lists dates in the following format:

  • 3/2/13 0:09
  • 3/1/13 20:12
  • 3/1/13 3:02
  • 3/1/13 0:45

I need to create a column in my spreadsheet and put them into 12 hour categories, essentially turning it into this:

  • 3/2/13 0:00
  • 3/1/13 12:00
  • 3/1/13 0:00
  • 3/1/13 0:00

If it's between midnight and 12pm, I want it to say midnight, if it's between 12pm and midnight, I want it to say 12pm. I have over 3500 rows of data spanning 2 weeks of dates, so I'm looking for the proper excel formula to make this happen. I've been playing with conditional "If" formulas, but have yet to get it right. Can someone help?!

Was it helpful?

Solution

Excel stores dates & times internally as numbers where 1.0 equals 1d, 0.5 = 12h. Therefore, you can use a simple rounding trick:

=INT(A1*2)/2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top