+ Reply to Thread
Results 1 to 9 of 9

How can I count downward a specific number of cells to retrieve data?

  1. #1
    Forum Contributor
    Join Date
    11-11-2004
    MS-Off Ver
    pro + 2019
    Posts
    134

    How can I count downward a specific number of cells to retrieve data?

    Based on some other unrelated stuff in the sheet I need to tell XL to go down a column, a certain number of cells, and retrieve the contents.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How can I count downward a specific number of cells to retrieve data?

    try

    =index(Your_column,number_of_cells)

    so for instance

    =Index(A:A,B1)

    where B1 contains the the value of the number of cells you wish to go down to and Column A is the relevant column
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    11-11-2004
    MS-Off Ver
    pro + 2019
    Posts
    134

    Re: How can I count downward a specific number of cells to retrieve data?

    FORUM BOOK UPLOAD.xlsx
    Quote Originally Posted by Ace_XL View Post
    try

    =index(Your_column,number_of_cells)

    so for instance

    =Index(A:A,B1)

    where B1 contains the the value of the number of cells you wish to go down to and Column A is the relevant column
    Index is a good start, but I would need to generate on the fly the range in the column from which to start.

    See attached book.

    B:B is the pairing names. They can be 1 or many rows deep. They can start on any row. So, tagging cell references will be hard.

    In the case of B6 I've already calculated it is 7 rows deep. Col A actually has a function working to include the pairing number for some other reasons.

    I can test how many rows have both the B6 name and a certain value in P:P across from it.

    What I don't know how to do is tell it to find the LAST occurrence and stop there.

    I only need the last occurrence of Col P that has certain values.

    Once i get that I'll move over to the pay column and do some work there.

    Confusing enough?

  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
    53,048

    Re: How can I count downward a specific number of cells to retrieve data?

    perhaps it would be easier to help you if you uploaded a sample workbook, showing what data you are working with, a few examples of what your expected outcome would be, and how you would arrive at that (remove any confidential info if necessary).

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  5. #5
    Forum Contributor
    Join Date
    11-11-2004
    MS-Off Ver
    pro + 2019
    Posts
    134

    Re: How can I count downward a specific number of cells to retrieve data?

    Quote Originally Posted by FDibbins View Post
    perhaps it would be easier to help you if you uploaded a sample workbook, showing what data you are working with, a few examples of what your expected outcome would be, and how you would arrive at that (remove any confidential info if necessary).

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

    Uh, it was the first line in post #3

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How can I count downward a specific number of cells to retrieve data?

    Try this array formula for H3A31

    Please Login or Register  to view this content.
    Adjust ranges and column A values accordingly

    Remember to confirm the formula with Ctrl+Shift+Enter and not just Enter

    Does this give you desired results?

  7. #7
    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
    53,048

    Re: How can I count downward a specific number of cells to retrieve data?

    ok thanks rcane - if you look at the times, I posted 2 minutes after you, i didnt see that you had replied before

  8. #8
    Forum Contributor
    Join Date
    11-11-2004
    MS-Off Ver
    pro + 2019
    Posts
    134

    Re: How can I count downward a specific number of cells to retrieve data?

    Quote Originally Posted by Ace_XL View Post
    Try this array formula for H3A31

    Please Login or Register  to view this content.
    Adjust ranges and column A values accordingly

    Remember to confirm the formula with Ctrl+Shift+Enter and not just Enter

    Does this give you desired results?
    Well that got it to the last line, but if the last line isn't one of the values in (W3, X3, Y3, AA3) I need it to back up one until it reaches one of those. One of those four needs to be the last line.

    I'm new to the ctrl-shift-enter idea. No VBA experience. Sorry.

  9. #9
    Forum Contributor
    Join Date
    11-11-2004
    MS-Off Ver
    pro + 2019
    Posts
    134

    Re: How can I count downward a specific number of cells to retrieve data?

    Quote Originally Posted by FDibbins View Post
    ok thanks rcane - if you look at the times, I posted 2 minutes after you, i didnt see that you had replied before
    Yeah, but I should've put it at the bottom like everyone else. I didn't see it until after posting.

+ 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