Pivot and vlookup

%3CLINGO-SUB%20id%3D%22lingo-sub-1622847%22%20slang%3D%22en-US%22%3EPivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622847%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20made%20a%20pivot%20table%2C%20where%20I%20use%20a%20field%20in%20the%20filter%20to%20lookup%20another%20informations.%20For%20example%20I%20use%20the%20customer%20number%20as%20a%20filter%20in%20the%20pivot%20-%20but%20I%20also%20use%20it%20to%20'vlookup'%20the%20customer%20name%2C%20address%2C%20bonus.%3C%2FP%3E%3CP%3EBut%20now%20I%20have%20by%20a%20mistake%20entered%20a%20wrong%20customer%20number%2C%20that%20doesn't%20exists%20and%20I%20accidently%20pulled%20'Ok'%20to%20rename%20the%20data.%20I%20renamed%20it%20back%20-%20but%20now%20my%20lookups%20don't%20work%20anymore%20for%20that%20particular%20customer%20no.%3C%2FP%3E%3CP%3EI%20have%20tried%20several%20things%20several%20times%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3EChecked%20the%20spelling%20and%20no%20blancks%20-%20removed%20the%20field%20-%20refreshed%20the%20pivot%20-%20recalled%20the%20'raw%20data'%3C%2FP%3E%3CP%3E-%20checked%20the%20vlookup.%20Nothing%20helps.%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20works%20perfectly%20for%20all%20the%20other%20customer%2C%20but%20not%20this%20one.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20you%20can%20help%20me.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EB.R.%20Susanne%3C%2FP%3E%3CP%3EI%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1622847%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etraining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622964%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622964%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776827%22%20target%3D%22_blank%22%3E%40Susanne2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20sounds%20like%20you've%20done%20a%20reasonable%20search%20for%20possible%20causes.%20Is%20it%20possible%20for%20you%20to%20post%20a%20copy%20of%20the%20spreadsheet(s)%2C%20just%20making%20sure%20first%20to%20remove%20any%20actual%20names%2C%20addresses%2C%20etc.--i.e.%2C%20any%20and%20all%20confidential%20or%20personal%20info.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622987%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622987%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776827%22%20target%3D%22_blank%22%3E%40Susanne2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETry%20simply%20to%20compare%20value%20for%20changed%20number%20with%20one%20in%20lookup%20array%2C%20like%20%3DCell1%3DCell2%3C%2FP%3E%0A%3CP%3EPerhaps%20data%20type%20was%20changed%20from%20number%20to%20text%20(check%20the%20cell%20by%20%3DISTEXT()).%20Or%20non-printable%20character%20was%20added%20(check%20by%20%3DLEN()%20).%20Or%20something%20else.%20As%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3Bmentioned%20without%20sample%20file%20it's%20hard%20to%20say%20something%20concrete.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1624448%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624448%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3Eand%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%20-%20thank%20you%20for%20your%20answers.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20I%20have%20made%20a%20light%20version%20of%20the%20spreadsheet%20%3A%3C%2FP%3E%3CP%3EOn%20sheet%20'Pr.%20kunde'%20-%20in%20field%20'CustAddrNo'%20%3A%3C%2FP%3E%3CP%3EIf%20I%20use%20no.%202001792%20everything%20is%20fine.%3C%2FP%3E%3CP%3EIf%20I%20use%20no.%202001811%20my%20lookups%20are%20interrupted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E's%20suggestions%20and%20it%20seems%20to%20be%20text%20now.%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20did%20that%20happened%20%3F%20(I%20know%20it%20happened%20when%20I%20by%20a%20mistake%20overwrite%20the%20number%20and%20then%20changed%20it%20back%20-%20but%20why%20did%20it%20then%20became%20text%20%3F)%3C%2FP%3E%3CP%3EHow%20do%20I%20correct%20it%20%3F%3C%2FP%3E%3CP%3EAnd%20how%20do%20I%20prevent%20other%20users%20to%20do%20the%20same%20failure%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20you%20can%20help%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1624453%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1624453%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1625033%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1625033%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776827%22%20target%3D%22_blank%22%3E%40Susanne2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20didn't%20find%20exact%20reason%2C%20but%20if%20re-build%20PivotTable%20it%20works.%20Most%20probably%20something%20with%20caches.%20Please%20check%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1627443%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1627443%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHello%20again%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20now%20rebuild%20the%20pivot%2C%20but%20I%20can%20still%20enter%20a%20non-existing%20number%20in%20the%20filter%20and%20then%20I%20get%20this%20warning%2Fquestion%20%22No%20item%20of%20this%20name%20exists%20in%20the%20Pivottable%20report.%20Rename%20'2001811'%20to%20'8888888'%3F%22.%20See%20attached.%3C%2FP%3E%3CP%3EHow%20do%20I%20prevent%20this%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20your%20example%20I%20can%20only%20enter%20existing%20number%2C%20which%20is%20what%20I%20want.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1628892%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1628892%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776827%22%20target%3D%22_blank%22%3E%40Susanne2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMy%20guess%20an%20error%20appears%20if%20you%20work%20with%20macros%2C%20but%20that's%20not%20my%20territory.%20If%20not%2C%20could%20you%20please%20share%20how%20to%20reproduce%20it%20on%20the%20workbook%20without%20macros.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1629221%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1629221%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F776827%22%20target%3D%22_blank%22%3E%40Susanne2020%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChange%20your%20formula%20in%20D2%20to%20include%20INT(B2)%20rather%20than%20just%20B2%20-%20this%20looks%20for%20the%20whole%20number%20and%20discounts%20any%20trailing%20decimals%20which%20can%20throw%20off%20a%20formula%20looking%20for%20an%20exact%20match%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DVLOOKUP(INT(B2)%2CCustomer!A%3AB%2C2%2CFALSE)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1630247%22%20slang%3D%22en-US%22%3ERe%3A%20Pivot%20and%20vlookup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1630247%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%20I%20work%20a%20lot%20with%20macros%2FVBA%20and%20that%20can%20give%20some%20'fun'-%20most%20of%20the%20time%20it%20works%20perfectly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F531239%22%20target%3D%22_blank%22%3E%40Charla74%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerfect%20!%20I%20have%20changed%20it%20and%20it%20works%20without%20problems%20-%20thank%20you%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello, 

 

