Is this called merging?

jaiD

Board Regular
Joined
Jun 13, 2004
Messages
92
Hi,

Sure someone has shown me how to do this before but have totally forgot,

I have a list of data like this:

Name Age Sales Interviews etc...

Roger 21 5 6 2
Chris 23 1 2 9
Roger 21 4 6 2

I want to run a query in access or even better in excel!!! to add merge some of the data as follows, I would want it to add some of the data up so instead of the above i have:

Name Age Sales Interviews etc...

Roger 21 9 12 4
Chris 23 1 2 9

So basically it merges the data i ask it to so that i only have one data line for each person but does not merge age.

Anyone know easiest way to do this.

Many Thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Well it's easy in Access.:)

What you want is a totals query where you group by Name and Age and sum the other fields.

The SQL for that would look something like this.

SELECT MyTable.Name, MyTable.Age, Sum(MyTable.Sales) AS SumOfSales, Sum(MyTable.Interviews) AS SumOfInterviews
FROM MyTable
GROUP BY MyTable.Name, MyTable.Age;
 

jaiD

Board Regular
Joined
Jun 13, 2004
Messages
92
Hi,

I know how to get into design table mode but where to i select to sum the data is it in the data type or description or somewhere else?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
While in query design mode goto View>Totals.
 

jaiD

Board Regular
Joined
Jun 13, 2004
Messages
92
but this dosen't get rid of duplicates,

I have done sum on the total box of the sales column etc and have left the age and name column at group by? is that right, should that get rid of duplicate names
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Well it worked for me with your sample data.:)
 

Forum statistics

Threads
1,141,098
Messages
5,704,319
Members
421,338
Latest member
Pepess

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
Top