+ Reply to Thread
Results 1 to 10 of 10

Using OFFSET For Dynamic Ranges Along With SUMIFS?

Hybrid View

  1. #1
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    267

    Question Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Good afternoon, Gurus! Yet again, I’m not sure if I’m overthinking this, but I’ve picked my brain raw and need some help!

    Please see the attached sample data. In Row 1, I’m using OFFSET() to total the values in the Columns as the range of the spreadsheet changes (i.e.: could be 500 rows could be 2,000.) Now, I’d like to use that same OFFSET() logic, but with SUMIFS based on the values in Column A:

    For “Flow” (Row 2,) I want to only total the rows where Column A is blank.
    For “Program” (Row3,) I want to total any rows where Column A is not blank AND the values is NOT “FF.”
    For “Speed” (Row 4,) I want to total any rows where Column A is “FF.”
    And for each, I want to maintain the dynamic functionality OFFSET() provides.

    Can anyone help, please? Thanks in advance!

    (And my apologies; I am about to leave work in a few minutes, so I may not respond/acknowledge any suggestions this evening, but I WILL be back first thing in the morning! Just don't want anyone willing to help to think they're going unappreciated; rest assured reputation is coming your way!)
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,908

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Since you are looking for dynamic functionality consider turning the data into a table, as it appears from the file attached to post #1, that is the intent anyway.
    If the data is set in an excel table then formulas like the following may be used and they will expand or contract along with the table.
    For Flow: =SUMIFS(Table1[Total],Table1[[VI]:[VI]],"")
    For Program: =SUMIFS(Table1[Total],Table1[[VI]:[VI]],"<>",Table1[[VI]:[VI]],"<>"&"FF")
    For Speed: =SUMIFS(Table1[Total],Table1[[VI]:[VI]],"FF")
    Another benefit would be the ability to drag the formulas across rows 2:4 as shown in the attached copy of the file. I guessed that the row headers were repeated in some columns, therefore overwriting the formula in those columns. I also guessed at the formulas for the % columns, again overwriting the above mentioned formulas there.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    267

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Quote Originally Posted by JeteMc View Post
    Since you are looking for dynamic functionality consider turning the data into a table, as it appears from the file attached to post #1, that is the intent anyway.
    If the data is set in an excel table then formulas like the following may be used and they will expand or contract along with the table.
    Thanks for the help; this worked like a charm! I REALLY appreciate it! Now, I’m off to present your work as my own and take all the credit! But seriously, this forum continues to be a lifesaver; hopefully one day, you all will imbue me with enough knowledge that I can contribute.

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    ok try

    R1
    Formula: copy to clipboard
    =SUM(OFFSET(R5,1,,COUNT(R6:R1048576)))

    R2
    Formula: copy to clipboard
    =SUMIFS(OFFSET(R5,1,,COUNT(R6:R1048576)),A6:INDEX(A6:A1048576,COUNT(OFFSET(R5,1,,COUNT(R6:R1048576)))),"")

    R3
    Formula: copy to clipboard
    =P1-P2-P4

    R4
    Formula: copy to clipboard
    =SUMIFS(OFFSET(R5,1,,COUNT(R6:R1048576)),A6:INDEX(A6:A1048576,COUNT(OFFSET(R5,1,,COUNT(R6:R1048576)))),"FF")
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    267

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Quote Originally Posted by shukla.ankur281190 View Post
    ok try
    Thanks for the input! I'll save these options for future reference (still new to OFFSET and INDEX!)

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Happy to help you and thanks for feedback and adding reputation.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,908

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    You're Welcome and thank you for the feedback. I hope that you have a blessed day.

  8. #8
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    267

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Good afternoon, Gurus (JeteMc specifically!)

    I’m reopening this thread because the ask for the project has changed a bit and what I thought was a simple adjusting of the formula has put me back in a predicament.

    The solution JeteMc offered in his solution worked fine, but the criteria have changed slightly; I’m now trying to identify “Flow” as anything with a VI of “-“, “TR” or “OR”, and any SUMIFs by any of those individual values works, but when I try to SUMIFS using more than one (per the attachment, it returns “0” for Flow. What gives??

    Thanks in advance for any help!
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,908

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    "What Gives??"
    When you add more arguments to the SUMIFS function it filters the criteria. Think of it as saying "sum the Total column of Table1 for the criteria of "-" AND "TR" in the VI column". Since only one of the criteria will ever be in column VI, what we really want is a formula that says "sum the Total column of Table1 for the criteria of "-" OR "TR" in the VI column". We could write two SUMIFS and SUM them as in:
    Formula: copy to clipboard
    =SUM(SUMIFS(Table1[Total],Table1[[VI]:[VI]],"-"),SUMIFS(Table1[Total],Table1[[VI]:[VI]],"TR"))

    We could also use SUMPRODUCT (as the addition sign acts like the word OR):
    Formula: copy to clipboard
    =SUMPRODUCT((Table1[Total])*((Table1[[VI]:[VI]]="-")+(Table1[[VI]:[VI]]="TR")))

    Let us know if you have any questions.

  10. #10
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    267

    Re: Using OFFSET For Dynamic Ranges Along With SUMIFS?

    Argh, "AND" vs "OR", the crux at 90% of my Excel pinch-points, and I still can't see the forest for the trees; the next iteration of Excel needs a =YOUKNOWWHATIMEAN() function. Alas, given the version I'm currently using, your response makes the kind of "well, DUH" sense I've come to expect. Thanks a ton, yet again, for your help, JeteMC!

+ 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. Dragging SUMIFS but need ranges to offset
    By LK0001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-06-2014, 09:57 AM
  2. [SOLVED] Dynamic Ranges without OFFSET?
    By lyla22 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 08-18-2014, 08:23 AM
  3. [SOLVED] SUMIFS with a dynamic, offset criteria range
    By adelcap in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-22-2014, 05:35 AM
  4. Dynamic Offset Ranges
    By Haggis29 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-24-2013, 07:18 AM
  5. How to create dynamic ranges, better alternative to OFFSET
    By JamesGoulding85 in forum Excel General
    Replies: 2
    Last Post: 06-04-2013, 03:27 PM
  6. [SOLVED] Getting sumifs and dynamic ranges to work together
    By DRFILL in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-05-2012, 11:53 AM
  7. Offset function and Dynamic Ranges
    By SandyLACA in forum Excel General
    Replies: 2
    Last Post: 08-02-2006, 06: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