Results 1 to 7 of 7

Find pattern (positive, negative, positive)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-26-2013
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2013
    Posts
    248

    Find pattern (positive, negative, positive)

    Hi. I'm attaching my workbook. I have a column that has numbers. (The first number will always be positive). I would like to get a "flag" (1 in another column) whenever the data goes from positive to negative and then positive again (no need for back to back to back). If I get a 1 it should stop looking at this pattern and look to find the next negative and get a 2 then. When that happens start finding for the 1 again (the first pattern). Here is an example to understand.

    Column A Column B
    3.86%
    3.79%
    -2.88%
    -2.33%
    3.36% 1
    2.07%
    4.65%
    -3.87% 2
    3.88%
    -3.32%
    8.20% 1
    -0.46% 2
    1.49%
    2.62%
    So, at B5 I get 1 because we have a positive first (A1) then at A3 a negative and then at A5 a positive. Now that it got the 1 it will look for the first negative which it gets at A8.
    After that, it tries to find the 1 again. A9 is positive, A10 is negative and A11 is positive so B11 will be 1. A12 is negative so B12 will be 2.
    I don't have a specific preference for a formula or a macro.

    Hope you understand what I'm trying to do!
    Thanks for any help!

    P.S. I have asked the same question in another forum http://www.mrexcel.com/forum/excel-q...ml#post4535573
    Attached Files Attached Files
    Last edited by tsakta13ole; 05-28-2016 at 01:25 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to get negative to positive value and positive to zero
    By Nikunj Morjaria in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-18-2014, 08:27 AM
  2. Loop through rows identifying a positive/negative pattern and return value
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 04:15 PM
  3. Positive to a Positive and Negative to a Positve
    By alorenzini in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2011, 11:47 AM
  4. Convert negative to positive in sheet containing both positive/negative numbers
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 07:52 PM
  5. Replies: 1
    Last Post: 08-14-2009, 11:17 AM
  6. adding positive and negative numbers all as positive
    By tomvh444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2009, 04:08 PM
  7. Replies: 2
    Last Post: 11-13-2008, 12: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