Adding Sales Each Month to Existing Table

xljunkie

Board Regular
Joined
May 20, 2011
Messages
92
I have TableA which lists customer names in the first field, then the sales to that customer in the next field. There are additional fields after indicating various characteristics of that customer.

Each month, I run QueryA which gives me the sales for the past month to all the customers. I want to add these new sales to the existing sales in TableA.

I am accomplishing this by doing the following:
1. Append QueryA with all sales grouped by CustomerName to TableA. All the new sales actually get added as separate records even for the same CustomerName.
2. Then run another query to group all the CustomerNames in TableA, which combines the separated records into one, and sum up the TotalSales.

Is there a better way to accomplish this? I feel that it is redundant to add all the same CustomerNames twice. The existing record for each CustomerName is already in TableA with the cumulative running total. Then I add the same CustomerName to the table via the Append in step 1 above as a separate line item. Then I re-group and sum up the separate line items.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You should be typing the same customer name with a different date and sales amount each time (using dropdown menus if you like), unless you want to repeat the date field instead which is less efficient. If the sales are calculated in the query, why put them back in the table at all?
 
Upvote 0
The existing record for each CustomerName is already in TableA with the cumulative running total.
If by this you mean you are storing a calculated value in the table, it's generally considered to be bad practice. Totals should be dervied in queries, forms or reports only.
 
Upvote 0

Forum statistics

Threads
1,221,837
Messages
6,162,282
Members
451,759
Latest member
damav78

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