+ Reply to Thread
Results 1 to 9 of 9

Flag the smallest number in a recurring set of 6 numbers in a long column in the adjacent

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Flag the smallest number in a recurring set of 6 numbers in a long column in the adjacent

    Hi everyone,

    I wonder if anyone can help with hopefully a simple little task I'm trying to do in Excel 2010.

    I have a long single column of thousands of numbers, and I just want to put a "1" flag in the next adjacent column to indicate which is the smallest number from every group of 6 numbers as you work down the column.

    For instance - in the column below there is a "1" next to the smallest number of the 1st 6 numbers which is 4.5, and another 1 next to the smallest number of the next 6 numbers going down, which is 1.8, and so on for several thousand additional instances.

    Column A Column B
    9.8
    4.5 1
    11.1
    9.5
    8.2
    7.9
    2.1
    1.8 1
    5.2
    4.1
    3.7
    8.1

    I'd really appreciate a help with the necessary formula to achieve what I hope is a relatively simple task.

    Thanks in anticipation,

    Malcolm.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    With your data from Cell A1 onwards use in Row 1

    =IF(A1=MIN(INDEX(A:A,FLOOR(ROW(A1),6)+1):INDEX(A:A,CEILING(ROW(A1),6))),1,"")

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    Hi again,

    Thanks for the formula.

    I've tested it out on a small column of numbers (96 in total).

    It works most of the time, but there are a few instances where it makes a mistake - which is quite baffling.

    Is there any chance you could take a quick look and see if you can see why please ?

    I have attached a small spreadsheet where I have implemented the formula as instructed.

    These are the errors that I think should not be happening -


    Cell A20 - 3.85 is correctly flagged with a 1 in cell B20
    Cell A24 - 6 is incorrectly flagged with a 1 in cell B24 - within the same group of 6 numbers

    Cell A74 - 3.45 is correctly flagged with a 1 in cell B74
    Cell A78 - 4 is incorrectly flagged with a 1 in cell B78

    Thanks,

    Malcolm.

  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: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    Hi,

    Use:

    =IF(A1=MIN(INDEX(A:A,1+6*FLOOR(ROWS($1:1)/6,1)):INDEX(A:A,6+6*FLOOR(ROWS($1:1)/6,1))),1,"")

    Regards
    Click * below if this answer helped

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

  5. #5
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    Hi,

    Thanks very much. This now works perfectly.

    Much appreciated.

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

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    You're welcome.

  7. #7
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    Hi again,

    Sorry everyone - I spoke too soon ! This formula still appears to have a problem.

    I tested it out on a single column of approx. 10,000 numbers, and I noticed that it's immediately run into problems.

    Now it's becoming extremely baffling, because I tested it on a small sample of numbers yesterday, and it worked OK.

    I've attached a spreadsheet with two tabs - 1 for the numbers that it worked OK with, labelled 'working example', and another labelled 'not working example' that shows complete groups of 6 numbers that there is no flag for whatsoever.

    Each worksheet is just a simple column of numbers in column A, and the formula to flag the minimum number for each successive group of six numbers working down the column, with a '1' in the adjacent cell in column B.

    That's it..

    I wonder if anyone can crack this stubborn little nut !!

    I'd really appreciate a hand with this, as I cannot figure out why it's not working.

    Thanks everyone.
    Attached Files Attached Files

  8. #8
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    see if this helps, starting in A1 and copied down:

    Please Login or Register  to view this content.
    also, you can use the formula =iseven(ceiling(row(),6)/6) or =isodd(ceiling(row(),6)/6) in Conditional Formatting to alternately stripe bands of six cells in different colours (instead of doing so manually).

    rows 10323 and 10326 are both flagged because those identical values are the lowest in that band.
    Last edited by icestationzbra; 04-25-2014 at 04:26 PM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  9. #9
    Registered User
    Join Date
    10-17-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Flag the smallest number in a recurring set of 6 numbers in a long column in the adjac

    Gosh - I think it's now working correctly - I can't seem to find any glitches, although it is rather a job checking over 10000 numbers.

    A very sincere thank you Icestationzbra for your kind help in solving this problem.

    Kind regards,

    Malcolm.

+ 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. Help!! find two number recurring numbers in row??
    By carrolld2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-03-2013, 03:10 PM
  2. Hard? SUM the values of a column that matches a flag in an adjacent column
    By Nokao in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2012, 11:29 AM
  3. flag 2-3 smallest numbers based on 2 columns
    By alizok in forum Excel General
    Replies: 7
    Last Post: 03-13-2008, 01:06 PM
  4. [SOLVED] How can I get Excel to flag the need for recurring updated data?
    By gepc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2005, 08:06 PM
  5. How can I get Excel to flag the need for recurring updated data?
    By gepc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2005, 07:06 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