+ Reply to Thread
Results 1 to 8 of 8

Incrementing References by Multiples when Copying Formula

  1. #1
    Registered User
    Join Date
    02-27-2016
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    2

    Incrementing References by Multiples when Copying Formula

    Hello.

    I have an excel file with two sheets.
    Sheet1 contains my information and sheet2 is where I use my formula.

    In sheet1, I have two columns, D and E, containing numbers. I need to count how many times, in each next 10 rows, the numbers in column D are bigger than the numbers in column E, and I need to perform the calculation in sheet2. I use a sumproduct function -> =sumproduct(--(sheet1!d3:d12>sheet1!e3:e12)) and then I want to drag the formula down. What I need to do is increment the reference range in the formula with 10 rows each time I drag the formula down a row, so that when I drag the formula down one row, my range would be d13:d22 and e13:e22 instead of d4:d13 and e4:e13 and so on.

    I try to do that using and offset function into the sumproduct function but it doesn't work and returns #value! or #ref!

    =SUMPRODUCT(--(OFFSET(sheet1!D3,(ROW()-2)*10-10,0,10,1))>(OFFSET(sheet1!E3,(ROW()-2)*10-10,0,10,1)))

    I'm not at all well familiar with the offset function and I might well be using it wrong.

    Please help and thanks a bunch!

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Incrementing References by Multiples when Copying Formula

    Totally untested as I'm on the iPad but try this

    =sumproduct(--("sheet1!d"&(row(3:3)-3)*10+3 & ":d" & row(3:3)-3)*10+12 & ">sheet1!e" & (row(3:3)-3)*10+3 & ":e" & row(3:3)-3)*10+12))
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Incrementing References by Multiples when Copying Formula

    Try
    =SUMPRODUCT(--(INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,0),)>INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,1),)))
    Phuoam

  4. #4
    Registered User
    Join Date
    02-27-2016
    Location
    Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Incrementing References by Multiples when Copying Formula

    Quote Originally Posted by Phuocam View Post
    Try
    =SUMPRODUCT(--(INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,0),)>INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,1),)))
    Phuoam
    Awesome, this worked, thank you!

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Incrementing References by Multiples when Copying Formula

    Quote Originally Posted by Phuocam View Post
    Try
    =SUMPRODUCT(--(INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,0),)>INDEX(OFFSET(Sheet1!$D$3:$D$12,ROW(A1)*10-10,1),)))
    Phuoam
    No INDEX() needed, OFFSET works fine on its own

    =SUMPRODUCT(--(OFFSET(Sheet1!$D$3,(ROW(A1)-1)*10,0,10,1)>OFFSET(Sheet1!$E$3,(ROW(A1)-1)*10,10,1)))

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Incrementing References by Multiples when Copying Formula

    Quote Originally Posted by jason.b75 View Post
    No INDEX() needed, OFFSET works fine on its own

    =SUMPRODUCT(--(OFFSET(Sheet1!$D$3,(ROW(A1)-1)*10,0,10,1)>OFFSET(Sheet1!$E$3,(ROW(A1)-1)*10,10,1)))
    Have you tried yet?

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Incrementing References by Multiples when Copying Formula

    Quote Originally Posted by Phuocam View Post
    Have you tried yet?
    A slight error because I edited your formula instead of retyping it properly.

    The formula requires the use of ROWS, not ROW in order to prevent #VALUE! errors resulting from erroneous arrays.

    =SUMPRODUCT(--(OFFSET(Sheet1!$D$3,(ROWS(A$1:A1)-1)*10,0,10,1)>OFFSET(Sheet1!$E$3,(ROWS(A$1:A1)-1)*10,0,10,1)))

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Incrementing References by Multiples when Copying Formula

    Quote Originally Posted by jason.b75 View Post
    A slight error because I edited your formula instead of retyping it properly.

    The formula requires the use of ROWS, not ROW in order to prevent #VALUE! errors resulting from erroneous arrays.

    =SUMPRODUCT(--(OFFSET(Sheet1!$D$3,(ROWS(A$1:A1)-1)*10,0,10,1)>OFFSET(Sheet1!$E$3,(ROWS(A$1:A1)-1)*10,0,10,1)))
    Thank you, very good

+ 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. Incrementing References by Multiples when Copying Formulas across
    By luis6777 in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 11-04-2015, 04:53 PM
  2. Copying a formula 10 rows down but incrementing by only one
    By Ralphbones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-12-2014, 02:35 PM
  3. [SOLVED] Copying Formula down incrementing every 4 rows
    By alonzoharris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-19-2014, 03:26 PM
  4. Problems with auto incrementing formula copying?
    By troykristoffer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2008, 06:30 PM
  5. [SOLVED] How do I prevent a formula element from incrementing when copying
    By Copying Excel Formulas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2005, 01:05 PM
  6. Replies: 1
    Last Post: 03-10-2005, 04:54 AM

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