PC Review


Reply
Thread Tools Rate Thread

countif/offset problem

 
 
Scot B
Guest
Posts: n/a
 
      9th Dec 2005
Greetings, Experts,

I'm sorry for not following the earlier advice, i just don't get it.
perhaps i'm not explaining well.

We're trying to define the formula that will look at a row of data and sum a
specific number of cells into a new cell (called the new cell A2). then,
cell B2 picks up summing the row for a specified number of cells and puts
that sum into B2.

Here's the sample data, in a row. Row 1: 10,35,50,7,25,48

Cell A7 has the value "3", which means that we'd like to put the sum of the
first 3 numbers in Row1 into cell A2.

Cell A8 has the value "2", which means we'd like to look at the row of data
and pick up where the first formula left off (the fourth position in the
row, cell A4), and sum the value in the 2 cells.

So, in this simple example, cell A2 would result in a value of 95
(10+35+50), and cell B2 would result in a value of 32 (7+25)

Then, cell C2 would pick up where the previous formula left off and go for a
certain number of cells....

Thanks for your help!!!! this has been a sticking point for hours.

Cheers,

Scot B.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      9th Dec 2005
Try this:

First, for better utility, I put your offset params in cells....
A3: 3
B3: 2
C3: 3
etc

and the summations in A2, B2, C2, etc
A2: =SUM(OFFSET($A1,0,0,1,A3))
B2: =SUM(OFFSET($A1,0,SUM($A3:A3),1,B3))
Copy that formula across row 2 as far as necessary.

Does that help?

***********
Regards,
Ron


"Scot B" wrote:

> Greetings, Experts,
>
> I'm sorry for not following the earlier advice, i just don't get it.
> perhaps i'm not explaining well.
>
> We're trying to define the formula that will look at a row of data and sum a
> specific number of cells into a new cell (called the new cell A2). then,
> cell B2 picks up summing the row for a specified number of cells and puts
> that sum into B2.
>
> Here's the sample data, in a row. Row 1: 10,35,50,7,25,48
>
> Cell A7 has the value "3", which means that we'd like to put the sum of the
> first 3 numbers in Row1 into cell A2.
>
> Cell A8 has the value "2", which means we'd like to look at the row of data
> and pick up where the first formula left off (the fourth position in the
> row, cell A4), and sum the value in the 2 cells.
>
> So, in this simple example, cell A2 would result in a value of 95
> (10+35+50), and cell B2 would result in a value of 32 (7+25)
>
> Then, cell C2 would pick up where the previous formula left off and go for a
> certain number of cells....
>
> Thanks for your help!!!! this has been a sticking point for hours.
>
> Cheers,
>
> Scot B.
>
>
>

 
Reply With Quote
 
Peo Sjoblom
Guest
Posts: n/a
 
      9th Dec 2005
1.

=SUM(INDEX(1:1,,1):INDEX(1:1,,A7))

or

=SUM(OFFSET($A$1,,,,A7))

2.

=SUM(INDEX(1:1,,A7+1):INDEX(1:1,,A7+A8))

or

=SUM(OFFSET($A$1,,A7,,A8))


I prefer the INDEX since it is non volatile

--
Regards,

Peo Sjoblom

(No private emails please)


"Scot B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings, Experts,
>
> I'm sorry for not following the earlier advice, i just don't get it.
> perhaps i'm not explaining well.
>
> We're trying to define the formula that will look at a row of data and sum
> a specific number of cells into a new cell (called the new cell A2).
> then, cell B2 picks up summing the row for a specified number of cells and
> puts that sum into B2.
>
> Here's the sample data, in a row. Row 1: 10,35,50,7,25,48
>
> Cell A7 has the value "3", which means that we'd like to put the sum of
> the first 3 numbers in Row1 into cell A2.
>
> Cell A8 has the value "2", which means we'd like to look at the row of
> data and pick up where the first formula left off (the fourth position in
> the row, cell A4), and sum the value in the 2 cells.
>
> So, in this simple example, cell A2 would result in a value of 95
> (10+35+50), and cell B2 would result in a value of 32 (7+25)
>
> Then, cell C2 would pick up where the previous formula left off and go for
> a certain number of cells....
>
> Thanks for your help!!!! this has been a sticking point for hours.
>
> Cheers,
>
> Scot B.
>


 
Reply With Quote
 
=?Utf-8?B?ZHVhbmU=?=
Guest
Posts: n/a
 
      9th Dec 2005
your row of data starting in cell a1

your numbers in cells a7 and a8 (and down if you like)

this in cell a2 and copy to b2, c2 etc

=SUM(OFFSET($A$1,0,SUM($A$6:INDIRECT("A"&COLUMN()+5)),1,1):OFFSET($A$1,0,SUM($A$6:INDIRECT("A"&COLUMN()+6))-1,1,1))

"Scot B" wrote:

