What function do I use to do a lookup in a descending array?

Posted on 2014-08-16
Last Modified: 2014-08-16
I have a 4-column array.  Column A contains dates in ascending order.  Column D contains numeric values in descending order.  The values in Column D descend until one row contains 0 and all subsequent rows are empty.

I need a formula to return the date from column A that is in the same row as the value 0 in column D.

I have tried using VLookup and other functions, but they all seem to require that the value I am looking for must be in column A with the value returned from some column to the right.  

To accommodate that requirement, I tried using a "ghost" column to the right of column D which has the same values as my column A.  But the second requirement is that the array has lookup values in ascending order.  Mine are in descending order.

What function (or rather, what formula) should I use?
Question by:wsturdev
    LVL 27

    Accepted Solution

    When you're looking for data that is to the left of your reference data, you use the combination of the INDEX and MATCH functions to get your result.

    In your case, the formula to return the date in column A whose associated value in column D is zero would be:

    The MATCH function looks for the first occurance of zero (0) in column D and returns position; essentially, the row number.  The INDEX function is looking in column A and returns the item in the row number found in the MATCH function.

    LVL 1

    Author Closing Comment

    Thanks!  I was sure it was simple, but not obvious to me!
    LVL 27

    Expert Comment

    by:Glenn Ray
    Here's some references that may help:

    MATCH function
    INDEX function

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Excel file corrupted. 13 28
    Array Formula to add additional step 1 21
    excel formula or VBA 7 34
    copying from excel to word 2 26
    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now