+ Reply to Thread
Results 1 to 21 of 21

Trying to identify largest value of a result set in an array

  1. #1
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Trying to identify largest value of a result set in an array

    I have an array formula as follows:

    {=INDEX(K6:K26, MATCH(1, (G6:G26=G3)*(H6:H26>=H3)*(I3>=LARGE(I6:I26,COUNTIF(I6:I26,"<"&I3)+1))*(J6:J26>=J3), 0))}

    The parts referencing column "G" and "H" work fine. I am trying to locate the largest result in column "I" that has already returned a True result for columns "G" and "H". This isn't working because the Large and Countif only return a single True rather than an Array of True and False.

    I also tried without the Large and CountIf; however that returns the first result in the column "I" that also had returned True in "G" and "H". I need the largest result in column "I".

    Without the Large and CountIf:

    {=INDEX(K6:K26, MATCH(1, (G6:G26=G3)*(H6:H26>=H3)*(I6:I26<I3)*(J6:J26>=J3), 0))}

    I attached the sample spreadsheet.

    Any suggestions?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    Please tell us what you expect the result to be and why, and then we can help you to construct a suitable formula.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Trying to identify largest value of a result set in an array

    .... .
    Last edited by Phuocam; 02-15-2018 at 08:48 AM.

  4. #4
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    The attached spreadsheet has that information located in it.

    The values I provided as input for the search is in row 3. There are 6 values that need to be evaluated. The first 3, I combined into one to make the Match easier. The next 3 are independently checked; however provide subsequent conditions for the evaluation of each. I modified the data set so that you can see the row that is being returned (not correct) with a "N" value and the row with the correct result contains a "Y" value.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    Try this:

    =LOOKUP(2,1/((G6:G26=G3)*(H6:H26>=H3)*(J6:J26>=J3)*(I6:I26<I3)),K6:K26)

  6. #6
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    Wouldn't =INDEX(K6:K26, MATCH(1, (G6:G26=G3)*(H6:H26>=H3)*(I3:I26>=LARGE(I6:I26,COUNTIF(I6:I26,"<"&I3)))*(J6:J26>=J3), 0)) include both the input value and my lookup list?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    Try post #5.

  8. #8
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    That sort of works, except now I need to be able to grab the lower result in column J. In the data set, if my value is <= to the first found LTV, that is the one I want to use.

    Also, I realized that the formula needs to reflect

    =LOOKUP(2,1/((G6:G26=G3)*(H6:H26>=H3)*(J6:J26>=J3)*(I6:I26<=I3)),K6:K26)

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    OK, so just take a moment or to to reflect and then tell us exactly what the formula is going to have to cope with - every possible scenario.

  10. #10
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    I added another document that is the source for the table I am building for the lookup.

    The objective of this is to be able to take the results of a variety of information which for now I am manually inputting into the spreadsheet I attached earlier and determine the resulting value in column K that meets the criteria in the other columns based on this attached documents rules.

    Let me know if this is enough information.
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    Blimey!!!

    So, are you trying to build all of that into one formula?

  12. #12
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    It's not really that complicated. All of that can be identified in the columns I set up. I stopped adding the data to the table until I had a formula that worked for the sample set I started with. No point building the full lookup list if I don't have a formula that works. I only added a small portion from the beginning of that page.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    I can't help thinking there will be a better way of doing this. And, actually, it is far better to reveal all the requirements from the outset: I have seen many threads here get increasingly convoluted as a member keeps saying, "Great - that works - but I now need it to do X, Y or Z as well", and this becomes immensely frustrating for those trying to help. I hope you will understand.

  14. #14
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    Definitely. That's why I added the source document and included the spreadsheet.

  15. #15
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    I should have been more specific and added the source document in the first place. I'm new to this forum and just getting the hang of it. Any suggestions to be a better participant are definitely welcome.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Trying to identify largest value of a result set in an array

    You're doing just fine!

    For me, I think it would be easier if you were to list what you want the formula to do in one post - I know it's duplicating what's in the PDF, but it will make it easier for your helpers in the long run.

  17. #17
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Trying to identify largest value of a result set in an array

    Is your requred esult is K16 OR K18, because I18 has highest value 700.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  18. #18
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    K16.

    The input values of Primary Residence, 1 Unit, FRM mortgage type, 45% DTI, 680 FICO and 74% LTV are looking for the number of reserves I need to provide based on the following understanding:

    The row should have Primary, 1, FRM, DTI that allows for a DTI up to 45%, and a FICO score of at least 680. Since my Input FICO is 680, the 700 FICO would not be available. If my Input FICO were less than 680, then only the highest matching listed FICO below 680 would be valid. As I drop below a FICO number in the list, that row is no longer eligible.

    If my FICO were 700 and above and my LTV were greater than 75%, I would be required to provide 0 reserves.

    To interpret the PDF, I would determine what type of residence was being financed, then what type of transaction is being considered (this isn't in the formula yet), then I would identify how many units are in the property, then identify if we are looking for a Fixed Rate Mortgage or an Adjustable Rate Mortgage (FRM/ARM), then is my DTI 36% or less or 36.01% to 45%, then based on the credit score and LTV per the PDF, how many months of reserves are required?
    Last edited by fredgruber; 02-15-2018 at 10:06 AM.

  19. #19
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    Not sure how to explain it differently unless I just retype the PDF document.

    Any suggestions on what would make sense to include?

  20. #20
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Trying to identify largest value of a result set in an array

    ARRAY formula in B2
    Please Login or Register  to view this content.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    02-15-2018
    Location
    Los Angeles, CA, USA
    MS-Off Ver
    2013
    Posts
    11

    Re: Trying to identify largest value of a result set in an array

    It doesn't work when I change the input value. If I change the LTV to 76% it should return a value of 2 located on row 17 and I am getting 0.

+ 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. Need a lookup to identify largest value
    By Mile029 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-13-2016, 07:02 PM
  2. [SOLVED] Identify Largest # of Days by Customer
    By clockspring in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2014, 08:51 AM
  3. [SOLVED] Macro to Identify Largest Value Across Columns, Then Subtract Value Held in Other Cell
    By mab1284 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-07-2014, 09:46 AM
  4. Largest in array
    By pociners in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-06-2014, 05:04 AM
  5. Identified Largest and Smallest VALUES, but need to Identify Location
    By wilburr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2013, 12:51 AM
  6. needing to find largest value in array, then return entire row associated with result
    By Phraedrique in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-15-2009, 12:32 PM

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