+ Reply to Thread
Results 1 to 9 of 9

If condition met, return all values from column

  1. #1
    Registered User
    Join Date
    03-28-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    5

    If condition met, return all values from column

    Looking for some help on how to identify if a condition has been met, then return all values in the column associated with the compamny

    Have a spreadsheet of companies we have worked with and what outputs we have delivered to them. What I’m trying to do is identify all companies that have completed a specified outcome (a C1) and return all additional outputs the company have achieved

    Using the attached abbreviated example below, company ‘ABC Ltd’ would be returned twice, with the outputs C5 and E1 displayed. Company ‘Megacorp’ would not be returned as it has not met the condition of completing the output C1.’London Ltd’ returned once with output ‘C3; returned.

    Example

    Company name Outputs
    ABC Ltd C1
    ABC Ltd C5
    ABC Ltd E1
    MegaCorp D2
    London Ltd C1
    London Ltd C3

    Being beyond my current knowledge I don’t know whether Excel is the best tool. This data is extracted from our CRM and we have the option to use PowerBI to complete this query.

    Any help appreciated!

  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,869

    Re: If condition met, return all values from column

    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
    Registered User
    Join Date
    03-28-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    5

    Re: If condition met, return all values from column

    Hi, thanks for the reply . I did try to post a workbook however as you say the functionality isn't working and the alternative solution wasn't obvious. Thanks for clarifying.

    Sample data attached with desired outcome shown in another sheet.
    Attached Files Attached Files

  4. #4
    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,869

    Re: If condition met, return all values from column

    Why does the desired outcome miss out London's C1 result when it is there for ABC? You said this:

    What I’m trying to do is identify all companies that have completed a specified outcome (a C1) and return all additional outputs the company have achieved.

  5. #5
    Registered User
    Join Date
    03-28-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    5

    Re: If condition met, return all values from column

    That's right, completing a C1 is a condition, if that has been met I don't need that returning just any other additional outputs that have been achieved.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: If condition met, return all values from column

    This proposed solution employs a helper column (D) on the Source Data sheet, which may be hidden for aesthetic purposes, using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The table on the Desired Outcome sheet is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    03-28-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    5

    Re: If condition met, return all values from column

    Excellent! Thanks, JeteMc.

    I should read up on how the Index function works, if you can offer any comments on how it's used here that'd be great.

    Thanks again.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: If condition met, return all values from column

    You're Welcome and thank you for the feedback.
    In this case the INDEX function returns the values indicated by the AGGREGATE function. So in column A it will display the first, second, third etc company name that has a 'Y' in column D on the 'Source Data' sheet. One good way to see what a formula is doing is to select a cell containing the formula and run the Evaluate Formula tool. In this case I would suggest selecting cells A4 and C4 (perhaps C5) on the Desired Outcome sheet.
    Please take a moment to mark the thread as 'Solved' using the thread tools drop down in the ribbon above your first post. I hope that you have a blessed day.

  9. #9
    Registered User
    Join Date
    03-28-2018
    Location
    Manchester, England
    MS-Off Ver
    2016
    Posts
    5

    Re: If condition met, return all values from column

    Thanks for the comments, very useful.

    Marked as solved.

+ 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: 4
    Last Post: 11-20-2014, 08:49 AM
  2. Return values if more than 1 condition are met
    By jleblanc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2014, 10:12 AM
  3. [SOLVED] Return a specific value from another column if a condition is met
    By edward12 in forum Excel General
    Replies: 4
    Last Post: 07-23-2014, 04:28 PM
  4. Return top values that meet a certain condition
    By ggmm in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-04-2013, 05:54 PM
  5. Store cell values in an array and return values on specific condition
    By gmalpani in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 11-27-2011, 06:43 AM
  6. Return value AFTER column meets condition
    By jbc242 in forum Excel General
    Replies: 2
    Last Post: 06-26-2011, 11:40 PM
  7. Return Top Ten values when condition is met?
    By jarvo in forum Excel General
    Replies: 1
    Last Post: 02-17-2005, 11:28 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