+ Reply to Thread
Results 1 to 4 of 4

Finding patterns in a list of numbers for EXCEL spreadsheet

  1. #1
    Registered User
    Join Date
    12-24-2018
    Location
    London, England
    MS-Off Ver
    Office 360
    Posts
    10

    Finding patterns in a list of numbers for EXCEL spreadsheet

    Hello

    I have a group of say 100 random integer numbers ranging from 0 to 40 (inclusive). (The numbers can repeat themselves)


    I want Xcel to tell me
    How many integers appeared consecutively as even numbers and odd numbers.

    Also how many numbers appeared consecutively with a value as less than 20 and how many with a value greater than 20

    Let the ZERO be both ODD/EVEN and have a value greater/less than 20 in any sequence.

    Say numbers are:
    5
    23
    39
    2
    0
    2
    2
    0
    15
    19
    33
    31
    33
    and so on

    In the example above :

    2 and 3 integers appeared consecutively that were above the value of 20. That is the 23, 39 and the 33, 31, 33


    3 and 6 integers appeared consecutively that were ODD. That is the 5, 23, 39 and the 0, 15, 19, 33, 31, 33


    5 integers appeared consecutively that were EVEN. That is the 2, 0, 2, 2, 0



    Thank you for your help


    PS I haven't got a clue about how to use EXCEL really so if you can help me with which cell to insert which formula that would be great
    Last edited by Herotrader; 12-24-2018 at 08:36 AM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding patterns in a list of numbers for EXCEL spreadsheet

    Hi,

    Zero is considered an even number, not odd.

    Assuming your data is in A1:A13, these are all array formulas**:

    Consecutive Even:

    =IFERROR(SMALL(IFERROR(1/(1/(FREQUENCY(IF(ISEVEN(+A$1:A$13),ROW(A$1:A$13)),IF(1-ISEVEN(+A$1:A$13),ROW(A$1:A$13))))),""),ROWS(A$1:A1)),"")

    Consecutive Odd:

    =IFERROR(SMALL(IFERROR(1/(1/(FREQUENCY(IF(ISODD(+A$1:A$13),ROW(A$1:A$13)),IF(1-ISODD(+A$1:A$13),ROW(A$1:A$13))))),""),ROWS(A$1:A1)),"")

    Consecutive >20:

    =IFERROR(SMALL(IFERROR(1/(1/(FREQUENCY(IF(A$1:A$13>20,ROW(A$1:A$13)),IF(A$1:A$13<=20,ROW(A$1:A$13))))),""),ROWS(A$1:A1)),"")

    Copy all down until you start to get blanks for the results.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    12-24-2018
    Location
    London, England
    MS-Off Ver
    Office 360
    Posts
    10

    Re: Finding patterns in a list of numbers for EXCEL spreadsheet

    Thanks for your answer but I'm afraid I haven't got a clue what to do with it.



    Looking at the CONSECUTIVE EVEN formula. Which cells to I post the formula? Which cells do I post my random numbers?


    Im looking at my Xcel table now. The columns appear with letters A, B, C ….. and so on. The rows are numbered 1, 2, 3 … and so on.

    Where do I post what please.


    I need help at a very basic level e.g. What do I post in CELL A1, A2, B1, B2 etc.


    So sorry to trouble you on Christmas Eve like this. Thanks you

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding patterns in a list of numbers for EXCEL spreadsheet

    Ok, so if the 13 numbers you give in your original post are listed vertically in cells A1:A13, then you can put the 3 formulas I gave you in say C1, D1 and E1.

    Read the instructions carefully which I gave about how to enter an array formula. It can take a bit of getting used to at first, but once you've done it right (and so can see the curly brackets around the formula) for the formulas in C1, D1 and E1, copy (or drag) those formulas down a dozen cells or so. You may need to copy them further to cover all possible returns, but that should be easy enough to work out.

    Cheers

+ 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. [SOLVED] Excel finding patterns across data range
    By hazzaska in forum Excel General
    Replies: 5
    Last Post: 04-21-2017, 02:42 AM
  2. finding the frequency of patterns in data set
    By fatterthanelvis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-27-2016, 08:28 AM
  3. Macro For Advance Math Sequences In Finding Number Patterns or Missiing Numbers
    By Daddy007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2016, 06:44 PM
  4. Finding Patterns in String of Text in One Column
    By HDTV in forum Excel General
    Replies: 3
    Last Post: 10-08-2014, 08:03 AM
  5. [SOLVED] finding patterns in a range of cells
    By shart2k12 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-27-2013, 11:07 AM
  6. Finding patterns
    By GaidenFocus in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-06-2012, 03:59 PM
  7. Finding same patterns in groupings of cells
    By modoud in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-19-2007, 01:19 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