Combing Results From Queries Into One Table

MattH1

Board Regular
Joined
Jul 15, 2016
Messages
174
I have results from multiple queries
Each Column A result is a Unique Identifier
Each Column B result is a value from a count (between 1 and 100 for example)
I have four different queries that give these outputs.

I want to put them all together so it shows as such:

Column A | Query1.ColumnB | Query2.ColumnB | ... |

They all don't have the same values in Column A since some counts are zero but I can use the master table to grab all distinct values in Column A that would be updating.

My initial thought:
1) Create a table using a Select Query that has all of the possible column A values.
2) Add Columns for each of the necessary ones that I'll be adding in.
3) Make all values zero for Columns B-F (assuming I have five query results I need to use)
4) Run an update query for each query result to properly update this main table? It would read and match up Column A and then update the proper value in the proper column?


Worries: Is this possible? Is it going to be troubling to reset the data to all zeros once I input some values or would step 3 take care of that each time I run it? I'm pretty lost on this if you can't tell, any help is appreciated!
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I don't think you need to create any table at all. I think you should be able to get what you want using a query.

1. Add your Master table and all 4 queries
2. Create Left Joins from your Master table to each of your 4 queries
3. Return column A from your Master table
4. Return each column B from each of your 4 queries for the other four columns in a calculated field, using the Nz function to return a 0 for any unmatched records. i.e.
Code:
Query1ColumnB: Nz([Query1].[ColumnB],0)+0
Query2ColumnB: Nz([Query2].[ColumnB],0)+0
Query3ColumnB: Nz([Query3].[ColumnB],0)+0
Query4ColumnB: Nz([Query4].[ColumnB],0)+0
I think this should give you what you want.
 
Upvote 0

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top