+ Reply to Thread
Results 1 to 6 of 6

Selecting a range of data

  1. #1
    Registered User
    Join Date
    04-14-2017
    Location
    Alaska
    MS-Off Ver
    2010
    Posts
    2

    Selecting a range of data

    Looking for some help to select a range of data that will give me the maximum sum of one field while taking into consideration the maximum limit of 2 other fields. Can someone help me take this on?

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Selecting a range of data

    Welcome to the forum

    Please attach a small sample Excel workbook -not a picture
    - max 50 rows of normal data plus expected results (in separate sheet perhaps)
    - good sample data = best solution
    - remove confidential information

    To attach your file:
    - click Reply / Go Advanced / scroll down to Manage Attachments / follow instructions (top of screen)

    thanks
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    04-14-2017
    Location
    Alaska
    MS-Off Ver
    2010
    Posts
    2

    Re: Selecting a range of data

    Trying to filter rows that will give me highest sum of Column A. While staying under 140,000 on Column B and under 2,200,000 on Column C.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Selecting a range of data

    Is this what you mean:
    Max "Sum of Rows in Column A" where "Sum of Same Rows in Column B" < 140,000 AND "Sum Same Rows in Column C" <2,200,000

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Selecting a range of data



    I'm not sure I grasp the concept.

    The total of column B is only 134,953.
    The total of column C is 531,856.
    Both totals meet the criteria.
    That means the sum of range A1:A50 (26,843) meets both criteria.

    Does the sample fairly represent what you want to do?
    Last edited by FlameRetired; 04-14-2017 at 07:00 PM.
    Dave

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Selecting a range of data

    Try this. It will return the range.

    $A$1:INDEX($A$1:$A$50,MATCH(2,1/(SUBTOTAL(9,OFFSET(A1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,)) < SUBTOTAL(9,OFFSET(B1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,)))*(SUBTOTAL(9,OFFSET(A1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,)) < SUBTOTAL(9,OFFSET(C1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,))),1))

    Wrap SUM around it and array enter it. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    =SUM($A$1:INDEX($A$1:$A$50,MATCH(2,1/(SUBTOTAL(9,OFFSET(A1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,)) < SUBTOTAL(9,OFFSET(B1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,)))*(SUBTOTAL(9,OFFSET(A1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,))
    < SUBTOTAL(9,OFFSET(C1,,,ROW($A$1:$A$50)-MIN(ROW($A$1:$A$50))+1,))),1)))

+ 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. Replies: 4
    Last Post: 01-06-2016, 05:38 PM
  2. [SOLVED] Selecting range of columns with data only.
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2015, 01:40 AM
  3. Selecting a dynamic range of data based off column data
    By wizeone in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-28-2014, 10:44 PM
  4. Selecting Data Range
    By akshaytomar87 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2013, 12:57 AM
  5. Selecting and Copying Variable Data Range from a Filtered Data Set
    By evan.sams in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2012, 12:02 AM
  6. Selecting Range to last row with data
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-20-2010, 12:52 PM
  7. selecting date range / data range autofilter
    By hansiman in forum Excel General
    Replies: 1
    Last Post: 02-23-2005, 09:06 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