> Greetings, Experts,
>
> I'm sorry for not following the earlier advice, i just don't get it.
> perhaps i'm not explaining well.
>
> We're trying to define the formula that will look at a row of data and sum a
> specific number of cells into a new cell (called the new cell A2). then,
> cell B2 picks up summing the row for a specified number of cells and puts
> that sum into B2.
>
> Here's the sample data, in a row. Row 1: 10,35,50,7,25,48
>
> Cell A7 has the value "3", which means that we'd like to put the sum of the
> first 3 numbers in Row1 into cell A2.
>
> Cell A8 has the value "2", which means we'd like to look at the row of data
> and pick up where the first formula left off (the fourth position in the
> row, cell A4), and sum the value in the 2 cells.
>
> So, in this simple example, cell A2 would result in a value of 95
> (10+35+50), and cell B2 would result in a value of 32 (7+25)
>
> Then, cell C2 would pick up where the previous formula left off and go for a
> certain number of cells....
>
> Thanks for your help!!!! this has been a sticking point for hours.
>
> Cheers,
>
> Scot B.
>
>
>

 
Reply With Quote
 
Scot B
Guest
Posts: n/a
 
      9th Dec 2005
that worked perfectly...i don't understand it, but at this hour, just
getting it working is a victory.

thanks so much for your help!

"Ron Coderre" <(E-Mail Removed)> wrote in message
news:33F9F619-EC40-4D95-9393-(E-Mail Removed)...
> Try this:
>
> First, for better utility, I put your offset params in cells....
> A3: 3
> B3: 2
> C3: 3
> etc
>
> and the summations in A2, B2, C2, etc
> A2: =SUM(OFFSET($A1,0,0,1,A3))
> B2: =SUM(OFFSET($A1,0,SUM($A3:A3),1,B3))
> Copy that formula across row 2 as far as necessary.
>
> Does that help?
>
> ***********
> Regards,
> Ron
>
>
> "Scot B" wrote:
>
>> Greetings, Experts,
>>
>> I'm sorry for not following the earlier advice, i just don't get it.
>> perhaps i'm not explaining well.
>>
>> We're trying to define the formula that will look at a row of data and
>> sum a
>> specific number of cells into a new cell (called the new cell A2). then,
>> cell B2 picks up summing the row for a specified number of cells and puts
>> that sum into B2.
>>
>> Here's the sample data, in a row. Row 1: 10,35,50,7,25,48
>>
>> Cell A7 has the value "3", which means that we'd like to put the sum of
>> the
>> first 3 numbers in Row1 into cell A2.
>>
>> Cell A8 has the value "2", which means we'd like to look at the row of
>> data
>> and pick up where the first formula left off (the fourth position in the
>> row, cell A4), and sum the value in the 2 cells.
>>
>> So, in this simple example, cell A2 would result in a value of 95
>> (10+35+50), and cell B2 would result in a value of 32 (7+25)
>>
>> Then, cell C2 would pick up where the previous formula left off and go
>> for a
>> certain number of cells....
>>
>> Thanks for your help!!!! this has been a sticking point for hours.
>>
>> Cheers,
>>
>> Scot B.
>>
>>
>>



 
Reply With Quote
 
Harlan Grove
Guest
Posts: n/a
 
      9th Dec 2005
"duane" <(E-Mail Removed)> wrote...
>your row of data starting in cell a1
>
>your numbers in cells a7 and a8 (and down if you like)
>
>this in cell a2 and copy to b2, c2 etc
>
>=SUM(OFFSET($A$1,0,SUM($A$6:INDIRECT("A"&COLUMN()+5)),1,1)
>:OFFSET($A$1,0,SUM($A$6:INDIRECT("A"&COLUMN()+6))-1,1,1))

....

OFFSET():OFFSET() is unnecessary. If both OFFSET calls resolve to single
cells, then OFFSET(a,b,c):OFFSET(x,y,z) is always equivalent to

OFFSET(a,b,c,MIN(ROW(x))-MIN(ROW(a))+y-b+1,
MIN(COLUMN(x))-MIN(COLUMN(a))+z-c+1)

When a = x, it reduces further to

OFFSET(a,b,c,y-b+1,z-c+1)

So your formula could be reduced to

A2:
=SUM(OFFSET($A$1,0,SUM(OFFSET($A$6,0,0,COLUMNS($A2:A2),1)),1,
OFFSET($A$6,COLUMNS($A2:A2),0)))

But even better would be using only nonvolatile functions.

A2:
=SUM(INDEX($1:$1,SUM(1,$A$6:INDEX($A$6:$A$65536,COLUMNS($A2:A2))))
:INDEX($1:$1,SUM($A$6:INDEX($A$6:$A$65536,COLUMNS($A2:B2)))))


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Offset/Countif question =?Utf-8?B?SmVubnkgQi4=?= Microsoft Excel Misc 4 5th Apr 2007 08:43 PM
2 conditions Countif with offset =?Utf-8?B?U3RAY3k=?= Microsoft Excel Programming 9 27th Jan 2007 12:25 AM
Countif from an offset column stokefolk@gmail.com Microsoft Excel Worksheet Functions 5 15th Sep 2006 01:50 AM
CountIF and OFFSET Steve Jackson Microsoft Excel Worksheet Functions 4 26th Oct 2004 10:05 PM
Re: offset countif Vasant Nanavati Microsoft Excel Worksheet Functions 1 6th Aug 2003 04:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:05 PM.