+ Reply to Thread
Results 1 to 4 of 4

sum largest 1:n values within a range. Using a specified cell to define n.

  1. #1
    Registered User
    Join Date
    01-20-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    1

    sum largest 1:n values within a range. Using a specified cell to define n.

    Hi there,




    I am trying to sum the largest n values in a range and I would like to specify the n by using a cell.




    What I am trying to achieve is something like this;



    =SUMPRODUCT(LARGE(rng,ROW(INDIRECT("1:20"))))


    but instead of taking the sum of the 20 largest values I would like to sum the number of values specified by a given cell such as $A$1


    I have tried to find solutions but haven't yet been quite successful.


    Any help is greatly appreciated,


    Thanks in advance,

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,569

    Re: sum largest 1:n values within a range. Using a specified cell to define n.

    Welcome to Excel Forum.
    Try the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: sum largest 1:n values within a range. Using a specified cell to define n.

    Here is an other way. It is a little shorter but is an array formula. With the range of values in A1:A20 and the variable number in M1 enter this where you want the answer with Ctrl+Shift+Enter. (Array formula)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  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: sum largest 1:n values within a range. Using a specified cell to define n.

    If I understand what you want to do...

    =SUMPRODUCT(--(Rng>=LARGE(Rng,A1)),Rng)
    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. Replies: 4
    Last Post: 04-04-2015, 04:24 AM
  2. Can I use cell values to define a range?
    By jdimery in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2014, 11:50 PM
  3. Using cell values to define range of cells to hide
    By goosetopher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2013, 02:59 PM
  4. Use Cell Values to define and select a range
    By WadeLair in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2012, 05:18 PM
  5. How to define a range based on (variable) cell values
    By bubastisbastet in forum Excel General
    Replies: 4
    Last Post: 03-13-2010, 07:45 AM
  6. define a cell range from variable values?
    By pingwin77 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2009, 10:34 AM
  7. Replies: 0
    Last Post: 08-29-2005, 07:45 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