Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Average of last column
pleaseHello all. I've been reading these threads to figure out how to do
what I want but can't quite get there. Here's what I'm trying to do: I have a worksheet that gets written from an app. After the app stops I want to open the worksheet and compute the average of the last column (not including the header row) and place the result one cell below the cell in the last row, last col no matter how many rows and cols are present. I think I need a macro which calls a formula which calls a function. Could someone please provide a solution? grok |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Average of last column
One way
Sub averagelastcolumn() lc = Cells(1, Columns.Count).End(xlToLeft).Column lr = Cells(Rows.Count, lc).End(xlUp).Row Cells(lr + 1, lc) = Application.Average(Range(Cells(2, lc), Cells(lr, lc))) End Sub -- Don Guillett SalesAid Software "grok" wrote in message ... pleaseHello all. I've been reading these threads to figure out how to do what I want but can't quite get there. Here's what I'm trying to do: I have a worksheet that gets written from an app. After the app stops I want to open the worksheet and compute the average of the last column (not including the header row) and place the result one cell below the cell in the last row, last col no matter how many rows and cols are present. I think I need a macro which calls a formula which calls a function. Could someone please provide a solution? grok |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Average of last column
Works like a charm! Thanks.
"Don Guillett" wrote: One way Sub averagelastcolumn() lc = Cells(1, Columns.Count).End(xlToLeft).Column lr = Cells(Rows.Count, lc).End(xlUp).Row Cells(lr + 1, lc) = Application.Average(Range(Cells(2, lc), Cells(lr, lc))) End Sub -- Don Guillett SalesAid Software "grok" wrote in message ... pleaseHello all. I've been reading these threads to figure out how to do what I want but can't quite get there. Here's what I'm trying to do: I have a worksheet that gets written from an app. After the app stops I want to open the worksheet and compute the average of the last column (not including the header row) and place the result one cell below the cell in the last row, last col no matter how many rows and cols are present. I think I need a macro which calls a formula which calls a function. Could someone please provide a solution? grok |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
calculate average in a column based on criteria in another column | Excel Discussion (Misc queries) | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
Positioning Numeric Values Resulting from 6 Column Array Formula | Excel Worksheet Functions | |||
Average the Last Five Cells in a Column | Excel Worksheet Functions | |||
I need to find the Average from Column A - but Reference Column B | Excel Worksheet Functions |