+ Reply to Thread
Results 1 to 15 of 15

Return a list of cell values based on criteria in other columns

  1. #1
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Return a list of cell values based on criteria in other columns

    Hi,

    I am currently using COUNTIFS to count the number of entries in a column which match criteria in 2 or 3 other columns. Is it possible to separately also return a list of the values in the cells which match all these criteria?

    I hope this makes sense.
    Mike

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    Hi and welcome to the forum!

    When you say "return a list of the values in the cells which match all these criteria", which cells precisely are you referring to? From which column(s)?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Return a list of cell values based on criteria in other columns

    Hello
    Yes that is possible but I need to see your workbook....
    So please upload the workbook or a sample workbook to get a better understanding of your problem....
    You can upload by clicking on Go Advanced Button below and then clicking on the paper clip icon...

  4. #4
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    Good Morning,

    Thanks for initial comments. Attached is a sample workbook based on the one I inherited and am trying to make sense of.

    For example, on the KPI Analysis tab, in Cell F11, it is showing a total of 14 requests which were within target, based on the date range at the top of the tab. I would like to be able to have a separate tab which would list the Web Request Numbers relating to these 14 requests, taken from Column C on the Client 1 tab.

    Obviously this list would change as the date range changes, and I would then need to duplicate it for all the clients and all the KPI results.

    Any help appreciated!

    Mike
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    Thanks.

    You would require an array formula**:

    =IF(ROWS($1:1)>'KPI Analysis'!$F$11,"",INDEX('Client 1'!$C$2:$C$39,SMALL(IF('Client 1'!$A$2:$A$39="Y",IF('Client 1'!$E$2:$E$39<4,ROW('Client 1'!$A$2:$A$39)-MIN(ROW('Client 1'!$A$2:$A$39))+1)),ROWS($1:1))))

    and copied down until you start to get blanks for the results.

    Note that the upper range reference in this formula has been set to 39, which is the last used row in that table. This can obviously be amended, though it should never be made unnecessarily large (and certainly whole column references should not be used), since, unlike with e.g. COUNTIF(S)/SUMIF(S), array formulas are forced to calculate over every single row within the range passed to them, whether technically beyond the last-used cell in that range or not.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

  6. #6
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    Thank you for your help, exactly what I needed!

    Mike

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    You're welcome!

  8. #8
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    Just one more thing...

    I adapted your array to suit values over 7 without any problem, but when I try to put a range in, I get a #num.

    =IF(ROWS($3:3)>'KPI Analysis'!$G$11,"",INDEX('Client 1'!$C$2:$C$39,SMALL(IF('Client 1'!$A$2:$A$39="Y",IF(AND('Client 1'!$E$2:$E$39>=4,'Client 1'!$E$2:$E$39<=7),ROW('Client 1'!$A$2:$A$39)-MIN(ROW('Client 1'!$A$2:$A$39))+1)),ROWS($3:3))))

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    You can't use the AND function in that way in array formulas. The correct syntax would be:

    =IF(ROWS($1:1)>'KPI Analysis'!$G$11,"",INDEX('Client 1'!$C$2:$C$39,SMALL(IF('Client 1'!$A$2:$A$39="Y",IF('Client 1'!$E$2:$E$39>=4,IF('Client 1'!$E$2:$E$39<=7,ROW('Client 1'!$A$2:$A$39)-MIN(ROW('Client 1'!$A$2:$A$39))+1))),ROWS($1:1))))

    More to the point, though, and unless you've changed something in your file, there are no such cases in your sheet (?)

    Regards

  10. #10
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    Thanks,

    I was trying to set it up to give a list of Web Request Numbers which would appear in the Amber column on the KPI Analysis sheet, eg cell G11, between 4 and 7 days. (In this example the result would be 0).

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    ??

    Precisely, so there would not be a single member to return.

    Regards

  12. #12
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    True, but I am adapting the formula for each field on the KPI Analysis tab. When I move on to KPI 2, cells G30 and G36 both have results to list.

    Thanks again.

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    And so what results did you get with the formula I gave in post #9? I trust you manually entered some positive results for the purpose of testing?

    Are you able to adapt the column(s) being referenced to suit your needs?

    Regards

  14. #14
    Registered User
    Join Date
    01-15-2015
    Location
    Southampton
    MS-Off Ver
    Professional Plus 2013
    Posts
    7

    Re: Return a list of cell values based on criteria in other columns

    Yes, I have adapted your first solution to work for the other areas of the sheet, where the search term is either less than or greater than.
    It was only the Amber region, column G, where I am looking at a range, where I had the issue. Your solution in post #9 worked perfectly.

    Thank you again for your help.
    Mike

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Return a list of cell values based on criteria in other columns

    You're welcome!

+ 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: 3
    Last Post: 12-13-2013, 06:23 AM
  2. Replies: 4
    Last Post: 03-26-2013, 07:36 AM
  3. Replies: 10
    Last Post: 02-19-2013, 12:05 PM
  4. matching values based on criteria and return values from another columns
    By lizard54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:29 AM
  5. [SOLVED] Return cell value based on criteria of 2 columns
    By Fatnslow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2012, 04:52 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