Closed Thread
Results 1 to 11 of 11

Check if range of cells are in ascending order based on repeating data in another cell

  1. #1
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Question Check if range of cells are in ascending order based on repeating data in another cell

    Hi Experts,

    I need help to create a macro that would check that the range of cells are in ascending order based on repeating data in ColA and ColB.
    I can't figure out how to check using simple => or =< formula.

    Sample Data:
    - Col A and Col B has repeating data
    - Col B data set is repeating values for 6 cells
    - Col C (number) has repeating values for 6 cells (like ColB)
    - Each set in Col C has to be in ascending order, until Col A value changes

    Please Login or Register  to view this content.
    Last edited by mgcarino14; 08-09-2016 at 09:03 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,028

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    What are your rules for sequencing order? Looks to me like BP3 is in sequence but it is BQ2 that is out of sequence.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    Hi 6StringJazzer - The code would have to say that for B--P--3, 3 is not correct. The desired value must be between 1 and 2.
    Or if the user do not want to change 3 for B--P, the user has to update B--Q--2 to B--Q--4 (or any number higher than 3).

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,028

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    Sorry, I don't understand that explanation. 3 can be followed by any number higher than 3. Why can't 1 be followed by 3?

    Given your data, then shouldn't BQ2 also be out of sequence? The only way that BQ2 can be in sequence is if the sequence is predetermined.

    Examples are always important, but you have given a single example and are looking for us to extrapolate a complete set of rules from that. We need to understand all of your rules for determining if a set is out of sequence.

  5. #5
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    Hi 6StringJazzer - I changed my dataset to avoid confusion.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,028

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    You've changed the data but the ambiguity is still there. You need to give a rule for this.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    Hi @6StringJazzer - Col A and Col B does not need to be in sequence alphabetically (the nomenclature for A and B is free use). Only Col C need to be ascending. Each set in Col C (6 consecutive cells per set) has to be in ascending order, until Col A value changes.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,028

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    The Excel solution to this is going to be trivial, but you can't get an Excel solution until the problem is defined, and IMHO that's not done yet. I think you have some intuitive notion of what you want but to express it formulas, you have to have a rigorous definition.

    110.4 is greater than 100.12 so why is it out of sequence?
    105.1 is NOT greater than 110.4, so why is it IN sequence?

    Based on all your descriptions, 105.1 should be the only value that is considered out of sequence. You have not given a rule that explains why instead 110.4 is considered out of sequence. This was true of your original data, and also true of the data after you edited it. I have asked this three different times and the answer is just that the values have to be ascending. Well, they are all ascending until you hit 105.1.

  9. #9
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    My apologies @ 6StringJazzer. My bad... I meant to flag the "Error" at 105.1. I am using =IF(C2<=C3,"Opn number OK","Out of Sequence"), but just don't know how to group by 6 including the counter reset when value in Col A changes.
    Last edited by mgcarino14; 08-01-2016 at 11:55 AM.

  10. #10
    Registered User
    Join Date
    10-31-2014
    Location
    Albany, New York
    MS-Off Ver
    2010
    Posts
    32

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    A solution to a similar post can be found in http://www.excelforum.com/showthread...=1#post4451891

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,028

    Re: Check if range of cells are in ascending order based on repeating data in another cell

    I have just returned from vacation so have not been following this. It looks to me like that other thread is not just a similar post but the same. I am glad you got a solution but I am closing this as a duplicate.

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Arrange cells in ascending order
    By pankaj221 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2016, 04:42 PM
  2. [SOLVED] How to put non-repeating text in ascending order
    By augustus88 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-06-2014, 07:10 PM
  3. [SOLVED] Quickest Way To Fill A Range In Ascending Order
    By Philb1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2013, 06:12 PM
  4. how to check two range of data and compare them based on a cell in other column
    By hamidrezaxy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2013, 01:11 AM
  5. [SOLVED] Sorting a range in ascending order in a spreadsheet containing headings multiple rows
    By vbabeginnerjae in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-03-2012, 07:16 AM
  6. ReOrder Rows in ascending/descending order based on date
    By kurb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2012, 05:42 PM
  7. Transposing a Range in Ascending Order
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-28-2005, 11:35 AM

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