SOLVED

Help with Index and Match Formula - Excel 2013

%3CLINGO-SUB%20id%3D%22lingo-sub-2203107%22%20slang%3D%22en-US%22%3EHelp%20with%20Index%20and%20Match%20Formula%20-%20Excel%202013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2203107%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20on%20a%20project%20at%20work%20which%20requires%20us%20to%20have%20a%20workbook%20with%20anywhere%20from%201%20to%2010%20sheets%20of%20data.%26nbsp%3B%20On%20the%20last%20sheet%20we%20have%20a%20Contract%20that%20needs%20to%20be%20printed%20and%20signed%20by%20our%20clients.%20The%20Data%20on%20the%20other%20sheets%20is%20the%20information%20from%20the%20client%20that%20needs%20to%20be%20on%20the%20contract.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAt%20this%20point%20I%20have%20set%20up%20the%20contact%20to%20pull%20the%20information%20from%201%20sheet%20onto%20the%20contract%20by%20entering%20the%20Clients%20name%20into%20cell%20G21%20and%20then%20using%20index%20and%20match%20the%20rest%20of%20the%20cells%20auto%20populate.%26nbsp%3B%20It%20works%20great.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20went%20to%20add%20the%20rest%20of%20the%20sheets%20to%20the%20formula%20in%20the%20required%20cells%20I%20am%20getting%20the%20error%20of%20%23VALUE!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20tell%20me%20what%20I%20have%20done%20wrong%20in%20this%20code%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DINDEX('Sheet%2010T'!C3%3AC122%26amp%3B'Sheet%209'!C3%3AC72%2CMATCH(Contract!G21%2C'Sheet%2010T'!B3%3AB122%26amp%3B'Sheet%209'!B3%3AB72%2C0))%26amp%3B%22%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20Excel%202013%20in%20my%20office.%3C%2FP%3E%3CP%3EI%20am%20very%20new%20to%20any%20intermediate%20or%20advance%20Excel%20functions%20and%20having%20been%20watching%20YT%20videos%20and%20reading%20various%20forms%20to%20gain%20insight%20into%20getting%20Excel%20to%20do%20some%20of%20the%20advanced%20for%20me%20features%20I%20would%20like.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2203107%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205361%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Index%20and%20Match%20Formula%20-%20Excel%202013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205361%22%20slang%3D%22en-US%22%3EYou%20can't%20use%20'%26amp%3B'%20to%20combine%20ranges%20like%20that.%20There%20are%20different%20option%20but%20if%20it%20is%20just%20those%202%2C%20maybe%20consider%20nesting%20them%20with%20an%20IFERROR(LOOKUP%201st%20range%2C%20LOOKUP%202nd%20range)%20If%20it%20is%20across%2010%20sheets%20you%20might%20want%20to%20consider%20creating%20a%20helper%20sheet%20where%20you%20pull%20all%20the%20relevant%20data%20together%20for%20a%20single%20lookup%20range.%20(This%20is%20completely%20opposite%20of%20what%20%40matheletes%20would%20say%20as%20it%20would%20be%20better%20to%20enter%20the%20data%20into%20a%20single%20entry%20table%20and%20then%20you%20can%20have%20the%20individual%20sheets%20have%20sub-tables%20or%20pivot%20tables%20or%20just%20have%201%20sheet%20where%20you%20can%20select%20%2F%20slice%20what%20you%20want%20to%20lookup%2Fsee).%20If%20you%20provide%20a%20sample%20workbook%20we%20could%20certainly%20help%20more%2Feasier.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2205949%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Index%20and%20Match%20Formula%20-%20Excel%202013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2205949%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%2C%20I%20will%20upload%20a%20sample%20file.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Esorry%20for%20all%20the%20edits%2C%20I%20uploaded%20a%20sample%20sheet%20blank%20and%20sample%202%20with%20an%20entry%20on%20the%20forms.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2206062%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20Index%20and%20Match%20Formula%20-%20Excel%202013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2206062%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F994482%22%20target%3D%22_blank%22%3E%40capeperson%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20please%20clarify%20what%20exactly%20doesn't%20work.%20I%20copy%2Fpaste%20formula%20from%20your%20initial%20post%20into%20the%20second%20sheet%20and%20it%20works%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20615px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F263185iD69E0089CD4969E8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I am working on a project at work which requires us to have a workbook with anywhere from 1 to 10 sheets of data.  On the last sheet we have a Contract that needs to be printed and signed by our clients. The Data on the other sheets is the information from the client that needs to be on the contract. 

 

At this point I have set up the contact to pull the information from 1 sheet onto the contract by entering the Clients name into cell G21 and then using index and match the rest of the cells auto populate.  It works great. 

 

When I went to add the rest of the sheets to the formula in the required cells I am getting the error of #VALUE!

 

Can anyone tell me what I have done wrong in this code?

 

