I'm trying to get data from both external source and another sheet of my excel file into one table.
What I have in SQL Server is a table of my customers:
╔════╦══════╦═════════╗
║ ID ║ Name ║ Country ║
╠════╬══════╬═════════╣
║ 1 ║ Joe ║ Spain ║
║ 2 ║ Bob ║ Frence ║
║ 3 ║ Eva ║ Spain ║
╚════╩══════╩═════════╝
What I have in another sheet of my excel file is a list of countries and taxes:
╔═════════╦═════╗
║ Country ║ VAT ║
╠═════════╬═════╣
║ Germany ║ 19% ║
║ Frence ║ 20% ║
║ Spain ║ 21% ║
╚═════════╩═════╝
And what I need in the end is a table which contains my customer and the tax which he should pay. The table should be in one of the sheets of my excel document and user should be able to easily update it on demand.
╔══════════╦═════╗
║ Customer ║ VAT ║
╠══════════╬═════╣
║ Joe ║ 21% ║
║ Bob ║ 20% ║
║ Eva ║ 21% ║
╚══════════╩═════╝
Any idea what would be a nice and easy solution?
I tried two excel sql queries - one from SQL Server and second one "from microsoft query" (from the excel file). But since I cannot run them subsequenty, I cannot make sure the data after one update is correct.
I also tried one sql queries (from SQL Server) and a VLOOKUP formula. But the formula is not automatically calculated after the table is filled in.
See Question&Answers more detail:os