+ Reply to Thread
Results 1 to 4 of 4

Lookup formula working for one column but not another with similar data. Help needed.

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

    Lookup formula working for one column but not another with similar data. Help needed.

    HI all,

    I have a formula that calculates the most commonly occuring string value in a long column:

    =INDEX('The List'!C$2:C$4999,MATCH(LARGE(COUNTIF('The List'!C$2:C$4999,'The List'!C$2:C$4999),1),COUNTIF('The List'!C$2:C$4999,'The List'!C$2:C$4999),0))

    But when I try to use a similar formula to look up the next column, it returns a '#N/A' value.

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

    I can't understand why it works with one column and not another. The data is all string in both, and the cells are formatted as 'TEXT'.

    Thanks

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Lookup formula working for one column but not another with similar data. Help needed.

    hi bennunn, welcome to the forum. did you press CTRL + SHIFT + ENTER? You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    if it doesnt work, upload a sample file.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup formula working for one column but not another with similar data. Help needed.

    Try this array formula**:

    =INDEX('The List'!D$2:D$4999,MODE(MATCH('The List'!D$2:D$4999,'The List'!D$2:D$4999,0)))

    Assumes no empty cells within the range.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Lookup formula working for one column but not another with similar data. Help needed.

    CTRL+SHIFT works, thanks!

+ 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