=INDEX('Sheet 10T'!C3:C122&'Sheet 9'!C3:C72,MATCH(Contract!G21,'Sheet 10T'!B3:B122&'Sheet 9'!B3:B72,0))&""

 

We have Excel 2013 in my office.

I am very new to any intermediate or advance Excel functions and having been watching YT videos and reading various forms to gain insight into getting Excel to do some of the advanced for me features I would like.  

 

 

15 Replies
You can't use '&' to combine ranges like that. There are different option but if it is just those 2, maybe consider nesting them with an IFERROR(LOOKUP 1st range, LOOKUP 2nd range) If it is across 10 sheets you might want to consider creating a helper sheet where you pull all the relevant data together for a single lookup range. (This is completely opposite of what @matheletes would say as it would be better to enter the data into a single entry table and then you can have the individual sheets have sub-tables or pivot tables or just have 1 sheet where you can select / slice what you want to lookup/see). If you provide a sample workbook we could certainly help more/easier.

Thank you, I will upload a sample file.  

 

sorry for all the edits, I uploaded a sample sheet blank and sample 2 with an entry on the forms.

@capeperson 

Could you please clarify what exactly doesn't work. I copy/paste formula from your initial post into the second sheet and it works

image.png

On the Contract Sheet I require that I can enter into G21 , whatever name is entered on any of the Sheets 1 - 10 from Column B. In my sample file for me, using the original code in C7, and using the name from Sheet 9, PERSON, CAPE or the Kent, Clark name from sheet 10, I end up with a #VALUE! error in cell C7 of the Contract Sheet.

@capeperson 

Perhaps you may share the file with formula which returns such error? In current file your formula works as expected on two sheets

image.png

or

image.png

Sergei, have you entered data onto each of the sheets? because if you are searching for "KENT, CLARK" and you have "KENT, CLARK" on sheet 9 row 3 and "PERSON, CAPE" on sheet 10T row 3 then wont that formula will be looking for "KENT, CLARK" but see "PERSON, CAPEKENT, CLARK". Furthermore, the indexed value will return a concatenation from those multiple sheets also.
best response confirmed by capeperson (Occasional Contributor)
Solution

@capeperson In the attached I mocked up something that is working

a) I unmerged A1 on your 10 sheets and made A2 be the "ADDRESS" title and put a formula in the new A1 that will pull the sheet name (I did that so I didn't have to manually type each sheet name and if you copy the sheet or change the sheet name it auto updates, but you could manually insert the sheet name there)

b) I added a new sheet and in Col A I used a formula to collect all those sheet names.  Again, you could just skip to this step and manually type all the sheet names 

c) I do a match for that name on all the sheets

d) I have cells in row 1 to identify the sheet name and the corresponding row that the name is found

e) I then used an INDIRECT formula to use that sheet name (I named that cell "sName") and row ("sRow") to pull that row and the INDEX is used to pull which column has the info you want.  I only did a few examples to give you an idea of how it works.  I also tried to use all 'older' non-DA formulas because you mentioned you are on an older Excel.

 

see attached

@mtarler 

You are right, but in this case formula returns #N/A error, not #VALUE! error as it was declared. 

For me it still produces a #VALUE! error in the cell that I have the formula entered in. I didn't bother entering it into any of the other cells until I had it working.

Thank you for all this, I can't wait to check it out and see how it works, I for sure will have to spend time on it to figure it out.

 

I very much appreciate the time and effort you took in helping me solve my problem.

Do you have any recommended courses or books to learn more about Excel?

 

 

Sorry to be a pain, I am muddling around in the Sample sheet and I can't see to get any results with the information you entered on the sample sheet. I can get "Sue" and "not bob" to work to pull the street name, but that is using Sheet 10 and the old code I had in, when I use "Steve" or "Bob" on Sheet 1 and Sheet 6 respectively, I get no results at all, for any of the boxes in the Contract.

@capeperson In the attached I added some more data. So instead of blank cells you should see something now.
check it out, but if it isn't working can you post what you see on the LookupSheet (I changed that sheet name also). Here is an example what I get for "steve"

mtarler_0-1615814959952.png

 

It appears that if I enabling editing I the information disappears, but if I leave editing un enabled that I see the results you see on that page.

The problem is the formula pulling the list of sheet names is not working for you. I just looked it up and the function TEXTJOIN was introduced in EXCEL 2019 and hence why you are getting that error. So unfortunately, my little trick to automatically pull the sheet names will not work for you. I could give you a trick that uses the Name Manager, but since you say you have only up to 10 sheets in your workbook maybe it will be best if you do as I mentioned in my earlier post and manually type those sheet names in col A. At least do that to make sure everything else works correctly.
Thank you very much, that seems to be working out well for me at this point now to just put the final tweaks on the worksheets.

I truly appreciate the time you took to help me!