Home

Index / Match alteration

%3CLINGO-SUB%20id%3D%22lingo-sub-458502%22%20slang%3D%22en-US%22%3EIndex%20%2F%20Match%20alteration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-458502%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20recently%20posted%20a%20question%20and%20was%20given%20a%20great%20response%20but%20unfortunately%20the%20sample%20data%20missed%20one%20example%20that%20I%20am%20having%20trouble%20to%20apply%20to%20the%20formula.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIn%20the%20ID%20column%20(A1)%20there%20I%20used%20the%20example%20of%20456A%2C%20in%20the%20formula%20the%20ISNUMERIC%20funtion%20is%20used%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%20(A)%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%2C%20I%20need%20to%20still%20match%20the%20code%20plus%20the%20Qty%20values.%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%20with%20the%20working%20formula%20so%20far.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAs%20a%20side%20note%2C%20unfortunately%20this%20cannot%20be%20done%20in%20VBA%20as%20the%20file%20I%20will%20be%20updating%20will%20be%20new%20every%20week%20so%20I%20am%20just%20looking%20to%20copy%20and%20paste%20the%20formula%20in%20to%20the%20sheet%20when%20I%20need%20it.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-458502%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-459741%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20%2F%20Match%20alteration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-459741%22%20slang%3D%22en-US%22%3EI%20believe%20that%20if%20the%20unique%20ID%20in%20Column%20G%20is%20not%20found%20in%20Column%20A%2C%20the%20lookup%20value%20must%20be%20a%20unique%20Qty%20in%20Column%20H.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-460358%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20%2F%20Match%20alteration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-460358%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20thanks%20for%20the%20reply%2C%20I%20am%20not%20sure%20if%20you%20are%20asking%20or%20making%20a%20statement.%26nbsp%3B%20If%20the%20value%20in%20column%20A%20is%20not%20found%20at%20all%20then%20no%20other%20checks%20need%20to%20be%20made%20and%20the%20Sal%20column%20can%20just%20be%20set%20to%200.%26nbsp%3B%20What%20I%20need%20to%20happen%20is%20to%20look%20for%20the%20value%20that%20appears%20in%20A%2C%20in%20the%20G%20column%2C%20if%20there%20is%20a%20match%20and%20the%20Qty%20match%20then%20add%20in%20the%20Sal%20value%20from%20C%20in%20to%20column%20I.%26nbsp%3B%20If%20the%20Qty%20in%20D%20is%200%20then%20the%20Sal%20is%20also%200%20no%20matter%20what%20the%20ID%20value%20in%20column%20G%20is.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-462070%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20%2F%20Match%20alteration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-462070%22%20slang%3D%22en-US%22%3EI%20made%20a%20declaration%2C%20not%20simply%20a%20a%20statement.%20Column%20A%2C%20based%20on%20your%20sample%2C%20is%20the%20basis%20from%20which%20values%20shall%20be%20retrieved.%20You%20cannot%2C%20and%20logic%20doesn%E2%80%99t%20allow%20you%20to%2C%20reverse%20the%20logic%20by%20insisting%20that%2C%20in%20certain%20instances%2C%20the%20lookup%20value%20will%20now%20become%20the%20lookup%20column.%3CBR%20%2F%3EIt%E2%80%99s%20like%20going%20to%20a%20place%20you%20don%E2%80%99t%20know%20where%2C%20but%20you%20have%20an%20idea%20of%20its%20location.%20It%20now%20seems%20that%20you%20want%20the%20location%2C%20which%20you%20don%E2%80%99t%20know%20where%2C%20to%20give%20you%20an%20idea%20of%20the%20destination%2C%20which%20you%20also%20don%E2%80%99t%20know%20where.%3CBR%20%2F%3EThere%20must%20be%20some%20pattern%20for%20a%20formula%20to%20work!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-462773%22%20slang%3D%22en-US%22%3ERe%3A%20Index%20%2F%20Match%20alteration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-462773%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20apologies%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%26nbsp%3BI%20wasn't%20quite%20sure%20from%20your%20initial%20response.%26nbsp%3B%20In%20relation%20to%20my%20original%20question%20I%20am%20not%20looking%20to%20reverse%20logic%20by%20changing%20the%20lookup%20value%20to%20the%20lookup%20column.%26nbsp%3B%20But%20I%20do%20see%20some%20issues%20in%20my%20original%20logic%20as%20well%20as%20a%20strange%20error%20I%20am%20not%20sure%20about.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20I%20mentioned%20columns%20A%20to%20D%20are%20my%20reference%20values%20and%20G%20to%20K%20is%20where%20I%20am%20updating%20the%20data%20to%20based%20on%20when%20the%20ID%20and%20Qty%20match%20or%20i%3CSPAN%3Ef%20Qty%20is%200%20then%20Sal%20will%20be%200%20no%20matter%20what%20the%20ID%20value%20says.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMy%20example%20already%20does%20what%20I%20want%20it%20to%20do%20but%20what%20I%20have%20noticed%20is%2C%20if%20I%20add%20a%20new%20value%20to%20the%20ID%20column%20in%20the%20reference%20section%20column%20(A)%20it%20invalidates%20row%209%20in%20where%20I%20am%20updating%20my%20data%20to%20which%20I%20don't%20understand%20where%20previously%20it%20was%20ok%20but%20new%20records%20added%20to%20the%20G%20to%20K%20section%20are%20fine.%26nbsp%3B%20Hopefully%20my%20example%20will%20show%20where%20the%20issue%20is.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
harlequintp
Occasional Contributor

Hi,

 

I recently posted a question and was given a great response but unfortunately the sample data missed one example that I am having trouble to apply to the formula.

 

In the ID column (A1) there I used the example of 456A, in the formula the ISNUMERIC funtion is used 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 need to still match the code plus the Qty values.  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 with the working formula so far.

 

As a side note, unfortunately this cannot be done in VBA as the file I will be updating will be new every week so I am just looking to copy and paste the formula in to the sheet when I need it.

 

Thanks

4 Replies
I believe that if the unique ID in Column G is not found in Column A, the lookup value must be a unique Qty in Column H.

Hi @Twifoo, thanks for the reply, I am not sure if you are asking or making a statement.  If the value in column A is not found at all then no other checks need to be made and the Sal column can just be set to 0.  What I need to happen is to look for the value that appears in A, in the G column, if there is a match and the Qty match then add in the Sal value from C in to column I.  If the Qty in D is 0 then the Sal is also 0 no matter what the ID value in column G is.

I made a declaration, not simply a a statement. Column A, based on your sample, is the basis from which values shall be retrieved. You cannot, and logic doesn’t allow you to, reverse the logic by insisting that, in certain instances, the lookup value will now become the lookup column.
It’s like going to a place you don’t know where, but you have an idea of its location. It now seems that you want the location, which you don’t know where, to give you an idea of the destination, which you also don’t know where.
There must be some pattern for a formula to work!

My apologies @Twifoo I wasn't quite sure from your initial response.  In relation to my original question I am not looking to reverse logic by changing the lookup value to the lookup column.  But I do see some issues in my original logic as well as a strange error I am not sure about.  

 

As I mentioned columns A to D are my reference values and G to K is where I am updating the data to based on when the ID and Qty match or if Qty is 0 then Sal will be 0 no matter what the ID value says.

 

My example already does what I want it to do but what I have noticed is, if I add a new value to the ID column in the reference section column (A) it invalidates row 9 in where I am updating my data to which I don't understand where previously it was ok but new records added to the G to K section are fine.  Hopefully my example will show where the issue is.

 

 

Related Conversations