+ Reply to Thread
Results 1 to 6 of 6

Comparing Multiple Sets of Data and Returning Appropriate Cell

  1. #1
    Registered User
    Join Date
    04-07-2016
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2003, 2007, 2010
    Posts
    14

    Comparing Multiple Sets of Data and Returning Appropriate Cell

    Hello,
    New guy here. Just joined now to post this.
    Here's my problem that I'm sure one of you Excel Guru's can figure out...
    I got 4 Sheets in this Excel Book: Time Sheet, PCA Time Sheet, 24HR Staffing, Resources
    I am trying to use a drop-down box to select from the available range of dates on the 24HR Staffing sheet and check it across multiple columns of the Time Sheet sheet. Once it finds a match, stop and search that column for the second criteria.
    The second criteria is the shift worked. If any of the cells in the date column match any of the shifts that fall within the given time frame, return the employees name from that row. If they check the row and it doesn't match, check the next row and continue to try and match those two criteria.

    If I was not clear enough, please let me know and I will do my best to clarify anything. I believe the attachment of the book worked, if not, I will try again after posting.

    If we solve this issue, I will have one other one in this book, that is very similar.

    The most recent somewhat functioning attempt I've created is: {=IF(AND(OR('Time Sheet'!B4=Resources!E2,'Time Sheet'!B4=Resources!E3))*NDate='Time Sheet'!B3,EmpName,FALSE)} ----- but that does not cycle through the rows and columns as needed.

    Thank you very much for any help you can provide.

    Note: Unfortunately, I do not know VBA, so I have not gone that route.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Comparing Multiple Sets of Data and Returning Appropriate Cell

    I wasn't sure where you wanted this formula. I put it in A6 of 24 Hr Staffing, copied down

    It is an ARRAYED Formula, in A6

    =IFERROR(INDEX('Time Sheet'!$A$4:$A$32, SMALL(IF(INDEX('Time Sheet'!$B$4:$AC$32,,MATCH(NDate,NurseDate,0))=$A$4, ROW($A$4:$A$32)-ROW($A$4)+1), ROWS($A$6:$A6))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-07-2016
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2003, 2007, 2010
    Posts
    14

    Re: Comparing Multiple Sets of Data and Returning Appropriate Cell

    You're amazing, ChemistB. If you don't mind, I have one other issue I'm trying to do. If you have time, I'll explain it. It should be very similar.

  4. #4
    Registered User
    Join Date
    04-07-2016
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2003, 2007, 2010
    Posts
    14

    Re: Comparing Multiple Sets of Data and Returning Appropriate Cell

    So, I guess here are the other questions.... whomever has time.

    Here is the Breakdown with the shifts that fall within each breakdown:
    BD | Shifts that fall within BD
    7A-3 | 7A-3 , 7A-7
    3P-7 | 7A-7 , 11A-11 , 3P-11
    7P-11 | 11A-11 , 3P-11 , 7P-11
    11P-7 | 7P-7 , 11P-7

    So, how do I make it so that for example, if Amanda works 7A-7, she falls in 3P-7 block without the actual shift name matching? The solution provided will fill in that block if the Shift Breakdown matches the Shift Exactly, but not if it's in the middle of it. --- I hope that made sense.

    The other issue is very similar to that ---
    If someone works a certain shift, I need to populate the Code section accordingly.
    Shift | Code
    7A-3 | 7
    7A-7 | 7A
    11A-11 | 11A
    3P-11 | 3
    7P-7 | 7P
    11P-7 | 11

    So, if Amanda does work, and she works the 7A-7 shift, her code needs to populate with the code 7A in both sections (7A-3 and 3P-7)


    Thanks again for any help. If you need any additional information for clarification, I'd be more than happy to provide it.
    Last edited by boyko59; 04-07-2016 at 10:54 AM.

  5. #5
    Registered User
    Join Date
    04-07-2016
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2003, 2007, 2010
    Posts
    14

    Re: Comparing Multiple Sets of Data and Returning Appropriate Cell

    I apologize for not clarifying that on the original request.

  6. #6
    Registered User
    Join Date
    04-07-2016
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2003, 2007, 2010
    Posts
    14

    Re: Comparing Multiple Sets of Data and Returning Appropriate Cell

    Bump.

    If anyone looking at this needs more info, please let me know.

+ 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. Comparing two data sets
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 06:26 PM
  2. Replies: 2
    Last Post: 08-30-2013, 06:30 AM
  3. Comparing multiple sets of columns for greater values
    By metsfan666 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2012, 08:41 PM
  4. multiple data, comparing and returning data
    By Meka Owethu in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 05-21-2012, 04:42 AM
  5. Comparing two sets of data
    By indimonk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2011, 04:03 AM
  6. Comparing Multiple sets of Data
    By michaelweaver4 in forum Excel General
    Replies: 3
    Last Post: 02-03-2011, 08:57 PM
  7. Comparing two sets of data
    By LEEP2008 in forum Excel General
    Replies: 7
    Last Post: 10-08-2009, 03:38 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