+ Reply to Thread
Results 1 to 13 of 13

Finding multiple criteria in nth rows

  1. #1
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Question Finding multiple criteria in nth rows

    I've spent way too long thinking about this so would really appreciate some bigger brains on this.

    I've been given a spreadsheet with varying shift patterns. I need to find out how many people are on any given shift. Unfortunately, I can't change the fact the times have been put in rows. Start time is in row 4 for Person A, finish time in row 5. Person B is start in row 8 and finish row 9, etc.

    This is where I've got to:

    {=SUMPRODUCT((MOD(ROW(B4:B200)-ROW(B4),4)=0)+0,ISNUMBER(SEARCH(D1,B4:B200))+0)}

    Column A is the person's name. Column B is the times. Column D is a list of times to match; so for example D1 would be 06:00.

    The above works correctly in looking at every 4th row for the time D1(06:00) and returning the correct number of instances between B4:B200.

    What I need is to replace "D1" with, ideally, greater than and less than so I can be more precise. Or a way to count every possible combination looking at start times (every 4th row) and finish times (every 5th row).

    TIA

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Finding multiple criteria in nth rows

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    OK - is very boring though.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Finding multiple criteria in nth rows

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    Thanks for considering this Fluff13.

    I love your formula but....I have to count the shifts which start and finish at random times. So, the solution would show a list:

    1 January 2 January 3 January
    06:00 to 14:00 x shifts covered x shifts covered x shifts covered
    07:00 to 13:00 x shifts covered x shifts covered x shifts covered
    07:30 to 22:00 x shifts covered x shifts covered x shifts covered
    etc)

    I can use as many rows under the columns but cannot add columns. I assume the logic would go: SUMPRODUCT( if each (4th row >06:00 and <10:00) AND if each (5th row >10:00 and <15:00) = total 'early shifts'.

    The same formula could be used to find 'late shifts' say between 14:00 and 16:00 on every 4th row and between 20:00 and 22:00 on every 5th row. 'All day shifts' would be finding all those between 06:00 and 10:00 on every 4th row and between 20:00 and 22:00 on every 5th row!

    5th and 6th rows contain other info so using ISEVEN and ISODD returns that cell info.

    Thanks!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Finding multiple criteria in nth rows

    OK Upload a sample sheet that is TRULY representative of what you have to deal with, with manually calculated answers. Not boring at all, as you can see by Fluff's formula...

  7. #7
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    OK - have had difficulty anonymising the attached so hope this makes more sense now. Highlighted in green on the tabs "JAN" and "Data tables" are the areas I'm trying to work out. Any other suggestions gladly accepted - but the whole thing is much larger and some bits I can't change. Thanks ever so.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Finding multiple criteria in nth rows

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    By jove I think you have got it. Thanks very much Fluff13 - excellent formula. I will work with it for a while and see what happens............I may be back. Thank you very much for your time.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Finding multiple criteria in nth rows

    Glad to help & thanks for the feedback

  11. #11
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    Small, tiny extra favour please.... formula works ace for finding start (or finish) times and I can adjust to find any times from the 'lookups' list. From those calculations I can get most of the info but can't find a way to adjust to count how many shifts would stretch the whole day. I'm assuming that would be impossible as it would have to look at the start and finish row for each person using the criteria <10:00 for start and >20:00 for finish?

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Finding multiple criteria in nth rows

    I'm afraid I can't think of a way of doing that.

  13. #13
    Registered User
    Join Date
    02-05-2022
    Location
    London,England
    MS-Off Ver
    365
    Posts
    12

    Re: Finding multiple criteria in nth rows

    I know hurts my head even thinking about it. Nevermind, thanks for the giant leap forward you have given me. Most likely would need some VBA to sort it out. Ta again.

+ 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 Max Value with multiple criteria.
    By Kunamis7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-03-2018, 07:46 AM
  2. Finding multiple criteria with VBA
    By Muzun in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2017, 08:53 AM
  3. Finding all rows in a range that match two criteria
    By Jerry37917 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-21-2016, 02:04 AM
  4. [SOLVED] Finding Value From Multiple Criteria
    By kae2346 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2015, 02:14 AM
  5. [SOLVED] Finding value from multiple criteria
    By coach.32 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-02-2015, 04:41 PM
  6. [SOLVED] Finding Values in a Column based on Criteria and Selecting Rows Above
    By LvaughnL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2013, 03:07 PM
  7. Finding and copying rows that meet key word criteria
    By acrobaticgod in forum Excel General
    Replies: 12
    Last Post: 10-29-2011, 05:35 PM

Tags for this Thread

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