+ Reply to Thread
Results 1 to 3 of 3

retrieve number of rows down from a specific value

Hybrid View

  1. #1
    Registered User
    Join Date
    11-04-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    3

    retrieve number of rows down from a specific value

    Hello,

    In column A, I have a long range with only ones and zeros. There is roughly 19-22 zeros in between every 1.

    What I need in column B is: If the value in A(same row) is 1, return 0. For the next row below it should return +1, two rows down +2 and so on until it again finds a 1, and then gives me 0 and repeats.


    Doable?

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: retrieve number of rows down from a specific value

    With data starting in row 2
    in B2
    =IF(SUM($A$1:A2)=0, 0, IF(A2=1,0, B1+1)
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-04-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: retrieve number of rows down from a specific value

    Genius!

    Many thx!!

+ 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] How can I count downward a specific number of cells to retrieve data?
    By rcane in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-29-2013, 04:47 PM
  2. Replies: 0
    Last Post: 04-05-2012, 10:37 AM
  3. Unhide specific number of rows
    By Alleen86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2010, 04:40 PM
  4. Possible to query for a specific number in rows?
    By jonw118 in forum Excel General
    Replies: 1
    Last Post: 03-03-2010, 06:54 PM
  5. [SOLVED] finding the number of rows and the first row with a specific value
    By Bruce Bowler in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-20-2005, 12:06 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