PC Review


Reply
Thread Tools Rate Thread

Data Selection and Averaging

 
 
tbraddy
Guest
Posts: n/a
 
      6th Nov 2007
I have some data that is listed in the lower portion of a worksheet
(rows 201+) and want to grab it based on user input into a cell. I
also want to calculate an average of that data.

ie
Value
Start 30 lookup value for 30
End 60 lookup value for 60
Average calculate average for 30-60

I could just do it =B230 =B260 =average(B230:B260), but having it
update would be much easier
I can do a lookup on the Start and End data, but the average is not
as
easy.
Is there a way to say =B(200 + value of Start), =B(200+End),
=average(B(200+start):B200+end))?

Thanks Todd

 
Reply With Quote
 
 
 
 
Mike Fogleman
Guest
Posts: n/a
 
      6th Nov 2007
With start# in B1, end# in B2, and AVG in B3:
Adjust the ranges to suit your placement

Sub MyAvg()
Dim StartRng As Range, EndRng As Range
Dim MyStr As String
MyStr = "B" & Range("B1").Value + 200
Set StartRng = Range(MyStr)
MyStr = "B" & Range("B2").Value + 200
Set EndRng = Range(MyStr)
Range("B3").Value = WorksheetFunction.Average(StartRng, EndRng)
End Sub


Mike F
"tbraddy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have some data that is listed in the lower portion of a worksheet
> (rows 201+) and want to grab it based on user input into a cell. I
> also want to calculate an average of that data.
>
> ie
> Value
> Start 30 lookup value for 30
> End 60 lookup value for 60
> Average calculate average for 30-60
>
> I could just do it =B230 =B260 =average(B230:B260), but having it
> update would be much easier
> I can do a lookup on the Start and End data, but the average is not
> as
> easy.
> Is there a way to say =B(200 + value of Start), =B(200+End),
> =average(B(200+start):B200+end))?
>
> Thanks Todd
>



 
Reply With Quote
 
tbraddy
Guest
Posts: n/a
 
      13th Nov 2007
Mike,

I don't know if that will work with my data and what I'm trying to
accomplish.
Here is what the data looks like:

Col 1 Col 2 .... Col
N
Start1 =Col1(start1.value+200) =Col2(start1.value+200)
End 1 =Col1(end1.value+200) =Col2(end1.value+200)
Average 1 =average(start1:end1) =average(start2:end2)

Start M
End M
Average M

It would be really helpful in this if I could define a function and
not have to run a macro with a button or anything.

Todd

 
Reply With Quote
 
chip.gorman@gmail.com
Guest
Posts: n/a
 
      13th Nov 2007
Well, you did post in the VBA newsgroup... :-)

I think what you want is an OFFSET something like:

=AVERAGE(OFFSET($B$1,Start1+200,0,End1-Start1+1,1))




On Nov 12, 9:59 pm, tbraddy <TBra...@gmail.com> wrote:
> Mike,
>
> I don't know if that will work with my data and what I'm trying to
> accomplish.
> Here is what the data looks like:
>
> Col 1 Col 2 .... Col
> N
> Start1 =Col1(start1.value+200) =Col2(start1.value+200)
> End 1 =Col1(end1.value+200) =Col2(end1.value+200)
> Average 1 =average(start1:end1) =average(start2:end2)
>
> Start M
> End M
> Average M
>
> It would be really helpful in this if I could define a function and
> not have to run a macro with a button or anything.
>
> Todd



 
Reply With Quote
 
tbraddy
Guest
Posts: n/a
 
      13th Nov 2007
Thanks,

That seems to work except that using $B$1 and using the +200 finds
201+Start1.

Thanks for the help.

Todd


 
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
averaging data new kid Microsoft Access 2 27th Apr 2009 02:26 AM
Averaging data alboika@gmail.com Microsoft Excel Discussion 3 11th Jul 2008 08:08 PM
Data Selection and Averaging tbraddy Microsoft Excel Worksheet Functions 0 6th Nov 2007 04:25 PM
averaging data =?Utf-8?B?SmFtZXM=?= Microsoft Excel Misc 10 11th Dec 2006 03:12 AM
Averaging data Capt Bill Microsoft Excel Worksheet Functions 2 27th Mar 2006 10:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:23 AM.