Results 1 to 6 of 6

Thread: Using clauses if theres growth?

  1. #1

    Arrow Using clauses if theres growth?



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi! I have an excel table in which I would like to put a '1' as soon as a sequence of numbers starts to increase and a '2' as soon as it starts to decrease. Is this somehow possible? My table looks something like this:

    Code:
    11:07:00 34,63
    11:07:00 34,13
    11:08:00 33,63
    11:08:00 34,13
    11:09 34,63
    11:09 35,13
    11:10 35,13
    11:10 35,13
    11:11 34,63
    11:11 34,13
    11:12 35,13
    11:12 36,13
    11:13 36,62
    11:13 37,12
    11:07:00 34,63
    11:07:00 34,13
    11:08:00 33,63
    11:08:00 34,13
    11:09 34,63
    11:09 35,13
    11:10 35,13
    11:10 35,13
    11:11 34,63
    11:11 34,13
    11:12 35,13
    11:12 36,13
    11:13 36,62
    11:13 37,12
    I would something to make it look like this:


    Code:
    11:07:00 34,63 2
    11:07:00 34,13
    11:08:00 33,63
    11:08:00 34,13 1
    11:09 34,63
    11:09 35,13
    11:10 35,13
    11:10 35,13
    11:11 34,63 2
    11:11 34,13
    11:12 35,13 1
    11:12 36,13
    11:13 36,62
    11:13 37,12
    11:07:00 34,63 2
    11:07:00 34,13
    11:08:00 33,63
    11:08:00 34,13 1
    11:09 34,63
    11:09 35,13 2
    11:10 35,13
    11:10 35,13
    11:11 34,63
    11:11 34,13 1
    11:12 35,13
    11:12 36,13
    11:13 36,62
    11:13 37,12
    something like that

    Anyone willing to help me out?

  2. #2
    Add this array formula to C2 and copy down

    =IF((B1>B2)+1<>INDEX($C$1:$C1,MAX(IF($C$1:$C1<>"",ROW($C$1:$C1)))),(B1>B2)+1,"")

  3. #3
    thanks a lot!!!
    But this only worked for the first row of cells. Any following one just showed as an error. any ideas?

  4. #4
    Super Moderator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,313
    Articles
    0
    Excel Version
    2010 on Xubuntu
    Did you enter it with Ctrl+Shift+Enter ? ( array formula)

  5. #5
    Yes, but still didnt work out. -- What am I doing wrong?

  6. #6
    Post your workbook with your entry and we will tell you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •