+ Reply to Thread
Results 1 to 8 of 8

If, sort, filter issue

  1. #1
    Registered User
    Join Date
    03-16-2025
    Location
    Jacksonville, FL
    MS-Off Ver
    Professional Plus 2021
    Posts
    3

    If, sort, filter issue

    I am trying to create a workbook/spreadsheet to capture our mileage for tax purposes. I know there are several "apps" out there that accomplish this as well as several "Excel Templates", but they don't really capture what I am looking for. I've attached a simple workbook that captures data on one spreadsheet and I am attempting to create a "report" on another spreadsheet that will produce a printable report based on certain criteria (vehicle and purpose). I was trying to write a "IF(SORT(FILTER) formula to capture the necessary data but keep getting an error that I have too many variables. The formula that I have been trying is: IF($B3$='Vehicle Mileage Log'!A6:A250,SORT(FILTER('Vehicle Mileage Log'!B:H,'Vehicle Mileage Log'!A:A=$B$3),4,False,5,False,6,False),SORT(FILTER('Vehicle Mileage Log'!B:H,'Vehicle Mileage Log'!A:A=$B$3),4,True,5,True,6,True))"),"")

    Any help would be greatly appreciated, for information I am using Excel 2021.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: If, sort, filter issue

    Hi and welcome

    This is a guess as you've not shown us what your expected results are.

    In A8
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    BSB

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: If, sort, filter issue

    Does this do what you want:

    PHP Code: 
    =IFERROR(SORT(CHOOSECOLS(FILTER('Vehicle Mileage Log'!A6:K10,('Vehicle Mileage Log'!A6:A10=B3)*('Vehicle Mileage Log'!J6:J10=B4),"no data"),1,3,4,5,6,7,8,10,11),{4,5,6},{1,1,1}),"no data"
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    03-16-2025
    Location
    Jacksonville, FL
    MS-Off Ver
    Professional Plus 2021
    Posts
    3

    Re: If, sort, filter issue

    Thanks for the quick reply! This formula does not appear to fix. What I am trying to obtain are all of the "log entries" in "Vehicle Mileage Log" that would meet the criteria selected in "B3 and B4" of the "Assignment History Report".


    cardak

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,951

    Re: If, sort, filter issue

    That's exactly what it does do, in your sample file. You'd need to adjust the ranges for your real file.

    But if you disagree, then show us what your expected results are so we're not just guessing.


    BSB

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: If, sort, filter issue

    Ditto. Though mine needs a slight tweak.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Instead of:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-16-2025
    Location
    Jacksonville, FL
    MS-Off Ver
    Professional Plus 2021
    Posts
    3

    Re: If, sort, filter issue

    All, thanks for the input, I was able to resolve the issue (I had neglected to format the data as a table)!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,521

    Re: If, sort, filter issue

    You're welcome.



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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Replies: 6
    Last Post: 01-13-2023, 04:42 PM
  2. [SOLVED] SORT and FILTER Functions | Exclude Cells but Still Sort Alphabetically
    By Nevanox in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 12-27-2022, 01:53 PM
  3. [SOLVED] Index and Filter Functions: Workaround to sort, filter, and format within array?
    By beginner21 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-25-2021, 04:48 PM
  4. Replies: 1
    Last Post: 08-17-2019, 01:11 PM
  5. [SOLVED] Excel 2016 Sort routine issue - recording macro has sheet name in sort routine
    By pongmeister in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2016, 02:45 PM
  6. [SOLVED] Filter issue: data does not appear in filter box
    By Madmortagan68 in forum Excel General
    Replies: 2
    Last Post: 04-15-2013, 01:00 PM
  7. Filter or sort data issue
    By seayakwc in forum Excel General
    Replies: 5
    Last Post: 11-05-2009, 09:08 AM

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