LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 806
Default Identify number of numeric sets in a long string of numbers

Hello,

If your input is in cells A1:A10 then select cells D1:F3, for example,
and array-enter (enter with CTRL + SHIFT + ENTER, not just ENTER):
=idsets(A1:A10)

The UDF idsets:
Function idsets(r As Range) As Variant
Dim v, vR(1 To 100, 1 To 3)
Dim i As Long, m As Long, b As Boolean
Dim lmin As Long, lmax As Long
m = 2147483647
b = False
For Each v In r
If v < m Then
'New set
If b Then
i = i + 1
vR(i, 1) = "Set " & i
vR(i, 2) = lmin
vR(i, 3) = lmax
Else
b = True
End If
m = v
lmin = m
lmax = m
Else
If v lmax Then lmax = v
If v < lmin Then lmin = v
End If
m = v
Next v
i = i + 1
vR(i, 1) = "Set " & i
vR(i, 2) = lmin
vR(i, 3) = lmax
idsets = vR
End Function

Press ALT + F11, insert a new module and copy function text into new
module, finally switch back to worksheet and press F9.

Regards,
Bernd


 
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
formula to add a number to a long string ** MMangen Excel Worksheet Functions 5 December 1st 09 09:01 AM
parsing a string for 3 sets of numbers Micah Excel Programming 6 May 31st 06 07:03 PM
Extract sub-string of number from field of long series of numbers ExcelExtrator Excel Worksheet Functions 3 December 27th 05 10:56 PM
Extract Numbers from Alpha-Numeric String MrBill Excel Worksheet Functions 1 November 2nd 05 05:44 PM
search to identify duplicate enties in long columns of numbers Norman H Excel Discussion (Misc queries) 5 May 19th 05 07:42 PM


All times are GMT +1. The time now is 06:16 PM.

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

About Us

"It's about Microsoft Excel"