+ Reply to Thread
Results 1 to 6 of 6

Sumproduct & Column

  1. #1
    Registered User
    Join Date
    11-25-2013
    Location
    San Jose, California, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Sumproduct & Column

    My boss created this formula to calculate weeks of supply but I can't seem to interpret the formula as to what it is doing:

    =(SUMPRODUCT(--(SUBTOTAL(9,OFFSET(AG37:HV37,,,,COLUMN(AG37:HV37)-COLUMN(AG37)+1))<=F37)))

    Any help would be much appreciated!

    Thank you!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumproduct & Column

    It's doing a progressive sum across the range and testing that each sum is less than or equal to cell F37.

    Here's an example using a smaller range.

    Let's assume F37 = 20. I'll hardcode this value into the formula.

    Data Range
    AG
    AH
    AI
    AJ
    34
    3
    35
    36
    37
    2
    5
    7
    9
    38
    39
    -----


    We get the progressive sums of:

    2
    2+5 = 7
    2+5+7 = 14
    2+5+7+9 = 23

    2, 7, 14, 23

    This formula counts how many of those sums are <=20:

    =SUMPRODUCT(--(SUBTOTAL(9,OFFSET(AG37:AJ37,,,,COLUMN(AG37:AJ37)-COLUMN(AG37)+1))<=20))

    Result = 3
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-25-2013
    Location
    San Jose, California, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Sumproduct & Column

    ah! makes sense. Thank you! I appreciate your help.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumproduct & Column

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  5. #5
    Registered User
    Join Date
    11-25-2013
    Location
    San Jose, California, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Sumproduct & Column

    Tony, I think you will be able to assist me with this addition into the formula listed in my question.

    =SUMPRODUCT(--(SUBTOTAL(9,OFFSET(AG37:AJ37,,,,COLUMN(AG37:AJ37)-COLUMN(AG37)+1))<=20))

    In this formula it is deducting one column but I would like to deduct multiple columns. Is there a way to deduct multiple columns if necessary?

    Thanks for your help!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumproduct & Column

    Are you sure you want to do that?

    COLUMN(AG37:AJ37)-COLUMN(AG37)+1

    Generates the array {1,2,3,4}.

    This is used to determine how many cells to progressively add.

    1 = sum AG37
    2 = sum AG37:AH37
    3 = sum AG37:AI37
    4 = sum AG37:AJ37

+ 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] SUMPRODUCT IF COLUMN B=x AND COLUMN E CONTAINED IN A LIST
    By AL1976 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-17-2014, 10:35 AM
  2. [SOLVED] using Sumproduct but looking up which column to sum
    By alexander.aberg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2014, 09:57 AM
  3. SUMPRODUCT - Every other column
    By Jabba in forum Excel General
    Replies: 6
    Last Post: 03-23-2009, 11:56 AM
  4. SUMPRODUCT - If column 'X' Does not contain
    By Badvgood in forum Excel General
    Replies: 1
    Last Post: 02-12-2007, 08:28 AM
  5. Sumproduct within the same column
    By Mr.Cellophane in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2005, 05:07 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