+ Reply to Thread
Results 1 to 9 of 9

SUMIF Formula where the range is a column from an array

  1. #1
    Registered User
    Join Date
    09-06-2018
    Location
    California, USA
    MS-Off Ver
    Office 365
    Posts
    26

    SUMIF Formula where the range is a column from an array

    Hello, I'm having trouble trying to set up a SUMIF formula where I can set what range it is looking up out of an array by changing one cell. For example. My array is setup where one of the column Labels are Week ending dates. I want to set a cell that I can change the date in and the formula will set the range to the column from the array in the SUMIF formula to whatever date I choose in that cell. I tried to use a sumproduct formula in the range section of a SUMIF statement but it came up with an error. Any help would be appreciated. Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,694

    Re: SUMIF Formula where the range is a column from an array

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-06-2018
    Location
    California, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: SUMIF Formula where the range is a column from an array

    See the data set attached. A sample array of Data is in A3:L24. This is how I have the data and formulas set up now. I'm trying a count of everyone with a entry above 0 for a certain period of time in the Base columns by department. The end result being in the table on the right in columns P and Q. The goal is to change the SUMIF formula in column Q so that if I change the date in Cell Q1 it will use the range from the appropriate column in the table. Thanks
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,629

    Re: SUMIF Formula where the range is a column from an array

    1. Why do you have four columns for the department numbers?
    2. For 7/7 you have columns for "Base" & "Extra"; for 7/14, you have columns for "Extra","Bonus". For 7/21 you have "Base", Extra","Base"
    3. What does column N represent?

    Please Login or Register  to view this content.
    Modified worksheet with one column for dept and columns for base, extra & bonus. Note that "Base" is first so that the MATCH will find that column first for any date.
    Last edited by protonLeah; 01-23-2019 at 05:07 PM.
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    09-06-2018
    Location
    California, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: SUMIF Formula where the range is a column from an array

    Quote Originally Posted by protonLeah View Post
    1. Why do you have four columns for the department numbers?
    2. For 7/7 you have columns for "Base" & "Extra"; for 7/14, you have columns for "Extra","Bonus". For 7/21 you have "Base", Extra","Base"
    3. What does column N represent?

    Please Login or Register  to view this content.
    Modified worksheet with one column for dept and columns for base, extra & bonus. Note that "Base" is first so that the MATCH will find that column first for any date.
    I can't modify the columns, its not a data set I have much control over. The dates are there four times because its the four different categories in each week. Its how the data comes out. The only ones I care about right now are the ones marked base. Column is the sum I need to total. I just want a way to have that grid populate changing the cell in Q1 instead of moving the range reference column each week.

  6. #6
    Registered User
    Join Date
    09-06-2018
    Location
    California, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: SUMIF Formula where the range is a column from an array

    Had a typo in the column labels. Attached is an updated file. Thanks!
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,629

    Re: SUMIF Formula where the range is a column from an array

    MATCH($Q$1,$B$2:$L$2,0) will find the first matching column for the particular date in Q1. Since BASE is one column over, just add 1:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 01-23-2019 at 11:03 PM.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: SUMIF Formula where the range is a column from an array

    Please try at Q3 and drag down

    =COUNTIF(INDEX($A$3:$L$24,,MATCH($Q$1,$A$2:$L$2,)),P3)

    This one doesn't check base Please go with ProtoLeah.
    Last edited by Bo_Ry; 01-23-2019 at 10:55 PM.

  9. #9
    Registered User
    Join Date
    09-06-2018
    Location
    California, USA
    MS-Off Ver
    Office 365
    Posts
    26

    Re: SUMIF Formula where the range is a column from an array

    Thank you!

+ 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] SUMIF formula with dynamic column range and then expand the width of SUM range
    By gravythief in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-26-2017, 08:36 AM
  2. [SOLVED] Having problems in trying to use SumIf(range,criteria,Small(array,k))
    By Zeta84 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-02-2015, 11:14 PM
  3. conditional sumif/sum array on row and column criteria
    By pavlos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2013, 03:12 AM
  4. Replies: 3
    Last Post: 04-12-2010, 07:01 PM
  5. Possible to reference column of named range in array formula?
    By Kel Good in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2005, 02:50 AM
  6. Replies: 0
    Last Post: 07-27-2005, 11:05 AM
  7. Using Offset to determine Column range in Array formula
    By downforce in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2005, 12:13 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