+ Reply to Thread
Results 1 to 7 of 7

Grabbing values from one table based on a certain condition to make another table.

  1. #1
    Registered User
    Join Date
    01-10-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    4

    Question Grabbing values from one table based on a certain condition to make another table.

    Hi all,

    Firstly I apologise if this is a duplicate question. I could not figure out the proper terminology to begin searching what I needed.

    I would like to create a new table using a set criteria that would grab data from another table. Is it possible?

    Here is an example:

    Excelhelp.JPG

    The goal is to enter a value into cell B11 and then have the area below row 13 filled in with the names of people who match that criteria.

    Example if i were to enter "75" into cell B11, below row 14 would display:

    Tom 60
    Jill 35
    Sam 65
    John 70

    Thank you for the help!

    Adrian Lee

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Grabbing values from one table based on a certain condition to make another table.

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    Name
    Mark
    Mark
    75
    2
    Betty Diddent
    34
    3
    Anne Teak
    57
    Betty Diddent
    34
    4
    Robin Banks
    83
    Anne Teak
    57
    5
    Barb Dwyer
    76
    Ben Dover
    64
    6
    Dusty Rhodes
    82
    Warren Peece
    27
    7
    Ben Dover
    64
    Kerry Oki
    23
    8
    Warren Peece
    27
    9
    Justin Thyme
    95
    10
    Kerry Oki
    23
    11
    Rusty Steele
    81
    12
    ------
    ------
    ------
    ------
    ------


    This array formula** entered in D3:

    =IFERROR(INDEX(A:A,SMALL(IF(B$2:B$11<E$1,ROW(B$2:B$11)),ROWS(D$3:D3))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    This formula entered in E3:

    =IF(D3="","",VLOOKUP(D3,A$2:B$11,2,0))

    Select D3:E3 and copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-10-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    4

    Re: Grabbing values from one table based on a certain condition to make another table.

    Great! It works. Thanks a lot.
    However I would like to add on.
    What if columns "A" and "B" were not side by side?
    What if there was a column in between but I still desired the same outcome.
    I understand the first portion would still work fine, but it seems to affect the second portion. I'm assuming it has to do with the "A$2:B$11" part. It's not as simple as just changing "B" to "C" is it?
    Is there anyway around it?

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Grabbing values from one table based on a certain condition to make another table.

    Tell us EXACTLY where the data is located.

    Better yet, post a SMALL sample file and show us what results you expect.

    20 rows worth of data is plenty.

  5. #5
    Registered User
    Join Date
    01-10-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    4

    Re: Grabbing values from one table based on a certain condition to make another table.

    I apologise for being vague earlier.

    The full story is this:
    Excelhelp2.JPG

    I've been tracking club member's attendance for a while now, however recently I wanted to come up with an easy way to check for people who go below a certain percentage. Hence my questions, and the want to create the new table in the area for J4 onwards.

    I'm all ears. If there's an easier way then I'm happy to learn.

    Btw, I hope you're okay with me using the same names in the example.

    Thanks again,

    Adrian Lee

  6. #6
    Registered User
    Join Date
    01-10-2016
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    4

    Re: Grabbing values from one table based on a certain condition to make another table.

    ----------
    Last edited by Adrian.L; 01-10-2016 at 11:52 AM.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Grabbing values from one table based on a certain condition to make another table.

    Like this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    Number of classes
    5
    ------
    ------
    ------
    ------
    ------
    2
    4-Jan
    5-Jan
    6-Jan
    7-Jan
    Jan-16
    % Attendance
    Attendance less than
    3
    Name:
    60
    4
    Betty Diddent
    1
    1
    1
    1
    1
    100
    Dusty Rhodes
    40
    5
    Anne Teak
    1
    1
    1
    1
    80
    Warren Peece
    20
    6
    Robin Banks
    1
    1
    1
    60
    Kerry Oki
    0
    7
    Barb Dwyer
    1
    1
    1
    1
    80
    Rusty Steele
    40
    8
    Dusty Rhodes
    1
    1
    40
    9
    Ben Dover
    1
    1
    1
    60
    10
    Warren Peece
    1
    20
    11
    Justin Thyme
    1
    1
    1
    60
    12
    Kerry Oki
    0
    13
    Rusty Steele
    1
    1
    40


    This array formula** entered in J4:

    =IFERROR(INDEX(A:A,SMALL(IF(H$4:H$13<J$3,ROW(H$4:H$13)),ROWS(J$4:J4))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    This formula entered in K4:

    =IF(J4="","",INDEX(H$4:H$13,MATCH(J4,A$4:A$13,0)))

    Select J4:K4 and copy down until you get blanks.

+ 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. Finding a macro that will populate a table from another table based on a columns values
    By Daril_Ghiroza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2015, 02:26 PM
  2. Replies: 6
    Last Post: 11-13-2015, 03:50 PM
  3. [SOLVED] Get set of multiple values from a table based on condition
    By coolfundaz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2013, 10:53 AM
  4. Pick up values from a table based on 1 condition
    By batchjb69 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-10-2013, 04:44 AM
  5. [SOLVED] How to populate a table based on the searched values in a pivoted table
    By Kausty88 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 06:11 AM
  6. Replies: 6
    Last Post: 03-11-2012, 09:28 AM
  7. PLEASE DELETE this post
    By -EE- in forum Excel General
    Replies: 0
    Last Post: 02-22-2012, 07:46 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