+ Reply to Thread
Results 1 to 7 of 7

array formula lookup spanning two columns

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    array formula lookup spanning two columns

    Thanks to some help on this forum, I have a formula that looks up the most commonly occuring value in a column.

    =INDEX('The List'!D$4:D$6001,MATCH(LARGE(COUNTIF('The List'!D$4:D$6001,'The List'!D$4:D$6001),1),COUNTIF('The List'!D$4:D$6001,'The List'!D$4:D$6001),0))

    I'd now like this to span a two column range, but when I change the formula as follows, it doesn't work any more:


    =INDEX('The List'!D$4:E$6001,MATCH(LARGE(COUNTIF('The List'!D$4:E$6001,'The List'!D$4:E$6001),1),COUNTIF('The List'!D$4:E$6001,'The List'!D$4:E$6001),0))

    Any idea what I'm doing wrong?

    Thanks

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: array formula lookup spanning two columns

    Hi Bennunn,

    I am not sure about countif function syntax which you have applied in your formula, can you upload a sample workbook along with your expected output. Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: array formula lookup spanning two columns

    Hello,

    You can try this formula instead
    Please Login or Register  to view this content.
    I changed the reference in my working formula with the matching reference from your formula, should work though ...
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: array formula lookup spanning two columns

    to just get the most common number in a range use mode()

    =MODE('the list'!D4:E6001)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: array formula lookup spanning two columns

    I feel funny after I read your solution Martin ... I didn't know that such a formula actually exists ...

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: array formula lookup spanning two columns

    mind you mode() wont work with text!

  7. #7
    Registered User
    Join Date
    02-20-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: array formula lookup spanning two columns

    I've stripped down my file, added dummy data and attached it here.

    MODE won't work because I'm trying to count strings.

    What I'm after is a top five most commonly occuring strings (which I can do, but only from a single column - I need a two column span).

    Thanks.
    Attached Files Attached Files

+ 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