ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   EXCEL - Meet 2 criteria, then find next case of third criteria (https://www.excelbanter.com/excel-worksheet-functions/212017-excel-meet-2-criteria-then-find-next-case-third-criteria.html)

Elaine

EXCEL - Meet 2 criteria, then find next case of third criteria
 
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 ?

Lars-Åke Aspelin[_2_]

EXCEL - Meet 2 criteria, then find next case of third criteria
 
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

Elaine

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


Lars-Åke Aspelin[_2_]

EXCEL - Meet 2 criteria, then find next case of third criteria
 
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

On Sun, 30 Nov 2008 19:26:01 -0800, Elaine
wrote:

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




All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com