How to add the values on different sheets of a workbook

Shweta

Well-known Member
Joined
Jun 5, 2011
Messages
514
Hi All,

I am facing the problem with sum function.
I have the data on different sheets of a workbook. On sheet1
<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=128 border=0><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl69 id=td_post_2835456 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=64 height=20>C16</TD><TD class=xl69 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64>D16</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl69 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>shweta</TD><TD class=xl69 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">45</TD></TR></TBODY></TABLE>

sheet2

<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=128 border=0><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=64 height=20>E4</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64>F4</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>shweta</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">50</TD></TR></TBODY></TABLE>

sheet3

<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=128 border=0><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=64 height=20>C3</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64>D3</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>shweta</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">47</TD></TR></TBODY></TABLE>

Sheet4

<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=128 border=0><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=64 height=20>A1</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 48pt; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent" width=64>B1</TD></TR><TR style="HEIGHT: 15pt" height=20><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>shweta</TD><TD class=xl70 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; BORDER-BOTTOM: #e0dfe3; BACKGROUND-COLOR: transparent">527</TD></TR></TBODY></TABLE>

On sheet5 I need to add all the values of Shweta. If I am using the sum function I need to select the cells one by one. I have 65 names like this. so it is not being possible to add the values one by one for each person.

Please help me out.

Thanks
Shweta
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Like so:

Excel Workbook
ABC
1
2shweta45
3doug33
4
Sheet1
Excel Workbook
DEFG
3
4shweta50
5
6doug25
7
Sheet2
Excel Workbook
ABCDE
1
2doug22
3shweta47
4
Sheet3
Excel Workbook
ABCD
1shweta527
2
3doug33
Sheet4
Excel Workbook
ABCD
1
2shweta669
3doug80
4
5
Sheet5
 
Upvote 0
Thanks Jbeaucaire!

But can you please tell me why you took "!A:G" & "!B:H".

Shweta
 
Upvote 0
SUMIF() 101...

When using SUMIF you need two identical ranges. The first range is the evaluation range that you are searching for specific value(s). I simply selected range A:G as the cells to look for the names in (you can expand/contract that as you wish).

The second range is the range to sum numbers from. Based on your example, the numbers to sum are in the immediate cell to right of the found names, so I summed from an identically sized range offset by 1 column from the original range, B:H. Again, you can adjust that as needed.
 
Upvote 0
Ok, I understood.

So if I don't know where is the data in that case I can select the whole range of a sheet.

Shweta
 
Upvote 0
For efficiency's sake, I hope you DON'T do that. You should select a reasonable range of columns, not 100s and 1000s.
 
Upvote 0
One more question Jbeaucaire....

I have 31 sheets for 31 days of a month. So in that case do I need to enter the sheet no. manually in the formula like "sheet"&{1,2,3,4....till 31} or I can just use the range as "sheet"&{1:31}.

Please tell me the shortcut if any....
 
Upvote 0
Trial and error would probably show you can't use that shortcut.

There is another way. Let's say you want these formulas to expand in an easy way. For that I would us a "list" of sheet names and a Named Range to evaluate that list.

In this example, I'm using column F to list sheets as I add them. I only put sheet names here that actually exist. Then I used a dynamic formula to expand that list into a named range called MySheets by using this.... Insert > Name > Define

=OFFSET(Last!$F$1,,,COUNTA(Last!$F:$F),)

With that, I can use the ARRAY formula shown below, confirmed by pressing CTRL-SHIFT-ENTER to activate the array, then copied down.


Excel Workbook
ABCDEF
1Sheet1
2shweta60Sheet2
3doug20Sheet3
4Sheet4
5
Summary Sheet
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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