+ Reply to Thread
Results 1 to 3 of 3

Depending on next cell value formula

  1. #1
    Registered User
    Join Date
    06-27-2009
    Location
    USA, PA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Depending on next cell value formula

    Hi.
    In A2:AO101 I have numbers from 1 to 100
    Please, help me to create a formula for AQ2 and down which would do following:
    Look at the last cell of the range A2:AO2 which is AO2 and return 0 if the value is < 41;
    if the value of AO2 is > 40
    then find the same value in that range (could be more than one or not present)
    - return 0 if same value is not present in the row
    - return 0 if the right side next value is < 41 at least one time
    - return 1 if the right side next value is >40

    Here are short examples:

    12 67 43 2 86 43 90 7 3 77 15 31 67 22 43 78 55 - 0 (value 55 is present only in the last column)

    75 6 37 91 65 49 6 82 22 32 76 32 75 87 11 99 6 - 0 ( found less than 41 value right after 6 (37) and the value 6 itself is not greater than 40 )

    53 29 8 61 53 1 16 98 29 53 41 37 52 33 19 61 61 - 1 ( all values right after 61 are greater than 40)

    Thanks.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Depending on next cell value formula

    I'm not entirely sure I understand your requirements, but I think the formula you want is:

    =IF(AO2<41,0,IF(COUNTIF(A2:AO2,AO2)=1,0,IF(MIN(IF(A2:AN2=AO2,OFFSET(A2:AN2,0,1)))<41,0,1)))

    This is an array formula, so you must use Ctrl-Shift-Enter to enter it into the cell, not just enter. When you do this Excel will put curly brackets around the formula to show it is an array.
    Last edited by Andrew-R; 11-03-2011 at 03:50 AM.

  3. #3
    Registered User
    Join Date
    06-27-2009
    Location
    USA, PA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Depending on next cell value formula

    Works great.
    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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