Solved

How to embed a query within an Excel range so the rows grow or decrease along with the query results

Posted on 2015-01-19
2
71 Views
Last Modified: 2015-01-20
I have been messing with this problem for a few weeks and cannot seem to get it to work.

I have a workbook that reflects metrics for physicians in 5 different sections.  The first two sections have static rows and the data is retrieved using SUMIFS formulas and a tab of information from an MS-Query to a SQL db.

The other 3 are what is giving me heartburn.

I have to track the # of Inpatient, Outpatient and Surgeries Admitted by a specific physician, reflecting the Attending Physician totals for a specified period of time.

I can easily create a SQL query  and a stored procedure in the main database to obtain the summary information I want.  My biggest problem is that the users are not given the privilege to run a stored procedure.

Is there a way to bring in a master table from SQL.  Summarize the data in the manner I need for the physician chosen and embed the data into the correct area of the workbook.  The row count will fluctuate depending on the number of attending physicians in the time frame.  So the different section lengths will fluctuate.

The format would look something like this:

Admitting Physician            XYZ
 
                             Attending Physician A                  10
                             Attending Physician B                    4
                             Attending Physician C                    3

                                    Total for XYZ                           17

Thanks

Glen
0
Comment
Question by:GPSPOW
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 40558708
Here's how you do it using a big magic 'do my work for me' button, which you should be able to change to the worksheet's Open method, or whatever else floats your boat:  Microsoft Excel & SQL Server:  Self service BI to give users the data they want
0
 

Author Closing Comment

by:GPSPOW
ID: 40560043
Thank you

I was able to adapt it to my store procedures in the workbook.

The main thing now is that not all my users have privileges to run stored procedures.

Glen
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server creating a temp table 7 40
VBA in SharePoint 3 19
Convert SP in a format for debugging 7 13
Merge Statement 3 9
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now