+ Reply to Thread
Results 1 to 6 of 6

determine positive or negative trend from infrequent values in a column

  1. #1
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    determine positive or negative trend from infrequent values in a column

    i would like to generate the destination column using the source data, using simple IF statements and cell references. cells can reference cells below them, but not above. no arrays please if possible. the challenge is that there are an unknown number of zeros between the pos/neg 1's every time.


    SOURCE DEST.
    0 DOWN
    0 DOWN
    0 DOWN
    0 DOWN
    0 DOWN
    1 DOWN
    0 UP
    0 UP
    0 UP
    0 UP
    -1 UP
    0 DOWN
    0 DOWN
    1 DOWN
    0 UP
    -1 UP

    ETC.



    thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: determine positive or negative trend from infrequent values in a column

    And what would your expected answer look like?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: determine positive or negative trend from infrequent values in a column

    the destination column shows the result i would like to see: the word UP' or 'DOWN' based on the current sign of the source column. the source data is date-based with row1 having the most recent value. thanks

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: determine positive or negative trend from infrequent values in a column

    Sorry, I meant - show us what your expected outcome would like like?

  5. #5
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: determine positive or negative trend from infrequent values in a column

    column B (DEST.) is my expected outcome. the formula, entered in B2, will be copied down col B. the formula will be something like if(a2=1,"DOWN", if(and(B3="DOWN", a2=0), "DOWN", if ....etc

  6. #6
    Registered User
    Join Date
    10-01-2013
    Location
    san francisco
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: determine positive or negative trend from infrequent values in a column

    i think i have it:

    if(a2=1,"DOWN", if(and(a2=0,B3="DOWN"), "DOWN", if(a2=-1,"UP", if(and(a2=0,B3="UP"), "UP","")))

    when plugged into B2 and copied down i think this will work. i may have a typo in there.

    basically there are 4 possible states i am checking for using the nested IFs. this should do it. will check tmrw
    thank you
    Last edited by djarum11; 02-09-2015 at 03:25 AM.

+ 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: 2
    Last Post: 09-10-2014, 08:56 AM
  2. Trend formula- consecutive positive and negative numbers
    By Col83 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-05-2014, 02:53 AM
  3. Replies: 2
    Last Post: 09-03-2013, 09:18 AM
  4. Column containing positive and negative values
    By Elden in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2008, 01:23 AM
  5. Replies: 4
    Last Post: 09-26-2005, 06:05 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