+ Reply to Thread
Results 1 to 8 of 8

Sum Large values along with Count Condition - Array Formula

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Sum Large values along with Count Condition - Array Formula

    Dear Friends,

    I request your kind support to solve this. I have a data in O2:T2, like this:

    Please Login or Register  to view this content.
    I would like to sum large 4 values among 6 cells. For this, I used this ARRAY formula:

    Please Login or Register  to view this content.
    It works well, if minimum 4 values are entered between O2:T2. However, if there are less than 4 values, i.e. if only 2 or 3 values are entered in O2:T2, then #NUM error appears.

    May I know how to avoid this error?

    Request your kind help / suggestion.
    Good friends are hard to find, harder to leave, and impossible to forget.

    acsishere.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Sum Large values along with Count Condition - Array Formula

    Hi,

    What do you want if there are less than 4 values? The minimum of those?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Sum Large values along with Count Condition - Array Formula

    1 way could be using multiply if...

    =IF(COUNT(O2:T2)>3,SUM(LARGE(O2:T2,{1,2,3,4})),IF(COUNT(O2:T2)>2,SUM(LARGE(O2:T2,{1,2,3}))))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Sum Large values along with Count Condition - Array Formula

    Dear Sir,

    Exactly I want to sum the LARGE 4 values from the range O2:T2. If there are no value entered in the range or less than 4 values in the range, then also the sum should be done without showing any error.

    Hope to get the positive reply, sir.

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum Large values along with Count Condition - Array Formula

    Try

    =IF(COUNT(O2:T2)>0,SUMPRODUCT(LARGE(O2:T2,ROW(INDIRECT("1:"&MIN(COUNT(O2:T2),4))))),"")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Sum Large values along with Count Condition - Array Formula

    Hi,

    =SUM(LARGE(O2:T2,ROW(INDIRECT("1:"&MIN(4,COUNT(O2:T2))))))

    Array again.

    Regards

  7. #7
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Re: Sum Large values along with Count Condition - Array Formula

    Dear Ace_XL & Fotis 1991,

    Thanks for your kind & swift response. Though both solves the purpose, the use of SUMPRODUCT formula provided by Ace_XL is easy to use.

    Thanks for your sparing time in helping me.

  8. #8
    Registered User
    Join Date
    06-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Sum Large values along with Count Condition - Array Formula

    Hi Friends,

    I am very new to this Website, Joined few hours back. I am average in Excel Formula and would to develop it from here.

    Could anyone of you explain me how the Row(Indirect()) function works here.
    =IF(COUNT(O2:T2)>0,SUMPRODUCT(LARGE(O2:T2,ROW(INDIRECT("1:"&MIN(COUNT(O2:T2),4))))),"")


    Thanks
    Vijay

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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