SOLVED
Home

Index Match with multiple criteria

%3CLINGO-SUB%20id%3D%22lingo-sub-445311%22%20slang%3D%22en-US%22%3EIndex%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-445311%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20do%20multiple%20checks%20in%20Excel%202010.%26nbsp%3B%20I%20want%20to%20look%20up%20a%20value%20and%20put%20it%20in%20a%20corresponding%20column.%26nbsp%3B%20When%20there%20is%20no%20match%20I%20want%20it%20to%20check%20the%20first%20reference%20table%20for%20the%20closest%20match%2C%20then%20check%20that%20the%20Qty%20is%20correct%2C%20if%20so%20add%20in%20the%20Sal%20value.%26nbsp%3B%20If%20Qty%20is%200%20then%20Sal%20will%20be%200%20no%20matter%20what%20the%20ID%20value%20says.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20my%20attachment%20I%20have%20put%20an%20example%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20A1%20to%20D8%20is%20my%20reference%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EG1%20to%20I10%20is%20where%20I%20am%20trying%20to%20update%20values.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20column%20I%20is%20my%20Index%20%2F%20Match%2C%20I3%20to%20I5%20make%20an%20exact%20match%20on%20the%20ID%20field%20and%20then%20show%20the%20correct%20Sal%20from%20the%20reference%20table.%26nbsp%3B%20I6%20to%20I9%20have%20no%20exact%20Match%20and%20currently%20show%20%22OH%22%20just%20for%20reference.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20G6%2C%20this%20is%20very%20close%20to%20what%20is%20shown%20in%20A6%20and%20as%20the%20Qty%20matches%20between%20the%20Reference%20records%20and%20the%20update%20records%20then%20I6%20should%20show%2050.%26nbsp%3B%20The%20same%20rules%20will%20apply%20to%20G7%20and%20G8.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20Value%20in%20A%20appears%20anywhere%20in%20the%20field%20of%20column%20G%2C%20examples%20A123%2C%20123A%2C%20CR123%2C%20etc%20and%20the%20Qty%20matches%2C%20then%20its%20a%20match.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20I%20have%20put%20enough%20details%20in%20but%20if%20anything%20else%20is%20needed%20please%20ask.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-445311%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-445679%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-445679%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320028%22%20target%3D%22_blank%22%3E%40harlequintp%3C%2FA%3E%26nbsp%3B%2C%20that%20could%20be%3C%2FP%3E%0A%3CPRE%3E%3DINDEX(%24C%242%3A%24C%249%2CIF(ISNUMBER(G2)%2CMATCH(G2%2C%24A%242%3A%24A%249%2C0)%2CMATCH(1%2CINDEX((H2%3D%24D%242%3A%24D%249)*ISNUMBER(SEARCH(A2%2C%24G%242%3A%24G%249))%2C0%20)%2C0)))%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-445778%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-445778%22%20slang%3D%22en-US%22%3EHi%20Sergei%2C%20that%20is%20exactly%20what%20I%20wanted%2C%20thank%20you.%20I%20will%20now%20spend%20some%20time%20reading%20though%20it%20and%20understanding%20it.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446104%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446104%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320028%22%20target%3D%22_blank%22%3E%40harlequintp%3C%2FA%3E%26nbsp%3B%2C%20here%20you%20first%20check%20if%20the%20value%20is%20number%20or%20not.%20If%20it's%20number%20when%20simple%20MATCH.%20If%20not%2C%20when%20within%20second%20MATCH%20the%20INDEX%20generates%20array%20of%201%20or%200%20(which%20is%20actually%20TRUE%20and%20FALSE)%20for%20your%20two%20criteria%2C%20multiplication%20means%20AND%20condition.%20MATCH%20takes%20position%20of%201%20(aka%20TRUE)%20in%20that%20array%2C%20other%20words%20position%20of%20the%20row%20for%20which%20all%20your%20criteria%20match.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-446167%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-446167%22%20slang%3D%22en-US%22%3EThat%20makes%20sense%2C%20I%20was%20just%20looking%20up%20within%20the%20function%20what%20the%20multiplication%20meant%2C%20thank%20you%20very%20much%20for%20the%20help%20and%20explanation.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-452477%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-452477%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sergie%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20if%20you%20will%20see%20this.%26nbsp%3B%20You%20helped%20me%20last%20week%20on%20an%20Index%2FMatch%20formula.%26nbsp%3B%20I've%20just%20been%20sent%20the%20data%20that%20I%20need%20to%20apply%20the%20formula%20to%20and%20there%20is%20a%20small%20difference.%26nbsp%3B%20In%20the%20ID%20column%20there%20I%20used%20the%20example%20of%20456A%2C%20you%20have%20used%20the%20ISNUMERIC%20funtion%20to%20strip%20out%20the%20A%20to%20then%20do%20a%20check%20against%20the%20numbers.%26nbsp%3B%20In%20the%20data%20I%20have%20been%20sent%20there%20can%20be%20something%20like%201ASN3Z%20in%20the%20G%20column%20and%20in%20my%20Ref%20table%20column%20A%20the%20letters%20SN.%26nbsp%3B%20In%20this%20case%20I%20would%20be%20looking%20for%20the%20SN%20in%201ASN3Z%2C%20the%20letter%20code%20and%20QTY%20will%20only%20every%20appear%20as%20unique%20so%20it%20will%20be%20still%20a%201%20to%201%20match.%26nbsp%3B%20I%20am%20thinking%20it%20is%20just%20a%20case%20of%20removing%20the%20ISNUMERIC%20function%20but%20I%20am%20sure%20it%20wont%20be%20as%20easy%20as%20that.%26nbsp%3B%20Again%20my%20apologies%20that%20I%20wasn't%20sent%20all%20the%20possible%20examples%20of%20this.%26nbsp%3B%20I%20have%20re-uploaded%20an%20example%20to%20show%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-452479%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20Match%20with%20multiple%20criteria%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-452479%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sergie%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENot%20sure%20if%20you%20will%20see%20this.%26nbsp%3B%20You%20helped%20me%20last%20week%20on%20an%20Index%2FMatch%20formula.%26nbsp%3B%20I've%20just%20been%20sent%20the%20data%20that%20I%20need%20to%20apply%20the%20formula%20to%20and%20there%20is%20a%20small%20difference.%26nbsp%3B%20In%20the%20ID%20column%20there%20I%20used%20the%20example%20of%20456A%2C%20you%20have%20used%20the%20ISNUMERIC%20funtion%20to%20strip%20out%20the%20A%20to%20then%20do%20a%20check%20against%20the%20numbers.%26nbsp%3B%20In%20the%20data%20I%20have%20been%20sent%20there%20can%20be%20something%20like%201ASN3Z%20in%20the%20G%20column%20and%20in%20my%20Ref%20table%20column%20A%20the%20letters%20SN.%26nbsp%3B%20In%20this%20case%20I%20would%20be%20looking%20for%20the%20SN%20in%201ASN3Z%2C%20the%20letter%20code%20and%20QTY%20will%20only%20every%20appear%20as%20unique%20so%20it%20will%20be%20still%20a%201%20to%201%20match.%26nbsp%3B%20I%20am%20thinking%20it%20is%20just%20a%20case%20of%20removing%20the%20ISNUMERIC%20function%20but%20I%20am%20sure%20it%20wont%20be%20as%20easy%20as%20that.%26nbsp%3B%20Again%20my%20apologies%20that%20I%20wasn't%20sent%20all%20the%20possible%20examples%20of%20this.%26nbsp%3B%20I%20have%20re-uploaded%20an%20example%20to%20show%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E
harlequintp
Occasional Contributor

