+ Reply to Thread
Results 1 to 9 of 9

Creating a unique list of all items meeting the criteria using an array formula

  1. #1
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    179

    Creating a unique list of all items meeting the criteria using an array formula

    I am trying to generate a list of all expenses from each quarter. I have attached a sample workbook with sample made up data.

    For various reasons, I cannot name the tables or make them actual tables. So I am working with ranges rather than tables.

    In the quarter 1 "table," I have the type (whether it was income, expense, or taxes) in column B.

    In column C is the expense category (website, business learning, marketing, etc.).

    In column D is the name of the expense (the user enters what they spent the money on).

    In column E is the amount of money earned or spent.

    (Images made up for examples)

    setup.png

    On a report page, I want to list all the expenses for each quarter.

    So in the example above, the list would look like this:

    Example.png

    So to get the names of the expense, I tried this array formula:
    {=IFERROR(INDEX('Template'!B9:E84,SMALL(IF('Template'!B9:B84="Expense",ROW('Template'!B9:E84)-1),ROW(1:1)),3),"")}

    However, it just returned 0 rather than returning "Omnibus book" ( the text found in the 3rd column--column D in array B9:E84--for the first instance where B9:B84="Expense").

    And then I thought to get the next instance of expense, which in the example would be "updates to formatting," I would have the same formula as above, but the row would change from 1:1 to 2:2.

    To then get the expense of the omnibus book, I thought I would have this:
    {=IFERROR(INDEX('Template'!B9:E84,SMALL(IF('Template'!B9:B84="Expense",ROW('Template'!B9:E84)-1),ROW(1:1)),4),"")}

    So now having it return what it is in column 4 (the E column) of the array.

    Etc.

    It isn't working, so I am sure I don't understand how to properly use this array formula. Any ideas where I went wrong? Or other ways to get this list?
    Attached Files Attached Files
    Last edited by dsrt16; 08-16-2018 at 01:31 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: Creating a unique list of all items meeting the criteria using an array formula

    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.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    179

    Re: Creating a unique list of all items meeting the criteria using an array formula

    Thanks. I have attached a sample workbook.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Creating a unique list of all items meeting the criteria using an array formula

    Try this ARRAY formula instead...
    =IFERROR(INDEX(Template!E:E,SMALL(IF(Template!$B$9:$B$84="Expense",ROW(Template!$B$9:$E$84)),ROW(1:1))),"")
    CSE
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Creating a unique list of all items meeting the criteria using an array formula

    Similar to Ford's this can be committed with just Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returns negative numbers which I thought Expenses are. ??
    Dave

  6. #6
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    179

    Re: Creating a unique list of all items meeting the criteria using an array formula

    FlameRetired,

    Negative numbers are fine. Yes, it will return negative as that is what expenses are. I am confused by your formula since it includes the A column (the date) and uses month formula. I don't need the date since all Quarter 1 is in one table range. Quarter 2 is in a different table range etc.

    But I tested it out, and it worked as expected. So thank you!
    Last edited by dsrt16; 08-16-2018 at 12:11 PM.

  7. #7
    Forum Contributor
    Join Date
    11-15-2008
    Location
    Arizona
    MS-Off Ver
    Excel 2013
    Posts
    179

    Re: Creating a unique list of all items meeting the criteria using an array formula

    FDibbins,

    Your formula worked perfectly. Thanks!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Creating a unique list of all items meeting the criteria using an array formula

    Happy to help and thanks for the feedback

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Creating a unique list of all items meeting the criteria using an array formula

    Sorry about the late response. I've been away for a while. Thank you for the feedback.


    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. Replies: 10
    Last Post: 01-02-2017, 01:44 PM
  2. Array formula to return list of unique items from selected columns only
    By jlawton1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2016, 04:53 AM
  3. [SOLVED] Store Unique List Of Items In Array
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2015, 04:09 AM
  4. I need a Productifs function meeting special criteria without Array Formula
    By Packerbacker in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-12-2014, 11:49 PM
  5. [SOLVED] Formula (array?) to list unique entries that match criteria?
    By Rerock in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-11-2014, 04:23 PM
  6. Generate Unique List Meeting Criteria
    By ictodd in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-22-2014, 03:06 AM
  7. Unique list Array Formula dependent of two criteria
    By ron2k_1 in forum Excel General
    Replies: 3
    Last Post: 09-01-2011, 10:50 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