Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What does Average(R[-29466]C:R[-29185]C mean?


Hi,
I am new here and was wondering what Average(R[-29466]C:R[-29185]C
means. I am averaging column but when I look at the columns I am
averaging it is Column E4 to E285. So I am trying to figure out what
the -29466 and -29185 pertains to. It looks like a range to me.
Also, I was wondering why when I open the file, it puts the
Average on Row 29470 and not Row 286. On the output, I don't even see
Row 286..it goes straight from 285 to 29470. The rows in between those
ranges are not hidden. I am so confused.

Thank you in advance for your help.

'Average Calculation
ActiveCell.FormulaR1C1 = "Average"
Range("E29470").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "=AVERAGE(R[-29466]C:R[-29185]C)"
Range("E29470").Select
Selection.Copy
Range("F29470:H29470").Select
ActiveSheet.Paste
Range("C29470").Select
Application.CutCopyMode = False


+-------------------------------------------------------------------+
|Filename: excel error.jpg |
|Download: http://www.excelforum.com/attachment.php?postid=4457 |
+-------------------------------------------------------------------+

--
txexcel
------------------------------------------------------------------------
txexcel's Profile: http://www.excelforum.com/member.php...o&userid=32443
View this thread: http://www.excelforum.com/showthread...hreadid=522258

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What does Average(R[-29466]C:R[-29185]C mean?


use average(r4c:r285c) instead, this hardcodes the range similar to
$E$4:$E$285.

txexcel Wrote:
Hi,
I am new here and was wondering what Average(R[-29466]C:R[-29185]C
means. I am averaging column but when I look at the columns I am
averaging it is Column E4 to E285. So I am trying to figure out what
the -29466 and -29185 pertains to. It looks like a range to me.
Also, I was wondering why when I open the file, it puts the
Average on Row 29470 and not Row 286. On the output, I don't even see
Row 286..it goes straight from 285 to 29470. The rows in between those
ranges are not hidden. I am so confused.

Thank you in advance for your help.

'Average Calculation
ActiveCell.FormulaR1C1 = "Average"
Range("E29470").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "=AVERAGE(R[-29466]C:R[-29185]C)"
Range("E29470").Select
Selection.Copy
Range("F29470:H29470").Select
ActiveSheet.Paste
Range("C29470").Select
Application.CutCopyMode = False



--
kwiklearner
------------------------------------------------------------------------
kwiklearner's Profile: http://www.excelforum.com/member.php...o&userid=31909
View this thread: http://www.excelforum.com/showthread...hreadid=522258

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default What does Average(R[-29466]C:R[-29185]C mean?

Just to add. the R[-29466]C means to go a cell 29466 rows above the row
containing the formula. It is written in R1C1 notation and the brackets mean
the reference is relative to the cell with the formula.

Based on your code, the formula is being entered in 29470 and the
29470-29466 = 4

If you want the formula at the end of the column, starting in row 4 do

set rng = Range("E4").end(xldown).Offset(1,0)
rng.FormulaR1C1 = "=Average(R4C:R[-1]C)"

this says to go to the next call after the last used cell in column E,
starting in E4, then enter a formula that averages from the absolute\relative
mixed address of R4, same column to the relative\relative address of one row
up and same column.

So I would suspect what you want to perform the whole action (averages in
columns E to H):

Sub AddAverages()
Dim rng as Range
set rng = Range("E4").end(xldown).Offset(1,0)
rng.offset(0,-1).Value = "Average"
rng.Resize(1,4).FormulaR1C1 = "=Average(R4C:R[-1]C)"
End sub

--
Regards,
Tom Ogilvy





"txexcel" wrote:


Hi,
I am new here and was wondering what Average(R[-29466]C:R[-29185]C
means. I am averaging column but when I look at the columns I am
averaging it is Column E4 to E285. So I am trying to figure out what
the -29466 and -29185 pertains to. It looks like a range to me.
Also, I was wondering why when I open the file, it puts the
Average on Row 29470 and not Row 286. On the output, I don't even see
Row 286..it goes straight from 285 to 29470. The rows in between those
ranges are not hidden. I am so confused.

Thank you in advance for your help.

'Average Calculation
ActiveCell.FormulaR1C1 = "Average"
Range("E29470").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "=AVERAGE(R[-29466]C:R[-29185]C)"
Range("E29470").Select
Selection.Copy
Range("F29470:H29470").Select
ActiveSheet.Paste
Range("C29470").Select
Application.CutCopyMode = False


+-------------------------------------------------------------------+
|Filename: excel error.jpg |
|Download: http://www.excelforum.com/attachment.php?postid=4457 |
+-------------------------------------------------------------------+

--
txexcel
------------------------------------------------------------------------
txexcel's Profile: http://www.excelforum.com/member.php...o&userid=32443
View this thread: http://www.excelforum.com/showthread...hreadid=522258


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
A formula to AVERAGE IF but only average a set number of values [email protected] Excel Worksheet Functions 2 January 31st 08 08:28 PM
Find monthly average but have average automatically configured kimbafred Excel Discussion (Misc queries) 2 August 8th 07 12:28 AM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Weighed Average of a weiged average when there are blanks krl - ExcelForums.com Excel Discussion (Misc queries) 1 July 6th 05 07:37 PM
how does one convert text to a formula "average(A:A)" to =average( phshirk Excel Worksheet Functions 4 April 14th 05 01:20 AM


All times are GMT +1. The time now is 01:34 PM.

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

About Us

"It's about Microsoft Excel"