+ Reply to Thread
Results 1 to 12 of 12

How to use LARGE to return a cell reference for use in OFFSET formula

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    How to use LARGE to return a cell reference for use in OFFSET formula

    Hi all,

    Hope you are having a splendid day.

    I'm trying to create a small table that will feed a pie chart to show the top five categories. This small table feeds off a much larger table and uses the LARGE formula to find the largest 5 categories and return that value. I would like to use formulas to obtain the names of the categories for use as labels in the pie chart, which are 13 columns to the left.

    All this seems quite simple but I can't quite get it to work. I understand LARGE returns the value and not the cell reference so I've tried combining it with ADDRESS, so I can use it in OFFSET, but I just get an error that something is wrong with my formula or that too few arguments have been entered.

    LARGE formula: =LARGE($O$18:$O$56,1)

    My poor attempt returning an error: =OFFSET(ADDRESS(LARGE($O$18:$O$56,1)),0,-13))

    I've also tried CELL, but think I'm missing how these functions work. I'd like to avoid array formulas where possible as there are already quite a few in the spreadsheet.

    Any help appreciated.

    Thanks, TC.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Upload sample file please

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

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Hi,

    Not sure without seeing your sheet, but presume that your Category Names are adjacent to their counts (?) - for example, assuming they are in P18:P56

    =INDEX($P$18:$P$56,MATCH(LARGE($O$18:$O$56,1),$O$18:$O$56,0))

    would give you what you want, providing of course that the counts are unique.

    Regards
    Click * below if this answer helped

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

  4. #4
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Hi

    Thanks for coming back on this.

    XOR LX, your formula works perfectly - until as you say there are two counts for the same value, which could happen. The underlying table is fixed (doesn't expand and contract) so the labels / names are always in column B - 18 to 56 and the total values in column O - 18 to 56. I'm more familiar with VBA where you would use the logic of returning the address for the found match (Large 1, 2, 3...) and then offset it - but appreciate excel functions work a bit differently. I wanted to avoid using Macros in this instance as it's quite simple (or so I thought) and users cannot be relied upon to enable them!

    nflsales - I cannot upload a workbook as I'm at work and our security settings prevent uploading.

    Thanks, TC

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

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    So what sort of tie-breaker do you want to introduce for Categories with equal counts?

    Is there any other field that you could use as a further criterion? Or are you happy with what you've got (in the sense that you don't mind which Category from duplicate counts is included in the top 5)?

    Regards

  6. #6
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Sorry probably didn't make myself clear.

    So lets say we're counting complaints categories relating to products. There are 39 different categories and the number of complaints is broken down month by month (Jan, Feb...) with a Totals Column in O that I'm using to find the overall highest ranking product complaints.
    Lets continue to say that Power Adapters are the highest ranking with 36, followed by USB Cables at 25, Laptop Chargers at 25, Tablet Cases at 22 and Phone cases at 21.

    USB cables and Laptop chargers both have the value of 25 - I don't mind which appears first in the list, it's irrelevant for creating a pie chart. However when I use your formula to return the category names then it just repeats the first one twice, eg:

    36 Power Adapters
    25 USB Cables
    25 USB Cables
    22 Tablet Cases
    21 Phone Cases

    I don't mind which way round they are but need Laptop Chargers to be showing as one of the 25's.

    Hope this makes some sense, TC

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    =INDEX($P$18:$P$56,MATCH(LARGE($O$18:$O$56+ROW($O$18:$O$56)*0.000001,1),$O$18:$O$56+ROW($O$18:$O$56)*0.000001,0))
    try this array formula

  8. #8
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Thanks nlfsales - I get a #N/A error returned on this... "A value is not avaliable to the formula or function" - the ranges look correct - though I changed P to B.

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    can you post the formula you used

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Here's another approach you can use:

    I assume you have categories in B18:B56 and values associated with those categories in O18:O56

    In X2:X6 you can get the top 5 values with this formula in X2 copied down

    =LARGE(O$18:O$56,ROWS(X$2:X2))

    Now get the associated categories (with no repetition) in Y2:Y6 with this formula in Y2

    =INDEX(B$18:B$56,SMALL(IF(O$18:O$56=X2,ROW(O$18:O$56)-ROW(O$18)+1),COUNTIF(X$2:X2,X2)))

    confirmed with CTRL+SHIFT+ENTER and copied down to Y6

    ......of course if there are ties at 5th/6th place you will need to show more than 5 values/categories unless you are happy to exclude some of the duplicates
    Audere est facere

  11. #11
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    =index($b$18:$b$56,match(large($o$18:$o$56+row($o$18:$o$56)*0.000001,1),$o$18:$o$56+row($o$18:$o$56)*0.000001,0))

  12. #12
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: How to use LARGE to return a cell reference for use in OFFSET formula

    Thanks daddylonglegs that works great! I realised as I was typing that there would be a problem if the 4th, 5th, 6th values for example were all tied, but I don't think that's too big a deal in this case - there's unlikely to be tied values every month and it's just to give an general ideas as to where the problems lie.

    Thanks to all for your assistance. TC

+ 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] Using cell value as worksheet name in formula reference(AVERAGE LARGE IF)
    By trizzo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-26-2013, 09:23 PM
  2. [SOLVED] Formula to search array for text and return value from an offset cell
    By tif4300 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-14-2012, 09:04 PM
  3. [SOLVED] Cell Reference Problem with Offset and Large
    By zakkair in forum Excel General
    Replies: 11
    Last Post: 06-25-2012, 12:06 PM
  4. Limitations when Combining OFFSET and MATCH to return a cell reference
    By dangermousedale in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2008, 08:39 PM
  5. Offset using formula for cell reference
    By Gus80 in forum Excel General
    Replies: 8
    Last Post: 05-15-2008, 12:35 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