Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2014-08-16
3
Medium Priority
?
134 Views
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?
0
Comment
Question by:wsturdev
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 2000 total points
ID: 40265235
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:
=INDEX(A:A,MATCH(0,D:D,0))

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.

Regards,
-Glenn
0
 
LVL 1

Author Closing Comment

by:wsturdev
ID: 40265306
Thanks!  I was sure it was simple, but not obvious to me!
0
 
LVL 27

Expert Comment

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

MATCH function
INDEX function
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

578 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