View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Elaine Elaine is offline
external usenet poster
 
Posts: 106
Default EXCEL - Meet 2 criteria, then find next case of third criteria

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 ?

"Lars-Åke Aspelin" wrote:

On Sun, 30 Nov 2008 11:42:01 -0800, Elaine
wrote:

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=XXXXXXXX X),),)+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=XXX XXXXXX),),)-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