View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Find missing numbers in a list

You need 3 columns.

Column A you list of numbers with numbers missing
Column B a full list of the numbers i.e. 1 to 999 with no gaps

In C1 enter the formuls

=COUNTIF(A$1:A$5,B$1:B$999) and drag down to the length of column B

Numbers with a 0 against them are missing from List A.


I like that solution. One suggestion to maybe make it easier to spot the
missing numbers. If you use this variation on your formula...

=IF(COUNTIF(A$1:A$5,B$1:B$999)=0,"X","")

the missing numbers will have an "X" next to them (the non-missing numbers
will have a blank next to them).

Rick