Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 120
Default SumIf and a Range of Cells

Need to build a formula that will total up cells - if the information for the
current year is entered, see example. This spreadsheet has totals for 2006
and we like to compare the totals for 2006 with the totals for 2007.
JAN Feb March .........
Total
2006 20 8 18

2007 15 10
25

In the total column for 2006 I would only like to add up Jan and Feb because
currently there is not a total for March 2007 - when there is I would like to
formula to automatically adjust seeing that there is now a total in the March
2007 cell.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default SumIf and a Range of Cells

One way, assuming 2006 data in row 2, 2007 in row 3:


=SUM(OFFSET(B2,0,0,1,COUNT(B3:M3))

In article ,
Erika wrote:

Need to build a formula that will total up cells - if the information for the
current year is entered, see example. This spreadsheet has totals for 2006
and we like to compare the totals for 2006 with the totals for 2007.
JAN Feb March .........
Total
2006 20 8 18

2007 15 10
25

In the total column for 2006 I would only like to add up Jan and Feb because
currently there is not a total for March 2007 - when there is I would like to
formula to automatically adjust seeing that there is now a total in the March
2007 cell.

Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 120
Default SumIf and a Range of Cells

I think it is going to work, one problem I am having now. The totals for
entries for 2007 are actually a paste link from a different sheet - so there
is a total in those coulmn of a zero - they are not actually blank so it is
totally all of 2006.

Is there a way to modify this formala to say greater then zero?

"JE McGimpsey" wrote:

One way, assuming 2006 data in row 2, 2007 in row 3:


=SUM(OFFSET(B2,0,0,1,COUNT(B3:M3))

In article ,
Erika wrote:

Need to build a formula that will total up cells - if the information for the
current year is entered, see example. This spreadsheet has totals for 2006
and we like to compare the totals for 2006 with the totals for 2007.
JAN Feb March .........
Total
2006 20 8 18

2007 15 10
25

In the total column for 2006 I would only like to add up Jan and Feb because
currently there is not a total for March 2007 - when there is I would like to
formula to automatically adjust seeing that there is now a total in the March
2007 cell.

Is this possible?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default SumIf and a Range of Cells

One way:

=SUM(OFFSET(B2,0,0,1,COUNTIF(B3:M3, "0"))

In article ,
Erika wrote:

I think it is going to work, one problem I am having now. The totals for
entries for 2007 are actually a paste link from a different sheet - so there
is a total in those coulmn of a zero - they are not actually blank so it is
totally all of 2006.

Is there a way to modify this formala to say greater then zero?

"JE McGimpsey" wrote:

One way, assuming 2006 data in row 2, 2007 in row 3:


=SUM(OFFSET(B2,0,0,1,COUNT(B3:M3))

In article ,
Erika wrote:

Need to build a formula that will total up cells - if the information for
the
current year is entered, see example. This spreadsheet has totals for
2006
and we like to compare the totals for 2006 with the totals for 2007.
JAN Feb March .........
Total
2006 20 8 18

2007 15 10

25

In the total column for 2006 I would only like to add up Jan and Feb
because
currently there is not a total for March 2007 - when there is I would
like to
formula to automatically adjust seeing that there is now a total in the
March
2007 cell.

Is this possible?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 120
Default SumIf and a Range of Cells

It looks like this is close however it is picking up one cell that is blank.
Would you be able to break down the what the formula is doing and I can see
if I can fix it?

"JE McGimpsey" wrote:

One way:

=SUM(OFFSET(B2,0,0,1,COUNTIF(B3:M3, "0"))

In article ,
Erika wrote:

I think it is going to work, one problem I am having now. The totals for
entries for 2007 are actually a paste link from a different sheet - so there
is a total in those coulmn of a zero - they are not actually blank so it is
totally all of 2006.

Is there a way to modify this formala to say greater then zero?

"JE McGimpsey" wrote:

One way, assuming 2006 data in row 2, 2007 in row 3:


=SUM(OFFSET(B2,0,0,1,COUNT(B3:M3))

In article ,
Erika wrote:

Need to build a formula that will total up cells - if the information for
the
current year is entered, see example. This spreadsheet has totals for
2006
and we like to compare the totals for 2006 with the totals for 2007.
JAN Feb March .........
Total
2006 20 8 18

2007 15 10

25

In the total column for 2006 I would only like to add up Jan and Feb
because
currently there is not a total for March 2007 - when there is I would
like to
formula to automatically adjust seeing that there is now a total in the
March
2007 cell.

Is this possible?




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default SumIf and a Range of Cells

It's counting the number of values in the range B3:M3 (presumably 12
months) that are 0, indicating that a "real" value is coming from the
source.

OFFSET() then creates an range, starting at B2, that's 1 row tall by the
number of columns created above.

SUM() then sums that range.


In article ,
Erika wrote:

It looks like this is close however it is picking up one cell that is blank.
Would you be able to break down the what the formula is doing and I can see
if I can fix it?

"JE McGimpsey" wrote:

One way:

=SUM(OFFSET(B2,0,0,1,COUNTIF(B3:M3, "0"))

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
sumif() using range name Jeff Wimer Excel Worksheet Functions 1 October 18th 06 11:47 PM
How to use a range in SUMIF? bdddd Excel Worksheet Functions 7 February 14th 06 06:44 PM
Sumif and a range Metolius Dad Excel Worksheet Functions 3 February 14th 06 09:25 AM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM
Sumif range returns #NUM! BAC Excel Worksheet Functions 3 December 6th 04 05:10 PM


All times are GMT +1. The time now is 07:41 AM.

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"