I’m extracting flight data from a website and putting it into an excel doc. My goal is to then format the sheet based on the Departure Time column so that the earliest flight departure is at the top and the latest departure is on the bottom.
I’m having trouble because when I open my Excel doc it won’t allow me to format the Departure and Arrival times because my Arrival/Departure times are being recognized as text instead of time.
I believe the solution is to convert the text into a Time format but I don’t know how to do it!
Example: The Departure Time entered in the cell appears as “1:30 PM”, however it isn’t recognized as a time. I need to convert this into a time format so I can then have the entire document formatted based on the earliest flight time.
@tmcwade12
You’re on the right track! To format the Departure and Arrival times as time in Excel, you’ll need to convert the text to a proper time format. Here’s a step-by-step guide to achieve this:
Step 1: Insert a New Column (Optional)
To avoid overwriting the original data, you can insert a new column where you will convert the text to time.
Step 2: Convert Text to Time
Assuming your Departure Time is in column A, and you’ve inserted a new column B for the converted times, follow these steps:
Select the entire column B by clicking on the column header (e.g., “B”).
Go to the “Data” tab in the Excel ribbon.
Click on “Text to Columns.”
In the “Convert Text to Columns” wizard, choose “Delimited” and click “Next.”
Leave all the delimiters unchecked and click “Next.”
In the “Column data format” section, select “Time” and choose the appropriate time format that matches your original time format (e.g., “1:30 PM”).
Click “Finish.”
Step 3: Sort by Departure Time
Now that you have the Departure Time column recognized as time, you can easily sort the data based on the Departure Time.
Click on any cell within your data range (including the headers).
Go to the “Data” tab in the Excel ribbon.
Click on “Sort.”
In the “Sort by” dropdown, select the Departure Time column (the new converted column if you created one).
Choose “Oldest to Newest” (A-Z) if you want the earliest flights at the top.
I think just the manual steps for it. I would upload my Excel doc for you to look at but since this is my first time posting it won’t allow me to upload any documents just yet.
Do you know if it’s possible to build these conversion/sorting steps into my UiPath workflow so that when I open my Excel doc it’s already been reformatted and sorted automatically for me? Or can it only be done manually in Excel after the data has been written into the Excel doc?