EXCEL - Meet 2 criteria, then find next case of third criteria

E

Elaine

I have been able to get excel to meet 2 criteria and then give me the value
found in a third cell located in another column and 5 cells down. Now I
would like excel to meet 2 criteria, then search below for the next criteria
and give me the value found in the cell beside.

i.e. H10 = XXXX, J10 = XXXXXXXX, now find next case of XXXXX in Column K and
give me the contents beside it in colum L.

To find the first set of criteria, I have used
=INDEX(L:L,MATCH(1,INDEX((H:H=XXXX)*(J:J=XXXXXXXXX),),)+5). Can anyone help
me add to this to go to the next case of XXXYYY found in column K and then
give me the contents of the cell beside it in L ?
 
L

Lars-Åke Aspelin

I have been able to get excel to meet 2 criteria and then give me the value
found in a third cell located in another column and 5 cells down. Now I
would like excel to meet 2 criteria, then search below for the next criteria
and give me the value found in the cell beside.

i.e. H10 = XXXX, J10 = XXXXXXXX, now find next case of XXXXX in Column K and
give me the contents beside it in colum L.

To find the first set of criteria, I have used
=INDEX(L:L,MATCH(1,INDEX((H:H=XXXX)*(J:J=XXXXXXXXX),),)+5). Can anyone help
me add to this to go to the next case of XXXYYY found in column K and then
give me the contents of the cell beside it in L ?

Try this formula:

=INDEX(OFFSET(L1,MATCH(1,INDEX((H:H=XXXX)*(J:J=XXXXXXXXX),),)-1,0,1000,),MATCH(XXXYYY,OFFSET(K1,MATCH(1,INDEX((H:H=XXXX)*(J:J=XXXXXXXXX),),)-1,0,1000,),0))

(all of the formula should be on one line)

The search for XXXYYY now starts on the row that matches XXXX and
XXXXXXXXX
If the search for XXXYYY should start on the row below that row, then
remove the -1 in two places in the formula.

Adapt the 1000, in two places, to match the size of you data table.
Instead of using H:H and J:J you could put J1:Jn and H1:Hn where n is
the size of your data. This makes the formula quicker to calculate.

Hope this helps / Lars-Åke
 
E

Elaine

Thank you, however I am getting a #N/A. I neglected to mention that the
Match in the K column (the third criteria) is a text not numerical. Would
this make a difference ? It is "AID :". Does the colon cause a problem ?
 
L

Lars-Åke Aspelin

Text should not make a difference. But you must have an exact match or
you will get the #N/A error.
Make sure that you don't have any leading or trailing or other blanks
that are in the string that you want to search for.
In your example you write "AID :", i.e. with a blank between D and :
That will not match "AID:", i.e. without any blanks.

Hope this helps / Lars-Åke
 

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

Top