Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default "Sumif " across worksheets?

Not sure if this is a programming or function group query so apologies if wrongly posted.
I have a variable range of worksheets. In each worksheet in the cells C41:C46 there are
names, all of these cells may or may not contain a name. If any are missing it will always
be the last cells in the range of each worksheet. In cells E41:E46 there are scores which
relate to the corresponding name in the same row. Some of the names may be repeated in the
other worksheets, and there will be new names in some worksheets. What I want to do is
have a separate worksheet which lists all the names in the worksheet range and totals all
the scores against each name. I would value any guidance on this.

Graham
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default "Sumif " across worksheets?

Hi Graham,
sumif will do this.
I use it all the time between worksheets.

=sumif(ShtNm!CriteriaRng, Criteria, SumRng) becomes for your case
=sumif(ShtNm!c41:c46,"CritieraName" OR ShtNm!c41, ShtNm!e41:e46)

Where ShtNm is the name of your worksheet. You'll need the exclamation mark
after the sheet name. CriteriaRng is the range of your criteria you're
looking through. If you want to limit the formula to a specific name, you can
place double quotes around the text of name you want to look for. If you have
enough variations in names, you can just place a cell reference for that
sheet's name.
The SumRng is the range of values you want summed up. If you need it to
reference a different sheet, just place the worksheet's name in from of that
range with an exclamation.

This function will however only allow one criteria. There is another
worksheet function called Sumproduct that will allow up to 30 criteria in
older excel, and 255 criteria in Excel 2007.
That'd become

=sumproduct((ShtNm!CriteriaRng1=Criteria1)*(ShtNm! CriteriaRng2=Criteria2)*(ShtNm!CriteriaRng3=Criter ia3)....*(ShtNm!SumRng))

Same rules apply it just allows for more criteria ranges and testing.
You can have your criteria in a few different options.
1- as a cell reference, on the same sheet or a different sheet. If it's
located on a different sheet than the equation's location, place the ShtNm!
in from of the range.
2- As a name reference-- "Name" will "lock" it to that name.

Hope this is helpful. I use Sumif, and Sumproduct all the time and have
found them both most useful tools.


"Graham H" wrote:

Not sure if this is a programming or function group query so apologies if wrongly posted.
I have a variable range of worksheets. In each worksheet in the cells C41:C46 there are
names, all of these cells may or may not contain a name. If any are missing it will always
be the last cells in the range of each worksheet. In cells E41:E46 there are scores which
relate to the corresponding name in the same row. Some of the names may be repeated in the
other worksheets, and there will be new names in some worksheets. What I want to do is
have a separate worksheet which lists all the names in the worksheet range and totals all
the scores against each name. I would value any guidance on this.

Graham

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default "Sumif " across worksheets?

Steve,
Thanks for your comprehensive reply, I am very grateful. I have used Sumif so many
times but had not considered it as a solution to this particular problem. After a few
amendments I have it working fine now in my situation. Many thanks again.

Graham

SteveDB1 wrote:
Hi Graham,
sumif will do this.
I use it all the time between worksheets.

=sumif(ShtNm!CriteriaRng, Criteria, SumRng) becomes for your case
=sumif(ShtNm!c41:c46,"CritieraName" OR ShtNm!c41, ShtNm!e41:e46)

Where ShtNm is the name of your worksheet. You'll need the exclamation mark
after the sheet name. CriteriaRng is the range of your criteria you're
looking through. If you want to limit the formula to a specific name, you can
place double quotes around the text of name you want to look for. If you have
enough variations in names, you can just place a cell reference for that
sheet's name.
The SumRng is the range of values you want summed up. If you need it to
reference a different sheet, just place the worksheet's name in from of that
range with an exclamation.

This function will however only allow one criteria. There is another
worksheet function called Sumproduct that will allow up to 30 criteria in
older excel, and 255 criteria in Excel 2007.
That'd become

=sumproduct((ShtNm!CriteriaRng1=Criteria1)*(ShtNm! CriteriaRng2=Criteria2)*(ShtNm!CriteriaRng3=Criter ia3)....*(ShtNm!SumRng))

Same rules apply it just allows for more criteria ranges and testing.
You can have your criteria in a few different options.
1- as a cell reference, on the same sheet or a different sheet. If it's
located on a different sheet than the equation's location, place the ShtNm!
in from of the range.
2- As a name reference-- "Name" will "lock" it to that name.

Hope this is helpful. I use Sumif, and Sumproduct all the time and have
found them both most useful tools.


"Graham H" wrote:

Not sure if this is a programming or function group query so apologies if wrongly posted.
I have a variable range of worksheets. In each worksheet in the cells C41:C46 there are
names, all of these cells may or may not contain a name. If any are missing it will always
be the last cells in the range of each worksheet. In cells E41:E46 there are scores which
relate to the corresponding name in the same row. Some of the names may be repeated in the
other worksheets, and there will be new names in some worksheets. What I want to do is
have a separate worksheet which lists all the names in the worksheet range and totals all
the scores against each name. I would value any guidance on this.

Graham

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel formula for an "if" "then" scenario linking 3 worksheets John Excel Discussion (Misc queries) 2 February 23rd 10 06:56 PM
How do I use "sumif" for cells "0" across multiple ranges? PKB Excel Discussion (Misc queries) 2 July 14th 09 01:05 PM
Problem: Worksheets("New Style 2006").Unprotect Password:="naPrint" Karoo News[_2_] Excel Programming 1 January 30th 06 02:40 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Worksheets("Brackets").DropDowns("Game10").Click Tony_VBACoder Excel Programming 5 January 28th 05 04:41 AM


All times are GMT +1. The time now is 10:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"