Selecting data and adding

sj1601

Board Regular
Joined
Aug 12, 2006
Messages
96
I have two sheets in the same workbook. The first sheet is the raw data and the second one is the intended results sheet.

In the second sheet I have various fields which should refer to the same field on the first sheet and pull data against it and give me the total.

For example:

Sheet 1

Col A Col B
1 A
2 B
3 A
4 C
5 D

Sheet 2

Col A Col B
A Total of A
B Total of B

and so on.

Please note that in the two sheets the two columns are not next to each other.

Any suggestions?

Thanks.

sj1601
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Are you summing or counting?

Have a look at Countif and Sumif in Excel help files.
 

sj1601

Board Regular
Joined
Aug 12, 2006
Messages
96
Im summing all the numbers against A, B and so on. So if data against all the A is 1,2,3 then it should return 6 on the second sheet.

Thanks.
 

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Try

=Sumif(Sheet1!$B$1:$B$10,A1,Sheet1!$A$1:$A$10)

where A1 houses "A"

adjust ranges to suit and copy down.


EDIT: I forgot to make the ranges absolute so you could copy them down....
 

Forum statistics

Threads
1,175,976
Messages
5,900,659
Members
434,841
Latest member
rwille

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