+ Reply to Thread
Results 1 to 10 of 10

Dynamic Count and Sum Array Formulas Based on Multiple Conditions

  1. #1
    Registered User
    Join Date
    11-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Guys,

    I looking for a Dynamic Count and Sum array formulas to count and sum the unique values based on 2 conditions similar to what the Remove Duplicates Function in the Excel Ribbon. Col. B will contain number values only and Col. C will contain Text & Numeric combined.

    Both array formulas should adjust to variable ranges. Each formula should be placed in its corresponding
    cell as highlighted in yellow. Attached is the XL file as an example.

    Highlighted in yellow is what the result of the dynamic count and sum array formulas should return as the answer.

    Thank you,
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    try this for G2 =SUM(IF(FREQUENCY(MATCH(B4:B88&C4:C88,B4:B88&C4:C88,0),MATCH(B4:B88&C4:C88,B4:B88&C4:C88,0))>0,1))
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Try this for G3 =SUM(IF(FREQUENCY(MATCH(B4:B88&C4:C88,B4:B88&C4:C88,0),MATCH(B4:B88&C4:C88,B4:B88&C4:C88,0))>0,D4:D88))

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Find attached !

    if this helps click " * " add rep icon in the bottom left corner of my post
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,241

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Hi 5150,

    Array formulas are hard to do and take lots of time to recalculate. I've done your problem using a few Helper Columns. These are pretty basic and easy to understand. I think I can get your answer without needing any stinking Array stuff.

    See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    11-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Thanks Guys,

    Both of your posts are awesome Thank you so much!. I can definitely utilize both options for my future projects.

    Now, before I close this thread, any ideas on how to make the ranges on each of these options dynamic where the ranges will expand and retract in accordance to the variable rows of data?

    For instance, can the Rows function or a Name range with another formula function embedded in it of some sort be used somehow to return the required adjusted range into the formulas?

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,241

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Hi 5150,

    This is a job for Dynamic Named Ranges (DNR). I've added two of these in the attached. You need to look in the Names Manager to see them. I've called them DNRD and DNRG for the D and G columns. They expand depending on how much data you have.

    Read about DNRs at http://www.bettersolutions.com/excel...G820716330.htm
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-10-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    Works perfect! Thanks guys.

  9. #9
    Registered User
    Join Date
    01-27-2014
    Location
    Washington, DC
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    I have a much simpler question - but this is the closest thread I could find.

    I think my question is about Variable Ranges in a Formula.

    I take several motorcycle trips every summer, ranging in length to 60 days.
    Rows for each of 60 potential Days, and lots of Columns for stuff like miles, rain, hours, etc

    below the 60th Day/Row are rows of formulae for Each Column like Min, Average, Max, etc

    For a short 10 day trip - I just fill in the data on the top 10 rows and IGNORE the rest of the rows.
    So I have to edit the formulae for the Last Day/Row Number so they only include the relevant 10 days.
    (lots of complex reasons, not evident in this simplification, why just deleting the unused rows will not work.)
    For example: =AVERAGE(B1:B10)

    I want to just change one cell value (in this example to 10) and thus all formulae would calculate rows 1 thru 10.

    For example:

    =AVERAGE(B1:B,MysteryFormula(cell-address-with-Last-Row-Number))

    everything I try keeps return text not address
    and, of course, B and MysteryFormula have to be combined into an Address

    thanks, Bob

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

    Re: Dynamic Count and Sum Array Formulas Based on Multiple Conditions

    The forum owner prefers that we start our own threads rather than posting our questions in someone else's thread.

    It also increases your chance of getting a fast reply if someone see's a new thread with no replies as opposed to an older thread with several replies.

    Start your own thread and we'll be happy to assist you!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Count multiple conditions array only worked with 1 value
    By bob33 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2013, 05:10 PM
  2. [SOLVED] Count multiple conditions array only works with 1 value
    By bob33 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-19-2013, 12:57 PM
  3. Array formula to count based on multiple conditions
    By markrennolds in forum Excel General
    Replies: 1
    Last Post: 11-09-2010, 05:56 PM
  4. Total or Count based on multiple conditions
    By CC in forum Excel General
    Replies: 4
    Last Post: 05-17-2006, 05:55 PM
  5. Replies: 1
    Last Post: 08-25-2005, 03:43 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