+ Reply to Thread
Results 1 to 4 of 4

Returning a value every 20 rows from another sheet...

  1. #1
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Returning a value every 20 rows from another sheet...

    Someone had helped me create a formula that would look at another sheet and return a value value from every 20 rows.
    This code is in Sheet1 cell F8:F99
    Please Login or Register  to view this content.
    For example: Sheet1 F8 would return Sheet2 I40 and Sheet1 F9 would return Sheet 2 I60 and so on...


    My problem is that I need someone to explain how this code works because now I need to go the other way around. I need Sheet2 BW40 to return Sheet1 F8, Sheet2 BW60 to return Sheet1 F9 and so on...


    Can someone help me understand how to do this?

    Thank you

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Returning a value every 20 rows from another sheet...

    Offset does what it name explains. so to get where you want you shall use in sheet2 BW40:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    note that only offset in vertical direction is used.

    once you write this formula in your BW40 row()value is 40 so (40-40)/20 is 0 then after copying the cell into BW60 you get
    (60-40)/20 = 1 so offset 1 from $F$8 and so on.
    Best Regards,

    Kaper

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Returning a value every 20 rows from another sheet...

    IF you want to drag BW40 down, solution from Kaper is writing Sheet1!F8 in all cells of range BW40:BW59, then write sheet1!F9 in all cells of range BW60:BW79 and so on...

    If you want to write in BW40, BW60,...and leave other cells blank, use this in BW40 then drag down:

    =IF(MOD((ROW()-40),20)=0,OFFSET(Sheet1!$F$8,(MOD((ROW()-40),20)=0)*INT((ROW()-40)/20),),"")

    In case cells other than BW40,BW60... are occupied, copy BW40 to BW60, BW80 only.
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Returning a value every 20 rows from another sheet...

    Quote Originally Posted by Kaper View Post
    Offset does what it name explains. so to get where you want you shall use in sheet2 BW40:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    note that only offset in vertical direction is used.

    once you write this formula in your BW40 row()value is 40 so (40-40)/20 is 0 then after copying the cell into BW60 you get
    (60-40)/20 = 1 so offset 1 from $F$8 and so on.

    Thank you very much! I finally understand how the math works with this formula now.
    And I was able cleaned up my original code. It did not need any horizontal offsets:
    Please Login or Register  to view this content.

+ 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. Replies: 1
    Last Post: 08-21-2014, 12:12 PM
  2. Replies: 6
    Last Post: 01-01-2013, 02:37 AM
  3. Matching two rows with two other rows and returning a value
    By 1454 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-02-2012, 05:28 PM
  4. Filtering values from a sheet and returning them in a column on a different sheet
    By Adam Beauregard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2011, 05:40 PM
  5. Replies: 0
    Last Post: 06-11-2011, 01:21 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