Macro to find missing numbers?

silentwolf

Well-known Member
Joined
May 14, 2008
Messages
1,216
Office Version
  1. 2016
Hi guys,
was wondering if someone knows a macro to find missing numbers in a column?
I in column A numbers from 1001 to 1400 and there are some missing for example 1001 next is 1005 then 1105 and the next number is 1108.
So that I dont need to look through all numbers and compare them I would like to find the numbers what are missing.
And perhaps either show them to me in a message box or copy them in Column D.
I am sure it is possible but I just don t know how.
Would be very kind of you if you could help me with this question.

Many thanks!
Albert
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Sorry guys I thought of a different way of searching for my problem and found this solution.
Code:
Say you have the numbers 2, 4 and 6 in the range A1:A3.  You want to  know
which numbers from 1 to 10 are missing.

-Enter the numbers 1 to 10 (use the Fill handle) in C1:C10.
-Enter the formula:

=IF(ISERROR(MATCH(C1,$A$1:$A$3,FALSE)),"x","")

in D1 and copy it down to D10.  Now every "x" represents a missing  number.
Sorry that I was not finding it before and did asked.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,158
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top