0

Recently I was asked to make a real-time project in Excel which evolves huge amount of data. I have this data stored in SQL Tables and managed to successfully bring it into Excel.

SQL Table on Excel:

enter image description here

Then, according to three first columns (primary keys of the table), I want to get the corresponding value and put it into a cell.

For so, I used the following formula:

=XLOOKUP(Resumo!H$1&Resumo!E$50&Resumo!$B66,  (Table_fixed_income_1[bond])&(Table_fixed_income_1[term])&(Table_fixed_income_1[date]),Table_fixed_income_1[value]/100)

enter image description here

enter image description here

It worked as intended, but a new problem arose: Excel is now very slow. There is about 4500 lines for each of the 4 main columns, resulting in 18k unique cells calculations (resulting about 5-10 minutes). The problem will grow even more considering the data in SQL is a small test table and the prod one is much bigger.

I would like to know if there is a way to make the specified project part faster.

Obs.: Some suggestions I already thought about evolved getting data from the SQL DB directly to the Cells and using different formula, but I do not have an extensive Excel knowledge to embrace it.

7
  • It's unclear from your images how they relate to the question.
    – harrymc
    Commented Jun 20, 2023 at 14:29
  • @harrymc there is a comment on the first one. The last couple are related to the formula.
    – Fróis
    Commented Jun 20, 2023 at 14:32
  • Unfortunately there is no one-size-fits-all solution. But minimizing the formulas is a start. If you are trying to output the table that has yellow highlights, then explore doing that with just a pivot table. Otherwise, perform your transformations with SQL/VBA/PowerQuery.
    – gns100
    Commented Jun 20, 2023 at 15:07
  • Perhaps Excel is not the best tool for the task. Some analytics/report tool may be the better option.
    – gns100
    Commented Jun 20, 2023 at 15:42
  • @gns100 VBA talked with my senior, which suggested VBA, but I dont have enough experience with it. Do you have some tool suggestion?
    – Fróis
    Commented Jun 20, 2023 at 20:53

2 Answers 2

0

Here are some suggestions that might meet your needs:

Use Power Query to connect to your SQL data source, add columns that transform your data, and pivot the results to your output format. That would handle your two-step method (connecting to data source and then looking up data) in a single step i.e., you'd have only your final table).

Talk to your DBA about creating a stored procedure to run a query that performs the transformations. That harnesses the power and speed of the database server, leaving only the need to connect and pivot the data via Power Query. It's possible to include input parameters in Excel that are sent to the stored procedure for processing.

0

I recently had a similar problem on a project I was working on. Ran into the same problem with Excel calculations becoming bloated to the point of loosing functionality due to the size of the data set I was attempting to pull from SQL. I was also reliant on look up formulas.

I reworked formulas to limit volatility, leaned into pivot tables, trimmed the SQL data set, and was not able to reach a practical solution using Excel, even when converting from a real time SQL connection to a static data set.

I then began testing Power BI which ultimately ended up providing the solution I needed. I'm not vastly experienced with many business intelligence softwares so cannot recommend which might be the best fit for your needs/constraints, but this worked for my needs (Large real time SQL data set) and your problem seems similar.

Hope that's a little helpful.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 20, 2023 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .