+ Reply to Thread
Results 1 to 6 of 6

how to identify number string/sequence on a row

  1. #1
    Registered User
    Join Date
    02-21-2019
    Location
    Bulgaria, Plovdiv
    MS-Off Ver
    excel 2013
    Posts
    2

    how to identify number string/sequence on a row

    Hello,
    Capture.JPG
    I am wondering how to set a formula in order to identify if a particular sequence exists on a row.

    I am working with a large table which is consisting of employees' shifts.
    Depending on the shifts combination I have different types of working cycles.
    My purpose is to identify somehow a particular working cycle.

    Shifts are marked as following: 1 -first, 2-second, 3 -night.

    My point is to filter only employees who worked 6 days with the following sequence: 1 1 2 2 3 3
    I have also sequences like 1st week: 1 1 1 1 1, 2nd week: 2 2 2 2 2; 3rd week: 3 3 3 3 3

    I hope there is a way to do that.

    Thank you for giving an advise!
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: how to identify number string/sequence on a row

    Welcome to the forum!

    Let's see if this is close to what you want. With reference to my attached example workbook:

    Duplicate your list of employees in rows below your current table. In the attached workbook this list starts at row-11.

    Populate the following pattern detection formula into cell B11 and copy across and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now create the following conditional formatting:
    a) Select range B1:T5
    b) Conditional formatting > New Rule > Use a formula to determine which cells to format
    c) For the formula enter: =B11
    d) Format as desired (I used yellow fill).

    Now the start of the desired work pattern will be highlighted in your original table (A1:T5).

    See the attached workbook which implements the above
    Attached Files Attached Files
    Last edited by GeoffW283; 02-21-2019 at 02:40 PM.

  3. #3
    Registered User
    Join Date
    02-21-2019
    Location
    Bulgaria, Plovdiv
    MS-Off Ver
    excel 2013
    Posts
    2

    Re: how to identify number string/sequence on a row

    Hi Geoff,

    Yes, that definitely works!
    I will not waste time anymore in manual work.

    Thank you for your help

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: how to identify number string/sequence on a row

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: how to identify number string/sequence on a row

    From ampetkova:

    Just one quick question as I solved my thread already - If I want to unite your formula with more in order to add more combinations how can I do this?

    Eg: =SUMPRODUCT(--(O10:T10={1,1,2,2,3,3}))=6, but here I want to add =SUMPRODUCT(--(O10:T10={1,2,2}))=3 and to receive true or false again

    This is because sometimes the sequence 112233 could be only 122,233 etc, due to long annual sick or paid leaves etc.

    Thanks in advance,
    Ani

  6. #6
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: how to identify number string/sequence on a row

    Hi Ani,

    You can add additional sequences to check for by enclosing them with an or() function. For your above example this would be (as before, in B11 copied across and down):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can add more sequences in the same way to the same or() if you wish.

    One note with reference to your example "--(O10:T10={1,2,2}))=3": If the sequence to look for has a length of 3 then the range within the formula also needs to have a length of 3, so your example would need to be: "--(O10:Q10={1,2,2}))=3"

    Attached is a workbook that checks for 2 sequences.

    Hope this works for you.

    Geoff
    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: 7
    Last Post: 06-08-2015, 08:39 AM
  2. finding number sequence in string
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-09-2015, 11:45 AM
  3. boolean for string - identify an alphabet or a number - textbox
    By ag273n in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2013, 02:23 AM
  4. [SOLVED] Formula to identify a sequence
    By deanstein in forum Excel General
    Replies: 2
    Last Post: 11-29-2012, 05:07 AM
  5. Identify the next number in a sequence
    By steve64 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2012, 09:11 AM
  6. Replies: 5
    Last Post: 11-22-2010, 06:31 PM
  7. How to identify numbers in sequence
    By bluesea99 in forum Excel General
    Replies: 10
    Last Post: 08-29-2007, 02:42 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