You can sort the column where the invoice number, and then use the two neighboring cell numbers want to subtract, and then fill the formula to see the size of the difference.
=IF (A3="", "", A3-A2)
The smaller the difference, the closer the two invoice numbers. Finding an invoice with a difference equal to 1 is two invoices with consecutive numbers.