+ Reply to Thread
Results 1 to 6 of 6

Lower than -10% give 1, then give 2.

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

    Lower than -10% give 1, then give 2.

    Hi. I'm attaching my workbook. I have a column that has numbers. I would like a formula or macro that will give me the following: If the number in column A is lower than -10% give me 1. Then to get a 2 it needs to have risen +10% from when it got a 1.

    An example to understand:

    Column A and B
    -3%
    -12% 1
    -4%
    -14%
    -13%
    -1% 2
    3%
    1%
    -13% 1
    3% 2
    10%
    -17% 1
    -16%
    -15%
    6% 2
    5%
    6%
    Starting from A1=-3%. We are looking for a number that is lower than -10%. A2 is below -10%. So, B2 will be 1. Now we are looking for a 10% rise from when we got in. This happens at A6 so B6 will be 2. Whenever we get a 1 it has to stop looking for a -10% value. That's why B4 and B5 are not 1. So B6 is 2. Now, we start looking for a number lower than -10% again. We get this at A9. B9 has to be 1. The 10% rise happens at row 10. So B10 will be 2.

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

    P.S.: I have posted the same question in another forum http://www.mrexcel.com/forum/excel-q...ml#post4543231
    Attached Files Attached Files
    Last edited by tsakta13ole; 06-07-2016 at 09:35 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,086

    Re: Lower than -10% give 1, then give 2.

    Here, try this (starting in second row, B1 is 1 by default):
    Attached Files Attached Files
    Never use Merged Cells in Excel

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

    Re: Lower than -10% give 1, then give 2.

    Thank you for your answer. The results are the same but when I change the data it doesn't do what I would like. I'm attaching my workbook.

    In sheet 2 when I change the data B33 is 2 which it should not be. Also, after a 1 there should be a 2. B58 is 1 and the next non-blank is again 1 at B97.

    Thanks for any help!
    Attached Files Attached Files

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

    Re: Lower than -10% give 1, then give 2.

    I got the answer in the other forum. This
    Please Login or Register  to view this content.
    and this
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,086

    Re: Lower than -10% give 1, then give 2.

    Previous formula looked did value grow or not.
    If you want to alternate 1 and 2 no matter of growth then:

    in B1 put value 2 (so next value will start with 1)
    in B2 put:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And extend down.

    (Change ; to , if you get error)

    Edit: Thank you for putting crosspost link.
    Attached Files Attached Files

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

    Re: Lower than -10% give 1, then give 2.

    Thanks for your effort zbor. This does not quite do what I would like. For example, I get a 1 at B33 which is above 10%, not below 10% and then I get a 2 when it falls 10% from that level, not rise.
    Anyway, I got the answer in the other forum and posted it here. No need for another answer!

    Thanks again for your effort!

+ 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. [SOLVED] why give me error #VALUE ... i need to give me the numbers from small to big
    By mena in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-22-2015, 10:11 AM
  2. Replies: 2
    Last Post: 07-03-2015, 04:08 AM
  3. give n/a value
    By cmonstuh in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-23-2015, 05:06 PM
  4. [SOLVED] If Statements (?) - If Cell1 =yes then give -Cell2, If Cell1=no then give +Cell2
    By KTXD in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-02-2012, 12:24 AM
  5. Give RELEVANT responses to questions. DO NOT give usless list
    By pmartin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-06-2006, 02:00 PM
  6. I give up! Help Please...
    By Dino in forum Excel General
    Replies: 11
    Last Post: 06-01-2005, 11:29 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