Hi,

 

I am trying to do multiple checks in Excel 2010.  I want to look up a value and put it in a corresponding column.  When there is no match I want it to check the first reference table for the closest match, then check that the Qty is correct, if so add in the Sal value.  If Qty is 0 then Sal will be 0 no matter what the ID value says.

 

In my attachment I have put an example

 

In A1 to D8 is my reference table.

 

G1 to I10 is where I am trying to update values. 

 

In the column I is my Index / Match, I3 to I5 make an exact match on the ID field and then show the correct Sal from the reference table.  I6 to I9 have no exact Match and currently show "OH" just for reference.

 

In G6, this is very close to what is shown in A6 and as the Qty matches between the Reference records and the update records then I6 should show 50.  The same rules will apply to G7 and G8.

 

If the Value in A appears anywhere in the field of column G, examples A123, 123A, CR123, etc and the Qty matches, then its a match.

 

I hope I have put enough details in but if anything else is needed please ask.

 

Thanks 

6 Replies
Solution

@harlequintp , that could be

=INDEX($C$2:$C$9,IF(ISNUMBER(G2),MATCH(G2,$A$2:$A$9,0),MATCH(1,INDEX((H2=$D$2:$D$9)*ISNUMBER(SEARCH(A2,$G$2:$G$9)),0 ),0)))

 

Hi Sergei, that is exactly what I wanted, thank you. I will now spend some time reading though it and understanding it.

@harlequintp , here you first check if the value is number or not. If it's number when simple MATCH. If not, when within second MATCH the INDEX generates array of 1 or 0 (which is actually TRUE and FALSE) for your two criteria, multiplication means AND condition. MATCH takes position of 1 (aka TRUE) in that array, other words position of the row for which all your criteria match.

That makes sense, I was just looking up within the function what the multiplication meant, thank you very much for the help and explanation.

Hi Sergie,

 

Not sure if you will see this.  You helped me last week on an Index/Match formula.  I've just been sent the data that I need to apply the formula to and there is a small difference.  In the ID column there I used the example of 456A, you have used the ISNUMERIC funtion to strip out the A to then do a check against the numbers.  In the data I have been sent there can be something like 1ASN3Z in the G column and in my Ref table column A the letters SN.  In this case I would be looking for the SN in 1ASN3Z, the letter code and QTY will only every appear as unique so it will be still a 1 to 1 match.  I am thinking it is just a case of removing the ISNUMERIC function but I am sure it wont be as easy as that.  Again my apologies that I wasn't sent all the possible examples of this.  I have re-uploaded an example to show this.

Hi Sergie,

 

Not sure if you will see this.  You helped me last week on an Index/Match formula.  I've just been sent the data that I need to apply the formula to and there is a small difference.  In the ID column there I used the example of 456A, you have used the ISNUMERIC funtion to strip out the A to then do a check against the numbers.  In the data I have been sent there can be something like 1ASN3Z in the G column and in my Ref table column A the letters SN.  In this case I would be looking for the SN in 1ASN3Z, the letter code and QTY will only every appear as unique so it will be still a 1 to 1 match.  I am thinking it is just a case of removing the ISNUMERIC function but I am sure it wont be as easy as that.  Again my apologies that I wasn't sent all the possible examples of this.  I have re-uploaded an example to show this.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies