A
A
anya_hacker2021-04-23 17:49:14
Python
anya_hacker, 2021-04-23 17:49:14

How to sort a column by date in Excel with Python?

I am writing a Python program that inserts a date in the xlsx format into an excel table in the format dd.mm.yyyy

time_publication = 22.04.2021, type = <class 'str'>

I insert the date into the cell using the openpyxl library - the load_workbook, append function.
The line for adding the date to the nested list, which is then inserted line by line into the table:
time_publication = value.strftime('%d.%m.%Y') # это и есть итоговая дата, которую вставляю в столбец
list_in_res.append(time_publication)

I want to sort a column in a table by date. I changed the cell format to date, I click on the filter button, but there is no way to sort by date. He sees for some reason a column as a line. What could be the error?
6082dd9a50d17372344263.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question