Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Identifying missing numerical values in a series

In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Identifying missing numerical values in a series

Try the below array formula. This will be a bit slow...so try with a smaller
range for testing as below..Please note that this is an array formula. You
create array formulas in the same way that you create other formulas, except
you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula
Bar' you can notice the curly braces at both ends like "{=<formula}"

=SMALL(IF(COUNTIF(A1:A800,ROW(101:907))=0,ROW(101: 907)),ROW(A1))

--
Jacob


"SiH23" wrote:

In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Identifying missing numerical values in a series

With your series try the below formula in cell C1 and copy down as required...

=SMALL(IF(COUNTIF(A1:A8078,ROW(1001:9078))=0,ROW(1 001:9078)),ROW(A1))

--
Jacob


"Jacob Skaria" wrote:

Try the below array formula. This will be a bit slow...so try with a smaller
range for testing as below..Please note that this is an array formula. You
create array formulas in the same way that you create other formulas, except
you press CTRL+SHIFT+ENTER to enter the formula. If successful in 'Formula
Bar' you can notice the curly braces at both ends like "{=<formula}"

=SMALL(IF(COUNTIF(A1:A800,ROW(101:907))=0,ROW(101: 907)),ROW(A1))

--
Jacob


"SiH23" wrote:

In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Identifying missing numerical values in a series

HI

This macro will do the job:

Sub FindMissing()
Dim FirstRow As Long
Dim LastRow As Long
Dim Counter As Long

LastRow = Range("A" & Rows.Count).End(xlUp).Row
FirstRow = 1

Application.ScreenUpdating = False
For r = FirstRow To LastRow - 1
If Cells(r, "A").Value + 1 < Cells(r + 1, "A").Value Then
NextVal = Cells(r, "A").Value + 1
Do
Counter = Counter + 1
Cells(Counter, "C") = NextVal
NextVal = NextVal + 1
Debug.Print Cells(r + 1, "A").Value & ": " & NextVal
Loop Until Cells(r + 1, "A").Value = NextVal
End If
Next
Application.ScreenUpdating = True
End Sub

If you have not worked with macros before, hit ALT+F11 to open the VBA
editor Insert Module Insert the code above in the code sheet and run
it.

Hopes this helps.
....
Per

"SiH23" skrev i meddelelsen
...
In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the
missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need
to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Identifying missing numerical values in a series

Select the entire partial list in column a and give it a name.
([Insert] menu, selecting [Name] and then [Define])
For this example I chose the name 'par' for partial.
Enter '1001' in cell C1.
Enter the following formula in cell C2:
=IF(ISERROR(MATCH(C$1+ROW()-1,par,0)),C$1+ROW()-1,"")
fill down for 8070 rows
this will result in a list in column C that contains the numbers that are
not listed in column a, but there will be empty spaces in between the numbers.
to eliminate the spaces, select the entire column C
copy the entire column
with column C still selected, select [Paste Special] from the [Edit] menu
and select [Values] to replace the formulas in C with values
with C still selected, sort the column to move the cells with values to the
top of the stack.
Not pretty, but it works.



"SiH23" wrote:

In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default Identifying missing numerical values in a series

Hi,

Many thanks for all your help. The array formula seems to identify the
number of missing numbers, but not the actual numbers themselves. Is there
anyway this can be done?

"SiH23" wrote:

In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Identifying missing numerical values in a series

Try this array formula**.

Note that this may be "slow" to calculate.

Assume your data is in the range A2:A5000

Array entered** in C2:

=SMALL(IF(ISNA(MATCH(ROW($1001:$9078),A$2:A$5000,0 )),ROW($1001:$9078)),ROWS(C$2:C2))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Copy down until you start getting #NUM! errors meaning all missing numbers
have been returned.

Also note, this formula is vulnerable to row insertions in certain
locations. If you know for certain that you will never need to insert new
rows then no problem. However, if you might insert new rows then try this
version (still array entered):

=SMALL(IF(ISNA(MATCH(ROW(INDEX(A:A,1001):INDEX(A:A ,9078)),A$2:A$5000,0)),ROW(INDEX(A:A,1001):INDEX(A :A,9078))),ROWS(C$2:C2))

--
Biff
Microsoft Excel MVP


"SiH23" wrote in message
...
In column A I have a series of numbers running from 1001 to 9078. These
numbers run in numerical order, but there are known missing values. For
example, the numbers may run 1000, 1001, 1005. In this instance the
missing
numbers are 1002, 1003 and 1004. It is these missing numbers that I need
to
identify from the column of numbers running from 1001 to 9078. Could these
missing numbers be placed in column C.

Any help would be greatly appreciated.



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
Filling a reference series in alphabetical order, not numerical maub Excel Worksheet Functions 1 October 2nd 09 10:17 PM
Identifying when all values in a range are the same. MichaelZ Excel Discussion (Misc queries) 7 December 11th 08 08:42 PM
identifying colours of existing elements / series Boris Charts and Charting in Excel 0 August 27th 08 01:45 PM
Adding numerical values based on multiple values in another column Kazmaniac Excel Worksheet Functions 6 April 4th 07 08:53 PM
Find missing values in a series petermcwerner Excel Worksheet Functions 10 January 4th 07 08:35 AM


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