Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Find Missing Numbers in a List

Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can I
have the missing 4 and 6 and put it in a new column? I have a list of 30,000
numbers so it's very tedious. Please help, thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Find Missing Numbers in a List

Millie
I'll try to help you with this. Are your numbers actual numbers or do
they contain any letters? Is your data sorted by these numbers? Do any of
the numbers start with zeros (one or more zeros)? HTH Otto
"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Find Missing Numbers in a List

Hi!

This method will work but it's slow. Slow = may take a minute or two to
calculate 30,000 possibilities. But hey, slow is faster and better than
tedious! After it's done you should convert the formulas to constants by
doing a Copy/Paste SpecialValues.

Assume your number sequence is 1 to 30,000 and is in the range A1:A5000.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=SMALL(IF(ISNA(MATCH(ROW($1:$30000),A$1:A$5000,0)) ,ROW($1:$30000),ROW(A1))

Copy down until you get #NUM! errors meaning all the missing values have
been returned.

Biff

"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Find Missing Numbers in a List

Here's a macro by JMB. It's significantly faster on large sequences like
yours.

Sub FindMissing()
Dim lngUpper As Long
Dim lngLower As Long
Dim i As Long
Dim rngData As Range
Dim lngcount As Long

Set rngData = Range("C1:C1000") 'change as needed
lngLower = 1 'start of sequence change as needed
lngUpper = 5000 'end of sequence change as needed
lngcount = 1

For i = lngLower To lngUpper
If Not IsNumeric(Application.Match(i, _
rngData, 0)) Then
Range("D" & lngcount).Value = i 'sets output to column D
lngcount = lngcount + 1
End If
Next i

End Sub

Biff

"Biff" wrote in message
...
Hi!

This method will work but it's slow. Slow = may take a minute or two to
calculate 30,000 possibilities. But hey, slow is faster and better than
tedious! After it's done you should convert the formulas to constants by
doing a Copy/Paste SpecialValues.

Assume your number sequence is 1 to 30,000 and is in the range A1:A5000.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not
just ENTER):

=SMALL(IF(ISNA(MATCH(ROW($1:$30000),A$1:A$5000,0)) ,ROW($1:$30000),ROW(A1))

Copy down until you get #NUM! errors meaning all the missing values have
been returned.

Biff

"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can
I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Find Missing Numbers in a List

Dear Biff, I was looking for a solution to the exact same problem "finding
missing numbers". But, I am not this smart. I don't know how to input this
macro??? Can you help me. Thanks so much. This would solve a two year
dilemma for me.

"Biff" wrote:

Here's a macro by JMB. It's significantly faster on large sequences like
yours.

Sub FindMissing()
Dim lngUpper As Long
Dim lngLower As Long
Dim i As Long
Dim rngData As Range
Dim lngcount As Long

Set rngData = Range("C1:C1000") 'change as needed
lngLower = 1 'start of sequence change as needed
lngUpper = 5000 'end of sequence change as needed
lngcount = 1

For i = lngLower To lngUpper
If Not IsNumeric(Application.Match(i, _
rngData, 0)) Then
Range("D" & lngcount).Value = i 'sets output to column D
lngcount = lngcount + 1
End If
Next i

End Sub

Biff

"Biff" wrote in message
...
Hi!

This method will work but it's slow. Slow = may take a minute or two to
calculate 30,000 possibilities. But hey, slow is faster and better than
tedious! After it's done you should convert the formulas to constants by
doing a Copy/Paste SpecialValues.

Assume your number sequence is 1 to 30,000 and is in the range A1:A5000.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not
just ENTER):

=SMALL(IF(ISNA(MATCH(ROW($1:$30000),A$1:A$5000,0)) ,ROW($1:$30000),ROW(A1))

Copy down until you get #NUM! errors meaning all the missing values have
been returned.

Biff

"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can
I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Find Missing Numbers in a List

Ok, i figured out how to enter it, but when I try to run macro it's giving me
an error message "end if with out block it"??? can you help?

"Biff" wrote:

Here's a macro by JMB. It's significantly faster on large sequences like
yours.

Sub FindMissing()
Dim lngUpper As Long
Dim lngLower As Long
Dim i As Long
Dim rngData As Range
Dim lngcount As Long

Set rngData = Range("C1:C1000") 'change as needed
lngLower = 1 'start of sequence change as needed
lngUpper = 5000 'end of sequence change as needed
lngcount = 1

For i = lngLower To lngUpper
If Not IsNumeric(Application.Match(i, _
rngData, 0)) Then
Range("D" & lngcount).Value = i 'sets output to column D
lngcount = lngcount + 1
End If
Next i

End Sub

Biff

"Biff" wrote in message
...
Hi!

This method will work but it's slow. Slow = may take a minute or two to
calculate 30,000 possibilities. But hey, slow is faster and better than
tedious! After it's done you should convert the formulas to constants by
doing a Copy/Paste SpecialValues.

Assume your number sequence is 1 to 30,000 and is in the range A1:A5000.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not
just ENTER):

=SMALL(IF(ISNA(MATCH(ROW($1:$30000),A$1:A$5000,0)) ,ROW($1:$30000),ROW(A1))

Copy down until you get #NUM! errors meaning all the missing values have
been returned.

Biff

"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8- can
I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Find Missing Numbers in a List

The line that starts with "If Not Isnumeric....." should end with "Then".
If it doesn't, then you have run into the line wrap that happens with these
messages. Make sure all of that is on one line. HTH Otto
"jpfrmnm" wrote in message
...
Ok, i figured out how to enter it, but when I try to run macro it's giving
me
an error message "end if with out block it"??? can you help?

"Biff" wrote:

Here's a macro by JMB. It's significantly faster on large sequences like
yours.

Sub FindMissing()
Dim lngUpper As Long
Dim lngLower As Long
Dim i As Long
Dim rngData As Range
Dim lngcount As Long

Set rngData = Range("C1:C1000") 'change as needed
lngLower = 1 'start of sequence change as needed
lngUpper = 5000 'end of sequence change as needed
lngcount = 1

For i = lngLower To lngUpper
If Not IsNumeric(Application.Match(i, _
rngData, 0)) Then
Range("D" & lngcount).Value = i 'sets output to column D
lngcount = lngcount + 1
End If
Next i

End Sub

Biff

"Biff" wrote in message
...
Hi!

This method will work but it's slow. Slow = may take a minute or two to
calculate 30,000 possibilities. But hey, slow is faster and better than
tedious! After it's done you should convert the formulas to constants
by
doing a Copy/Paste SpecialValues.

Assume your number sequence is 1 to 30,000 and is in the range
A1:A5000.

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not
just ENTER):

=SMALL(IF(ISNA(MATCH(ROW($1:$30000),A$1:A$5000,0)) ,ROW($1:$30000),ROW(A1))

Copy down until you get #NUM! errors meaning all the missing values
have
been returned.

Biff

"millie6169" wrote in message
...
Was wondering if its possible to find the missing numbers in a list
and
export to a new column. For example if the list is 1, 2, 3, 5, 7, 8-
can
I
have the missing 4 and 6 and put it in a new column? I have a list of
30,000
numbers so it's very tedious. Please help, thanks







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
auto updating list Larry Excel Worksheet Functions 8 July 27th 06 01:59 PM
find sum in list of of numbers Ron Coderre Excel Discussion (Misc queries) 10 January 5th 06 08:26 AM
find sum in list of of numbers Jim Thomlinson Excel Discussion (Misc queries) 3 January 4th 06 09:58 PM
find sum in list of of numbers Jim Thomlinson Excel Discussion (Misc queries) 5 January 4th 06 07:07 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM


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