Avatar of Joe Hall
Joe Hall
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Filtering dates and times in excel 2010 and 2013.

I am working with exported data from a flat database, I have no control over its initial formatting.

When the data is exported its comes out with a date formatted as “dd/mm/yyyy hh:mm:ss”.

I need to sort, filter and makes reports with date and time.

What is the best way for doing this?

I am currently using “Text to Columns” and splitting the date and time into two columns.

I am then able to format the date as “date”, and I can sort on that column, and I can use filter to filter dates.

When I format time as time or dd:mm:yyyy it lets me sort on the column, but I can’t get a filter time. What am I doing wrong?
Microsoft Excel

Avatar of undefined
Last Comment
redmondb

8/22/2022 - Mon
terencino

Hi Joseph it seems like this should work OK, can you send a sample sheet with the problem data? Is it possible the time column is being treated as text or was not converted on the text to columns process?
...Terry
redmondb

Hi, Joseph_Hall.

I can’t get a filter time.
Do you mean that you can't get the hierarchical filter (where it shows hours with a plus symbol beside to expand to minutes, etc.)? These are only shown for times when they are part of a date.

Regards,
Brian.
Joe Hall

ASKER
Hi Brian.
Drat .. I thought I sent this in the morning . dont now why it did not go.

I am a lil confused.

if you look at the uploaded spreadsheet you will see two worksheets

the first week sheet is in form of one collumn as "dd/mm/yyyy hh:mm:ss". This is how the data is exported from Gemini.

I am no table to use the date format on that string.

To ge it working I have to split the date and the time.

So if you look in the second work sheet you see two comumns being used. in this case I am able to fomat the date cumomn as DATES, and use fate filters. But the time column when formated as time only gives me texts filters.

Regs
Joe
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
redmondb

Thanks, Joe - but still no file!
Joe Hall

ASKER
Sorry here are the example dates

So if you look in the second work sheet you see two comumns being used. in this case I am able to fomat the date cumomn as DATES, and use fate filters. But the time column when formated as time only gives me texts filters.
Gemini-Sample.xlsx
terencino

I think I understand... On the Gemini Original sheet, multiply all the values by 1, which will convert them from text to date, then they will format and group OK in your autofilter.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
terencino

Oh, to do that, type 1 into the Gemini Original sheet, in say B2, Copy it, then select all of the values under Date/Time column, then Paste Special > Values > Multiply > OK
Then format the dates as required, autofilter it and delete the 1 in B2.
If you don't want the dates grouped in AutoFilter, go to File > Options > Advanced > Display options for this workbook > uncheck Group dates in the AutoFilter menu
Joe Hall

ASKER
at he risk of being dumb .. what do mean multiply all the values by 1?
In cell a2 you have "30/12/2012 08:22:46".

if in cell c3 I put "=c2*1" I get 41273.349. how dose this help?

Joe
Joe Hall

ASKER
ok lets me expain this again ..

I have a data / time field on one cell . .ie "30/12/2012 08:22:46"

for this to be usable I want to be able to sort and filter on these values, how do I do that?

I assume I have to spit the two vaues?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
terencino

Just have a look at my last post Joe, can you do what I said there and let me know? I sent two posts one after the other, the second had the how-to, sorry about that
ASKER CERTIFIED SOLUTION
redmondb

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Joe Hall

ASKER
OK thanks .. got that to work .. sort of.

doing what you say I can get a single field ""30/12/2012 08:22:46" to work.

But when I try to split into two ..
A2 = 30/12/2012
B2 = 08:22:46

I format A as date
I format B as time

and aply filter ... then A as date filter, but be has number filter.

Number filter kinda seams to work as time filter .. but not sure. Can you confirm if that is true?

Joe
Joe Hall

ASKER
just tring your last comment
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Hall

ASKER
OK !!!!! that lost post made sence to me. I see whats happening. !!!!! thanks.!!
redmondb

Joe,

Edit: Oops, the following is a crossing post.

As I mentioned in my initial post, Excel only does a hierarchical filter for Time as a part of a Date, so, as you've seen, a time appears as a numeric filter.

However, you can still enter Times into the filter, e.g. 08:00:00. (Of course, if you look at the filter later, your nice time will now show as 0.333333333333333 - which is actually how Excel stores Times internally.)

Regards,
Brian.
Joe Hall

ASKER
OK .. just double checked with the live data ..  I use the "Text to Columns" option, but not realy spliting it... t works, and is much easia than I was trying to do by spliting the data.

With out even reformting the date / time field the filter auto pics it up correctly.

thanks.

Joe
Your help has saved me hundreds of hours of internet surfing.
fblack61
Joe Hall

ASKER
It works !!! Thanks Brian.
redmondb

Thanks, Joe, happy to help.