Results 1 to 8 of 8

Not sorting correctly

Threaded View

  1. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2509 Win 11
    Posts
    25,002

    Re: Not sorting correctly

    With Power Query, I was able to combine the dates and times and then sort them.
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type time}, {"Column5", type text}, {"Column6", Int64.Type}, {"Column7", Int64.Type}, {"Column8", type text}, {"Column9", Int64.Type}, {"Column10", Int64.Type}, {"Column11", Int64.Type}, {"Column12", type date}, {"Column13", Int64.Type}}),
        #"Inserted Merged Date and Time" = Table.AddColumn(#"Changed Type", "Merged", each [Column4] & [Column12], type datetime),
        #"Sorted Rows" = Table.Sort(#"Inserted Merged Date and Time",{{"Merged", Order.Ascending}})
    in
        #"Sorted Rows"
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] columns not sorting correctly
    By joe313 in forum Excel General
    Replies: 5
    Last Post: 07-04-2020, 03:36 AM
  2. [SOLVED] Power Query Sorting by Date not sorting correctly
    By kersplash in forum Excel General
    Replies: 5
    Last Post: 08-20-2018, 02:59 AM
  3. [SOLVED] Sorting numbers... correctly
    By LonesomeJoe in forum Excel General
    Replies: 6
    Last Post: 06-11-2014, 04:59 PM
  4. numbers not sorting correctly
    By JMTMayor in forum Excel General
    Replies: 15
    Last Post: 08-01-2013, 12:00 PM
  5. sorting not working correctly
    By jjbigfish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-27-2012, 02:46 PM
  6. [SOLVED] Date not sorting correctly....
    By DeeLaa77 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-28-2012, 08:50 AM
  7. Not sorting correctly
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2008, 03:48 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1