Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default take every other cell and put in new colume. No blank cells

take average of two sequencial cells in column. Put results in new column.
Move to next two cells. Do the same. Etc. The new column should have half
as many cells as the first column.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default take every other cell and put in new colume. No blank cells

Here's how I do it (I'm lazy):

Let's say your values are A1:A10.

1. In B1 put =AVERAGE(A1,A2).
2. Highlight B1:B2
3. Hover over the lower right corner of B2 so your pointer turns into
a plus-sign
4. Click and drag down to the end of your data.
5. PasteSpecialValues to get the actual averages.
(optional) 6. Paste into a new workbook, then run this procedure to
remove the blank rows.

Sub Del_Empty_Rows()

Dim rng As Excel.Range
Dim A As Long
Application.ScreenUpdating = False

If Selection.Rows.count 1 Then
Set rng = Selection
Else
Set rng = ActiveSheet.UsedRange.Rows
End If

With WorksheetFunction
For A = rng.Rows.count To 1 Step -1
If .CountA(rng.Rows(A).EntireRow) = 0 Then
rng.Rows(A).EntireRow.Delete
Next A
End With

Set rng = Nothing
Application.ScreenUpdating = True

End Sub


You can record yourself doing this if you need a macro.


HTH,
JP

On Jan 11, 2:57*pm, tony hill <tony
wrote:
take average of two sequencial cells in column. *Put results in new column. *
Move to next two cells. *Do the same. *Etc. *The new column should have half
as many cells as the first column.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default take every other cell and put in new colume. No blank cells

JP

After paste special, you could also select the column and F5SpecialBlanksOK

EditDeleteEntire Rows.


Gord Dibben MS Excel MVP

On Fri, 11 Jan 2008 12:31:39 -0800 (PST), JP wrote:

Here's how I do it (I'm lazy):

Let's say your values are A1:A10.

1. In B1 put =AVERAGE(A1,A2).
2. Highlight B1:B2
3. Hover over the lower right corner of B2 so your pointer turns into
a plus-sign
4. Click and drag down to the end of your data.
5. PasteSpecialValues to get the actual averages.
(optional) 6. Paste into a new workbook, then run this procedure to
remove the blank rows.

Sub Del_Empty_Rows()

Dim rng As Excel.Range
Dim A As Long
Application.ScreenUpdating = False

If Selection.Rows.count 1 Then
Set rng = Selection
Else
Set rng = ActiveSheet.UsedRange.Rows
End If

With WorksheetFunction
For A = rng.Rows.count To 1 Step -1
If .CountA(rng.Rows(A).EntireRow) = 0 Then
rng.Rows(A).EntireRow.Delete
Next A
End With

Set rng = Nothing
Application.ScreenUpdating = True

End Sub


You can record yourself doing this if you need a macro.


HTH,
JP

On Jan 11, 2:57*pm, tony hill <tony
wrote:
take average of two sequencial cells in column. *Put results in new column. *
Move to next two cells. *Do the same. *Etc. *The new column should have half
as many cells as the first column.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default take every other cell and put in new colume. No blank cells

Good point, thanks Gord. I have the Del_Empty_Rows() macro on a
toolbar so it's just a button click away, but it's good to remember
the non-macro version.

I also read your post about copy and pasting cells as links, same
response :)

--JP


On Jan 11, 4:43*pm, Gord Dibben <gorddibbATshawDOTca wrote:
JP

After paste special, you could also select the column and F5SpecialBlanksOK

EditDeleteEntire Rows.

Gord Dibben *MS Excel MVP


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
how do I validate an entire colume instead of a cell de_diver Excel Worksheet Functions 1 March 20th 09 12:12 AM
Change from row to colume n colume to row [email protected] Excel Programming 2 October 4th 07 03:35 PM
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
Copy to first Blank cell in Colum C Non blank cells still exist be Ulrik loves horses Excel Programming 2 October 8th 06 07:35 PM
How can I look up max of one colume and display the colume to the. Brian Cornejo Excel Worksheet Functions 2 February 21st 05 05:47 AM


All times are GMT +1. The time now is 02:03 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"