+ Reply to Thread
Results 1 to 7 of 7

Sorting info from a query

  1. #1
    Registered User
    Join Date
    01-12-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    14

    Sorting info from a query

    I have attached two files to help explain what I am after as I don't even seem smart enough to just describe what I am needing done, LOL. Excel Sheet2 is the data from a query and I want to sort it and combine it in sheet 1 based on "CARD". But the info I need from that card # is on the line above. Is this even possible???? Any help would be greatly appreciated.
    Attached Images Attached Images

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,863

    Re: Sorting info from a query

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-12-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    14

    Re: Sorting info from a query

    Absolutely, for some reason I never even thought of attaching the excel file.

    OK in this file on Sheet2 is where the data is.
    Columns A-G are autopopulated from a query, I would like to be able to find the gallons and dollars for each card# and also sort it out based on type of fuel ie Unlead, Dyed and Clear

    Does any of this info help or do I need to explain more?
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,863

    Re: Sorting info from a query

    Attached is your file. I used power query to transform the data such that it was in a format that would allow for analysis. I then brought the power query back to excel and created a pivot table that accumulates your data.

    Here is the MCode for Power Query:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Sorting info from a query

    I wrote a regular macro. The scheme needs more workthough. a clearing of all data (end of month, period, etc)
    and all summarized data need to be flagged to avoid repetition on further updates.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-12-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    14

    Re: Sorting info from a query

    Thank you so very much for all your help

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,863

    Re: Sorting info from a query

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [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
  2. [SOLVED] Sql query to get info from sheet1 to sheet2
    By Anton84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2018, 12:17 PM
  3. Replies: 1
    Last Post: 11-29-2015, 08:23 PM
  4. trying to query for info
    By brian56 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2009, 08:53 AM
  5. Get info from Web Query
    By franciz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2006, 05:58 PM
  6. Query AS/400 Info
    By DejaVu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2005, 10:07 AM
  7. [SOLVED] How do I get MS Query to pull info from 3 different workbooks?
    By Husker87 in forum Excel General
    Replies: 0
    Last Post: 05-06-2005, 05:06 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