Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a spreadsheet with about 50 rows that gradually will be filled up with
numbers. How can I make formula that will count and ad up only the 12 last rows at any given time? The position of the last 12 rows will here obviously change over time, since more numbers will be added frequently. Thanks very much for any help. -- Lars -- Lars |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Lars
one way, assuming no header row: =IF(ISERROR(OFFSET(A1,COUNTA(A:A)-12,)),"not enough rows",SUM(OFFSET(A1,COUNTA(A:A)-12,):OFFSET(A1,COUNTA(A:A),))) This also assumes the data is in column A Regards Trevor "Lars" wrote in message ... I have a spreadsheet with about 50 rows that gradually will be filled up with numbers. How can I make formula that will count and ad up only the 12 last rows at any given time? The position of the last 12 rows will here obviously change over time, since more numbers will be added frequently. Thanks very much for any help. -- Lars -- Lars |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Trevor is 'da man!!
I tried formula and I ain't even close. Did a code but I think it lacks a bunch if you have 50 columns, how clunky if you have to adapt this to 50 columns. Simple on one column... Some MVP's can loop this through 50 columns nicely but I can't. On the worksheet you enter =Sum(Data) Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 Then Exit Sub Dim i As Integer i = Range("A1").End(xlDown).Row - 1 If Target.Row < 12 Then Range("A1").End(xlDown). _ Offset(-i, 0). _ Resize(i + 1, 1). _ Name = "Data" ElseIf Target.Row 12 Then Range("A100").End(xlUp). _ Offset(-11, 0). _ Resize(12, 1). _ Name = "Data" End If End Sub HTH Regards, Howard "Lars" wrote in message ... I have a spreadsheet with about 50 rows that gradually will be filled up with numbers. How can I make formula that will count and ad up only the 12 last rows at any given time? The position of the last 12 rows will here obviously change over time, since more numbers will be added frequently. Thanks very much for any help. -- Lars -- Lars |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy rows of data (eliminating blank rows) from fixed layout | Excel Discussion (Misc queries) | |||
Get number of rows that data takes up, including blank rows | Excel Worksheet Functions | |||
Excel 2003 -Rows hidden. Scrolling unhides rows ! How do I stop th | Excel Discussion (Misc queries) | |||
Print few rows with many colums so that rows wrap on printed pages | Excel Discussion (Misc queries) | |||
Pivot Tables: How do I show ALL field rows, including empty rows?? | Excel Worksheet Functions |