+ Reply to Thread
Results 1 to 11 of 11

=SUMIF and LARGE(array,n) HELP

  1. #1
    Registered User
    Join Date
    11-28-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    =SUMIF and LARGE(array,n) HELP

    Hi,

    I'm trying to rank the top five position for Longs and Short.

    I tried =sumif(B:V,"short positions",large(N:N,1))

    Any helps?
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: =SUMIF and LARGE(array,n) HELP

    See file. i think that you might need to be more explicit in what you want. please don't use jargon phrases. I'm an analytical chemist, not a financier. use column/.row references.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    11-28-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: =SUMIF and LARGE(array,n) HELP

    Hi Glen,

    I would like to rank the top 5 market value in column n, with the condition "short positions" in column c.

    Right now, in cell AA10, it is ranking the largest value as 609,532.26, however, I'm only interested in the condition "short positions" in column c.

    Please help.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: =SUMIF and LARGE(array,n) HELP

    Mmm. I attached the wrong file last night. Here's the array formula that I used:

    =IFERROR(LARGE(IF($B$2:$B$17=AA$9,$N$2:$N$17),ROWS(AA$10:AA10)),"")

    Notes: For long positions (also asked for in Post 1) there are only 3 values. 3577.50, 22.50 and 0.00. Rather than return #NUM, I added an error trap to give a blank rather than a zero. That is more factually correct. A zero is a result, whereas a blank indicates an absence of a result. Your (IMHO unnecessary) total formula in row 16 doesn't like the blanks. You can make the LARGE formula return zeros (substitute 0 for "" at the end of the formula). But that's not reflective of the actual situation. besides, again IMHO, a check should use a different principle to reach the same result in orde that it is effective. Identifying the 5 largest separately and adding them up is pretty much the same as adding them up collectively...

    As per your request, this gives the mathematically correct answers. Unless you mean the non-zero short positions.... or those with the largest ABSOLUTE amount (positive or negative). If so, let me know & I'll amend.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-28-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: =SUMIF and LARGE(array,n) HELP

    Hi Glenn,

    Thank you for the help.

    My goal is to automatically rank the top 5 short and long position automatically from the raw data. Right now, it is taking up too much time sorting and manipulating the data to do that.

    You're formulas look great, but would the formulas be able to generate the Expected result? I provided an example of the expected result in starting in Cell Z21. See attached.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: =SUMIF and LARGE(array,n) HELP

    In AB22

    =SMALL(IF($B$2:$B$100=$AA$21,$N$2:$N$100),ROWS($1:1))

    Enter with Ctrl+****+Enter

    Copy down

    in AA22

    =INDEX($F$2:$F$100,MATCH(AG22,$N$2:$N$100,0))

    in AD22

    =LARGE(IF($B$2:$B$100=$AC$21,$N$2:$N$100),ROWS($1:1))

    Enter with Ctrl+****+Enter


    in AC22

    =INDEX($F$2:$F$100,MATCH(AI22,$N$2:$N$100,0))

  7. #7
    Registered User
    Join Date
    11-28-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: =SUMIF and LARGE(array,n) HELP

    Hi John,

    Wow, the formulas =SMALL(IF($B$2:$B$100=$AA$21,$N$2:$N$100),ROWS($1:1)) and =LARGE(IF($B$2:$B$100=$AC$21,$N$2:$N$100),ROWS($1:1)) work perfectly.

    I'm not able to get the formulas =INDEX($F$2:$F$100,MATCH(AG22,$N$2:$N$100,0)) and =INDEX($F$2:$F$100,MATCH(AI22,$N$2:$N$100,0)) to work.

    It populated "NFLX 161118P00100000" for all rows. (see attached).

    Expectation:
    1st AMZN (32,775.54) CF 571,000.00
    2nd ACM (23,543.75) CTXS 264,930.00
    3rd ATR (21,603.88) CSRA 255,440.00
    4th BOBE (16,230.56) PLAY 236,600.00
    5th ACIW (11,416.50) GLW 170,030.00
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: =SUMIF and LARGE(array,n) HELP

    See attached (yellow box)
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,192

    Re: =SUMIF and LARGE(array,n) HELP

    my error ,,,

    =INDEX($F$2:$F$100,MATCH(AB22,$N$2:$N$100,0))


    =INDEX($F$2:$F$100,MATCH(AD22,$N$2:$N$100,0))

    I didn't amend the formulae from my test ranges.

    Apologies
    Last edited by JohnTopley; 11-29-2016 at 02:47 PM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: =SUMIF and LARGE(array,n) HELP

    I've been working. Finally, you gave us what your spec was/what your expected results look like. At least John was able to sort you out while I was offline.

  11. #11
    Registered User
    Join Date
    11-28-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    12

    Re: =SUMIF and LARGE(array,n) HELP

    Thank you to John and Glenn. You guys rock.

+ 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] Look within a large array of values for a small array that meets a certain criteria
    By sean2222 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2016, 11:41 AM
  2. Sumif - large range
    By ndreid2003 in forum Excel General
    Replies: 1
    Last Post: 03-21-2014, 12:48 PM
  3. Using a sumif with one criteria over a large range
    By bmbailey in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-10-2012, 04:24 PM
  4. SUMIF and LARGE
    By rudypoochris in forum Excel General
    Replies: 2
    Last Post: 12-28-2011, 02:00 PM
  5. Transferring part of a large array to smaller array
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2011, 09:39 AM
  6. Large function & Sumif
    By kmsoni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2011, 03:19 PM
  7. [SOLVED] Sumif + Large = headache
    By Hops in forum Excel General
    Replies: 5
    Last Post: 11-27-2005, 06:10 AM

Tags for this Thread

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