+ Reply to Thread
Results 1 to 8 of 8

Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

  1. #1
    Registered User
    Join Date
    05-20-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Office 365
    Posts
    5

    Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    Hello,

    I have one sheet called Shifts that has this data:

    Please Login or Register  to view this content.

    I have another sheet called Shift List where I want to only type the day of the week, and it needs to automatically display the booked people for that day only. Example: I type Wed in the cell, and it automatically displays the three booked people:

    Please Login or Register  to view this content.
    How do I go about this?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,029

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-20-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    Excel file attached, as requested.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    You can use this formula in cell H2 of the Shifts sheet:

    =IF(INDEX($B$2:$G$6,ROW()-1,MATCH('Shift List'!$B$1,$B$1:$G$1,0))="Booked",MAX(H$1:H1)+1,"-")

    Copy down as required (you might need to change the row parameter, shown in red, to suit your real data).

    Then you can use this formula in A2 of the Shift Lists sheet:

    =IFERROR(INDEX(Shifts!$A:$A,MATCH(ROWS($1:1),Shifts!$H:$H,0)),"")

    Copy down as required.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    05-20-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    Quote Originally Posted by Pete_UK View Post
    You can use this formula in cell H2 of the Shifts sheet:

    =IF(INDEX($B$2:$G$6,ROW()-1,MATCH('Shift List'!$B$1,$B$1:$G$1,0))="Booked",MAX(H$1:H1)+1,"-")

    Copy down as required (you might need to change the row parameter, shown in red, to suit your real data).
    Hi Pete_UK,

    This works perfectly, thank you!

    I was surprised to see that formulas were needed in the Shifts sheet.

    Is there any way to only have the formulas in the Shift List sheet, and nothing on the Shift sheet?

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    There are a number of ways that this could be achieved. I personally like this approach of marking the appropriate records in one sheet with the first formula, and then extracting them from those markings (i.e. sequential numbers) in the second sheet, as the formulae are quite short and simple to understand (and thus to maintain in the future if things need to be changed).

    Other approaches could include using the AGGREGATE function within INDEX, or array formulae using SMALL and IF, and these would involve a single formula in the second sheet, but I rarely recommend those (plenty of examples exist on the forum).

    Hope this helps.

    Pete

    P.S.: If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  7. #7
    Registered User
    Join Date
    05-20-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    Quote Originally Posted by Pete_UK View Post
    There are a number of ways that this could be achieved. I personally like this approach of marking the appropriate records in one sheet with the first formula, and then extracting them from those markings (i.e. sequential numbers) in the second sheet, as the formulae are quite short and simple to understand (and thus to maintain in the future if things need to be changed).

    Other approaches could include using the AGGREGATE function within INDEX, or array formulae using SMALL and IF, and these would involve a single formula in the second sheet, but I rarely recommend those (plenty of examples exist on the forum).

    Hope this helps.

    Pete
    Thank you for stating that there are other ways to solve this. That started me on a search to find my own solution as I didn't want to mix data and formulas on the same sheet.

    The solution:

    =""&FILTER(A2:G8,(A1:G1=A1)+(A1:G1=J1))

    ""& hides the empty cells in the filtered result.

    This solution doesn't solve the problem as completely as Pete_UK, because it shows all the names and the Booked column. Pete_UK's solution was exactly what I asked for.

    For ease of displaying the solution, I placed both the data and the filter on the same sheet, to show the solution working. See the attached screenshot.
    Attached Images Attached Images
    Last edited by exmoo; 05-22-2021 at 12:05 PM.

  8. #8
    Registered User
    Join Date
    05-20-2021
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Extract Cells from One Sheet and Display Result On Another Sheet According to Criteria

    If I run a separate filter, I get to the exact result I am looking for:

    =FILTER(I2:I8,J2:J8=I1)

    Is there a way to nest these two filter functions to reach the result in one step?
    Attached Files Attached Files

+ 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: 08-31-2020, 06:35 AM
  2. [SOLVED] extract and split data in one cell from one sheet to another sheet in two cells in vba
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-16-2017, 08:21 AM
  3. Replies: 8
    Last Post: 05-08-2016, 12:48 AM
  4. Replies: 3
    Last Post: 12-18-2014, 10:27 AM
  5. [SOLVED] Rank cells on one sheet and have that result fill cell on another sheet
    By bloomingcarrot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2014, 01:44 PM
  6. Userform help, need to display result not sheet
    By mtech123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2011, 08:34 AM
  7. display values on sheet 1 when criteria is met on sheet 2.
    By fichen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2010, 06:40 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