Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default equation / function question

I have a column of unique numbers in ascending order:

A
B
C
D
E
F
etc....

I would like Excel to create another column consisting of all the
absolute differences of those numbers:

IE

A-B
A-C
A-D
A-E
A-F
B-C
B-D
B-E
B-F
C-D
C-E
C-F
D-E
D-F
E-F

I don't think this should be too hard, but I don't seem to be smart
enough to figure the syntax of the programming....

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 329
Default equation / function question

Hi dhowell,

Try the following macro:

Sub AbsDiffs()
Dim i As Long
Dim j As Long
Dim k As Long
Dim l As Long
k = 1
With ActiveSheet
l = .Range("A65536").End(xlUp).Row
For i = 1 To l - 1
For j = i + 1 To l
.Cells(k, 3).Value = Abs(.Cells(i, 1).Value - .Cells(j, 1).Value)
k = k + 1
Next
Next
End With
End Sub

It puts the absolute differences for values in column A into column C.

Cheers

--
macropod
[MVP - Microsoft Word]


wrote in message
oups.com...
| I have a column of unique numbers in ascending order:
|
| A
| B
| C
| D
| E
| F
| etc....
|
| I would like Excel to create another column consisting of all the
| absolute differences of those numbers:
|
| IE
|
| A-B
| A-C
| A-D
| A-E
| A-F
| B-C
| B-D
| B-E
| B-F
| C-D
| C-E
| C-F
| D-E
| D-F
| E-F
|
| I don't think this should be too hard, but I don't seem to be smart
| enough to figure the syntax of the programming....
|


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
Index Match Function Question excelnewbie44 Excel Discussion (Misc queries) 4 October 4th 06 10:57 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
numerical integration integreat Excel Discussion (Misc queries) 4 May 12th 06 02:40 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Dynamic Function Reference Question excel newbie Excel Discussion (Misc queries) 1 April 20th 05 08:09 PM


All times are GMT +1. The time now is 11:40 AM.

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"