Match Function

M

Melanie

Hi,
I have put together a spreadsheet to find codes, states, descriptions. It
finds the data by dates.
Columns are: Dates, Codes, States, Descriptions
If I put in a date it matches the code, state and description.

My problem is that if I have 2 dates that are the same it will only match
the first date it can find. What kind of formula do I need so that it will
output the second or third date data.

Thanks for your help.
If you need a copy of the spreadsheet please let me know.
 
T

T. Valko

One way...

Assume your data is in the range A2:D500

F2:H2 = headers: Code, State, Description

F1 = lookup date

Enter this formula in G1. This will return the count of dates based on the
date entered in cell F1:

=COUNTIF(A:A,F1)

Enter this array formula** in F3:

=IF(ROWS(F$3:F3)<=$G$1,INDEX(B$2:B$500,SMALL(IF($A$2:$A$500=$F$1,ROW(B$2:B$500)),ROWS(F$3:F3))-ROW(B$2)+1),"")

** 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.

Copy across to H3 then down to a number of rows that ensures you get all the
results. How many rows that is depends on the maximum count for any single
date. For example, if 1/1/2009 appears the most times, let's say it appears
5 times, then you need to copy the formula to at least 5 rows.
 
M

Melanie

I put the formulas in and the count works but the second formula gives me a
#Value Error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VBLookup help 2
COMPARE IDENTICAL DATA 3
Comparison of columns using Conditional Formatting 3
Lookup function? 3
Return Max Date 1
Need VLOOKUP to Work Two Ways 0
Excel Date Setting 1
Index max match function 10

Top