+ Reply to Thread
Results 1 to 10 of 10

INDEX/MATCH for LARGE formulas all within the same cell

  1. #1
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    INDEX/MATCH for LARGE formulas all within the same cell

    Hey everyone,

    I'm trying to find a way to index fields of information based on the highest values in a column (top 3, top 5, etc.), but I'm trying to string this all together within one cell using the "&" symbol. I can get it to work well enough; however, I can't get it to account for duplicate values.

    There's a huge amount of data that needs to be accounted for. So, creating helper columns for each and every bit of data would probably be overkill; hopefully that's not the only option.


    Each user has their own sheet, because I'm also compiling and analyzing other data for them. So, the table being referenced is in another tab.

    Any ideas on this?

    I created a dummy worksheet with nonsensical data. In the first tab, a general idea of what I want it to look like is in cell D9, but with the data in separate cells. Ideally, I'd like to put that into the tables, but without using multiple cells for each
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    You had the answer. It was just a matter of combining the formulas. There is a technique for that.

    First I made a formula using the helper cells: =LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)&" from " & F9 & " " &G9 & " on " &TEXT( I9,"mm/dd/yyyy")& " in " & K9

    Then I substituted (copied and pasted) the formula in Cell K9 for K9 in this formula and so on for the other helper cells. Along the line some of these formulas contained D9 so I had to do a second round of pasting. In general, keep copying and pasting until you have every sub-formula in terms of the basic elements, in this case cell A1.

    This process yields the hairy and completely incomprehensible formula: =LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)&" from " & INDEX(MasterData[Field],MATCH(IF(MasterData[Name]=$A$1, LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)),MasterData[Value],0)) & " " &INDEX(MasterData[Product],MATCH(IF(MasterData[Name]=$A$1, LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)),MasterData[Value],0)) & " on " &TEXT(INDEX(MasterData[Date],MATCH(IF(MasterData[Name]=$A$1, LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)),MasterData[Value],0)),"mm/dd/yyyy")& " in " & INDEX(MasterData[Region],MATCH(IF(MasterData[Name]=$A$1, LARGE(IF(MasterData[Name]=$A$1, MasterData[Value]),$A5)),MasterData[Value],0))

    Which is why I like to use helper cells when I can. In this case finding the row on which the LARGE is found would knock out many of the subsequent sub-formulas where large is used.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    Thanks for the reply!

    I guess I was trying to avoid using helper cells because I would realistically need 100+ users, each with their own sheet across 30+ points of data (which equals a ton of helper cells).

    If I went the helper cell route, I think I could probably account for duplicate values, but with the incomprehensible formula, how would I then account for duplicates?

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    Describe what you mean by duplicate and how you want to handle the duplicate. What tie breaker criteria do you want to use.

    The answer is probably to wrap an if statement around the formula from Hades.

  5. #5
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    For ranks 1 and 2 on the first sheet, the value is 9. When using INDEX/MATCH, it only returns the first time 9 appears following the criteria. So, both rank 1 and 2 will return Home and Internet for their respective fields, but rank 2 should actually be Wireless and Internet (also, the dates should both then reflect rank 1).

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    OK, this means we need to do a check to see how many times the largest value occurs and then look for the first occurrence, then if needed, the second occurrence , then if needed the third occurrence and then second largest and check for the tie there, then third if not already taken care of. This logic limits to a top 3. Unless we add something artificial to the data such as row()/10000000 and display a truncated value. Offhand, I can't see doing this without a helper cell on the data side at least.

  7. #7
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    So, if I were to do a top 5, I would need to supply a helper column for each data point such as =F2+ROW()/1000000000, right?

    I think I got it
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    Oops. Wrong spreadsheet.


    This seems to work for the first user I use this method for, but I'm getting an error if I try to copy this formula to any other user.

    Any idea what I'm missing?
    Attached Files Attached Files

  9. #9
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    I reworked the "helper cells" on row 9. Now that we have ValueHelper, we can do a match against it. I substituted the pieces back and got:
    =TEXT(LARGE(IF(MasterData[Name]=$A$1, MasterData[ValueHelper]),$A5),"#") & " from " & INDEX(MasterData,MATCH(LARGE(IF(MasterData[Name]=$A$1, MasterData[ValueHelper]),$A5),IF($A$1=MasterData[Name],MasterData[ValueHelper],FALSE),0),3) & " " & INDEX(MasterData,MATCH(LARGE(IF(MasterData[Name]=$A$1, MasterData[ValueHelper]),$A5),IF($A$1=MasterData[Name],MasterData[ValueHelper],FALSE),0),4) & " on " & TEXT(INDEX(MasterData,MATCH(LARGE(IF(MasterData[Name]=$A$1, MasterData[ValueHelper]),$A5),IF($A$1=MasterData[Name],MasterData[ValueHelper],FALSE),0),4),"mm/dd/yyyy") & " in " & INDEX(MasterData,MATCH(LARGE(IF(MasterData[Name]=$A$1, MasterData[ValueHelper]),$A5),IF($A$1=MasterData[Name],MasterData[ValueHelper],FALSE),0),2)

    Which is about as ugly a formula as I've seen in Excel .

    There are a couple of things that I am compulsive about. One is that the Match must have the ,0 (I think that's the default anyway.) The other is =if (Value=Range, NewRange, False) - again, if a secondary range is not defined, the if statement will default to False. I have some OCD when it comes to being explicit in my coding.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-14-2018
    Location
    Seattle, Washington
    MS-Off Ver
    2016
    Posts
    11

    Re: INDEX/MATCH for LARGE formulas all within the same cell

    Wow, thank you! I appreciate it. That seems to be what I was looking for. I'm not incredibly excited about creating a helper column for each data point, but it gets the desired result.

    That's probably good practice to keep things clean and organized (at least in the mind). I'll likely adopt that method.

    Thanks again!

+ 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. Index / Match / Large / If help
    By jadiepants in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-16-2018, 06:08 PM
  2. [SOLVED] Index, Match and large formulas together
    By Tony0731 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-23-2018, 05:37 PM
  3. [SOLVED] Large Data - Index Match Match with another function?
    By d7882 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-12-2017, 03:51 PM
  4. Replies: 3
    Last Post: 07-16-2012, 09:00 AM
  5. Error with Match and Index formulas via a validation cell
    By Freddobonanza in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-15-2011, 09:30 AM
  6. INDEX, MATCH and LARGE
    By ridebikes in forum Excel General
    Replies: 1
    Last Post: 10-24-2011, 04:03 PM
  7. Index, Match, and Large
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2006, 06:10 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