I have made a pivot table, where I use a field in the filter to lookup another informations. For example I use the customer number as a filter in the pivot - but I also use it to 'vlookup' the customer name, address, bonus.

But now I have by a mistake entered a wrong customer number, that doesn't exists and I accidently pulled 'Ok' to rename the data. I renamed it back - but now my lookups don't work anymore for that particular customer no.

I have tried several things several times : 

Checked the spelling and no blancks - removed the field - refreshed the pivot - recalled the 'raw data'

- checked the vlookup. Nothing helps. 

It works perfectly for all the other customer, but not this one.

 

I hope you can help me.

 

B.R. Susanne

I

9 Replies

@Susanne2020 

 

It sounds like you've done a reasonable search for possible causes. Is it possible for you to post a copy of the spreadsheet(s), just making sure first to remove any actual names, addresses, etc.--i.e., any and all confidential or personal info.

 

@Susanne2020 

Try simply to compare value for changed number with one in lookup array, like =Cell1=Cell2

Perhaps data type was changed from number to text (check the cell by =ISTEXT()). Or non-printable character was added (check by =LEN() ). Or something else. As @mathetes mentioned without sample file it's hard to say something concrete.

@mathetesand @Sergei Baklan - thank you for your answers. 

 

Now I have made a light version of the spreadsheet :

On sheet 'Pr. kunde' - in field 'CustAddrNo' :

If I use no. 2001792 everything is fine.

If I use no. 2001811 my lookups are interrupted.

 

I have tried @Sergei Baklan's suggestions and it seems to be text now. 

How did that happened ? (I know it happened when I by a mistake overwrite the number and then changed it back - but why did it then became text ?)

How do I correct it ?

And how do I prevent other users to do the same failure ?

 

Hope you can help

@Susanne2020 

I didn't find exact reason, but if re-build PivotTable it works. Most probably something with caches. Please check attached.

@Sergei Baklan 

 

Hello again, 

 

I have now rebuild the pivot, but I can still enter a non-existing number in the filter and then I get this warning/question "No item of this name exists in the Pivottable report. Rename '2001811' to '8888888'?". See attached.

How do I prevent this ?

 

In your example I can only enter existing number, which is what I want.

 

@Susanne2020 

My guess an error appears if you work with macros, but that's not my territory. If not, could you please share how to reproduce it on the workbook without macros.

@Susanne2020 

 

Change your formula in D2 to include INT(B2) rather than just B2 - this looks for the whole number and discounts any trailing decimals which can throw off a formula looking for an exact match:

 

=VLOOKUP(INT(B2),Customer!A:B,2,FALSE)

@Sergei Baklan 

Yes I work a lot with macros/VBA and that can give some 'fun'- most of the time it works perfectly.

 

 

@Charla74 

Perfect ! I have changed it and it works without problems - thank you