How can I run a vlookup on vba array - excel

Fairly new to posting here but not new to the site.
I have done a fair bit of Googling on this one but still don’t seem to have the answer so thought I’d post here.
This is high level and no code included just now although can provide later.
I have a template that is completed by customers and within that template are hidden tabs, one of which has a table that is used as part of a vlookup.
What I am trying to achieve here is to read the customers submitted data into account of an array (done) and then do some kind of equivalent to a vlookup on a column in the array and then add the results to a new column in the array.
I’m happy to also read the lookup table into an array or dictionary as I understand this is a far better approach.
I’m just stuck on what to use instead of vlookup and how to achieve the above.
Any thoughts would be appreciated. Thanks in advance.

Related

Applying multiple filters with Tabulator table

I am not well-versed in code. Would someone (for hire) be willing to help me place one of these beautiful tables on my website?
It should be able to do the following:
Sort per column
work with multiple filters
have the ability to update the numbers by linking to a google sheets, etc.
Thank you.
Rick Gonsalves
rick_gonsalves#hotmail.com
Have not tried yet as I am not familiar with code and how to use it.

Merging two tables with low quality data

I've been spinning my wheels on this one for a while and have had trouble finding a relatively pertinent answer elsewhere. This seems to me to be pretty convoluted and maybe not even possible, so if that's the case please let me know and I can find other workarounds. And if it would be easier to just refer me to reading materials, etc. please feel free as well.
My goal is to merge two tables together via Power Query in Excel, where one of the tables has typos and empty fields where there shouldn't be. I've attached a picture here for reference:
The second table is a "master table" of sorts, that the first table should cross-reference against. The desired process/result is attached here:
To get the names to match, I've been trying to fine-tune fuzzy match's similarity figure, though I'm not quite there yet as some of the typos are too different. It seems to me that the real difficult part is trying to reconcile the cities based on the correct customer name.
Maybe there is a better way to do this outside of Power Query, but that's just where I started as it made the most sense to me. Any tips or guidance would be greatly appreciated! Thank you in advance.

Looking for guidance on VB Code for Excel that will create action between two dynamic tables in each sheet.

I am trying to create a spreadsheet that allows me to keep track of a customer with general details (name, phone number, address...) bu then also keep a very specific list of all the products they have ordered. I want to be able to run reports on frequency of all details including what has been ordered. I have a bit of programming experience but not a whole lot of Excel experience so I know how I would write a program but not exactly how to do it in Excel. My thought is to have one sheet dedicated to the general specifications of the customer and then a second sheet that keeps track of the orders per customer. I want to be able to click on a hyperlink or something of the sort that will take me to the second sheet and automatically fill in the customer name. I want the first sheet to have the guest information running horizontally in rows but then the second sheet would have the names running horizontally on the top row and the orders would go down each column under the names. This way it keeps all of my sheets tidy and allows for me to run the type of reports I'm looking for. The main issue I'm having is figuring out a way to create a link that will do the action I want. I understand how to program but don't know Visual Basic very well but if someone was able to offer a similar code I would be able to decipher it and change it to my needs. Or if someone has a more efficient thought on how to set up the spreadsheet I'm all ears! Thanks a ton!
what you need is to create a pivot table with a data model.
The instructions are longer then what it actually takes!
here are few tutorials about the subject:
youTube video
MSDN instructions
PS don't write code in Excel unless strictly necessary. If it's a data issue, use data model

Most efficient way to place hundreds of array formulas?

I am new to VBA and advanced formulas for that matter and would deeply appreciate some guidance here.
I have a workbook that acts as a GUI for a database in another workbook. I use the following array formula to act as a search function:
{=IF(ISERROR(INDEX('Client Contact Database.xlsx'!Data.ContactsFull,SMALL(IF('Client Contact Database.xlsx'!Data.ContactClients=$L$1,ROW('Client Contact Database.xlsx'!Data.ContactClients)),ROW(1:1)),2)),"",INDEX('Client Contact Database.xlsx'!Data.ContactsFull,SMALL(IF('Client Contact Database.xlsx'!Data.ContactClients=$L$1,ROW('Client Contact Database.xlsx'!Data.ContactClients)-1),ROW(1:1)),1))}
Although very sloppy, this works fine. However, I now need to add option buttons to toggle between searching for two different things. This means I have to replace the array formula from A3:L104 through VBA. My question is twofold:
How can I shorten this formula to under 255 chars to use with .FormulaArray? I tried putting it in two halves but my understanding of syntax is not sufficient.
Even if I got that to work, I imagine it would be extremely slow and inefficient. Is there a better way to go about this task?
Any help is greatly appreciated, I'm in way over my head with this. Thanks in advance.
First off, swap out your IF(ISERROR(<formula>), "", <formula>) for something that uses the IFERROR function. This will effectively cut your formula in half as IFERROR takes care of error control and default value without duplicating the formula.
=iferror(INDEX('Client Contact Database.xlsx'!Data.ContactsFull,SMALL(IF('Client Contact Database.xlsx'!Data.ContactClients=$L$1,ROW('Client Contact Database.xlsx'!Data.ContactClients)-1),ROW(1:1)),1), "")
I did not build all of the external references and named ranges for a full build environment, but I believe I transcribed that correctly.

how to display data that is related to a specific cell in excel 2010?

I have created 2 columns, the first has a category of a system using data validation, and the second has the description and failures of that system.
The purpose of that is to open a malfunction on some parts.
In a different sheet I wish to do the same only this time I want to choose the system and the description will automatically appear in the next column showing me all the malfunctions I have written on this system.
I am not very good at all the functions of excel. but I still searched for one that might help me. I have tried using the DGET function but it got me nowhere.
Perhaps try the solution here - it's a bit tricky to explain without copy-pasting the whole thing:
https://superuser.com/questions/536234/excel-how-to-vlookup-to-return-multiple-values
Also take a look at vlookup() if you're working across spreadsheets.
As expected, all of the responses you've seen ehere - and probably elsewhere - are ponyers to VLookup, or a refusal to answer your question.
I'm guessing that you're using DGET() because you need to retrieve data from one named column, using a match for a search term in another named column; and you're that because you can't rely on column ordinals or addresses - you have to do it by name.
VLookup won't do that for you: not without extremely complex and fragile array formulae.
The bad news is: Microsoft NEVER published a working example of a DGET() formula or any corresponding VBA Worksheet Function code.
There's page after page of descriptive text and general explanation in the helpfiles and on MSDN: but no working example. Nobody in Redmond ever sat down and made the DGET() function work with a reproducible set of function parameters and published a screen-shot the working formula.
I'll let you guess why that is.
Maybe there's an example somewhere that is, in effect, a VLookup implemented for known column ordinals using DGET(). If there is, I never found it and you won't either: and it would, of course, be useless for any application where you're working with field names instead of known ordinals.
What you need to do is capture the tabulated data range, with field names in the top row, and pass it to a SQL query using ADODB or MS-Query. That bad new for that is that all the MS-JET Excel drivers have a fatal memory leak.
After that fails, you're left exporting the data somewhere that a proper database app can run the SQL: and that's actually the right thing to do, because your attempt at using DGET() is a relational data query.
If you're left with the need to do this entirely in Excel, you have reached a level of desperation normally associated with the last survivor of an airplane crash who, having devoured the charred remains of his unlucky fellow passengers, is finally forced to contemplate the awful exigency of opening and eating the inflight catering meals.
The grisly details for the equivalent in Excel are a Horrible Hack published here:
http://excellerando.blogspot.com/2014/09/from-time-to-time-it-necessary-to.html

Resources