Just Me
Just Me

Reputation: 1063

Ms Excel / Google spreadsheets : Fiind which numbers are missing from the column and show me the exact those numbers

I have this google excel spreadsheet.

enter image description here

My request. I want to Find which number is missing from the A column (from 5001 to 5016) and show the exact those number or numbers missing. I put this formula on C$1 cell. But is does not show me any missing numbers, even though the numbers 5002 and 5014 are missing.

=IFERROR(AGGREGATE(15,6,ROW(INDEX(A:A,MIN(A$1:A$20)):INDEX(A:A,MAX(A$1:A$20)))/(COUNTIF(A$1:A$20,ROW(INDEX(A:A,MIN(A$1:A$20)):INDEX(A:A,MAX(A$1:A$20))))=0),ROW()),"")

And, maybe, to show me the exact numbers that are missing. I don't know how to do this.

Upvotes: 0

Views: 1261

Answers (2)

Just Me
Just Me

Reputation: 1063

works only in Ms Excel

=IFERROR(AGGREGATE(15,6,ROW(INDIRECT("5000:5015"))/(ISERROR(MATCH(ROW(INDIRECT("5000:5015")),A:A,0))),ROW(1:1)),"")

Upvotes: 0

Tom Sharpe
Tom Sharpe

Reputation: 34370

This formula works in the Microsoft 365 version of Excel and in Google Sheets:

=filter(sequence(max(A:A)-min(A:A)+1,1,min(A:A)),countif(A:A,sequence(max(A:A)-min(A:A)+1,1,min(A:A)))=0)

You could modify it to avoid full column references in Excel which could cause it to slow down, and also use the Let function to avoid repeating the Sequence function call. However max, min and countif do handle full-column references efficiently so probably not necessary.

enter image description here

Upvotes: 2

Related Questions