Formula to identify gaps

uiucfan1

New Member
Joined
Aug 7, 2023
Messages
9
Office Version
  1. 365
Platform
  1. Windows
All - I'm looking for a formula that can identify gaps in a LARGE set of data. I'm going to copy and paste an example into this question. So, from here - i can see that there is no tag #14 or #25, but i have LITERALLY almost 6K rows of data to look through - so I'm hoping someone smarter than me can help me with a formula that I can quickly review to determine either:

1) a listing of all the gaps; or
2) conditional format when there are gaps identified

I can't just use a "+1" function, because when there are gaps - i want to still be looking "one forward"... so, like above - when it skips #14 and goes from 13 to 15 - is there an automatic way to do this - or do I have to just skip gap to gap and redo any applicable formula?

Thanks in advance!!!!!


UST Population.xlsx
CDF
40U00000112/12/2018
41U00000212/14/2018
42U0000031/2/2019
43U0000041/2/2019
44U0000051/9/2019
45U0000061/10/2019
46U0000071/28/2019
47U0000081/28/2019
48U0000092/5/2019
49U0000102/7/2019
50U0000112/28/2019
51U0000123/6/2019
52U0000133/26/2019
53U0000153/28/2019
54U0000164/3/2019
55U0000174/3/2019
56U0000184/10/2019
57U0000194/17/2019
58U0000204/17/2019
59U0000214/19/2019
60U0000224/22/2019
61U0000234/30/2019
62U0000245/2/2019
63U0000265/15/2019
64U0000275/16/2019
65U0000286/3/2019
66U0000296/17/2019
67U0000306/20/2019
Sorted by Tag #
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this?

Book6
CDE
40U000001U000014
41U000002U000025
42U000003
43U000004
44U000005
45U000006
46U000007
47U000008
48U000009
49U000010
50U000011
51U000012
52U000013
53U000015
54U000016
55U000017
56U000018
57U000019
58U000020
59U000021
60U000022
61U000023
62U000024
63U000026
64U000027
65U000028
66U000029
67U000030
Sheet1
Cell Formulas
RangeFormula
E40:E41E40=LET(_a,TEXT(SEQUENCE(MAX(--MID(C40:C67,2,99))),"U000000"),FILTER(_a,ISNA(XMATCH(_a,C40:C67))))
Dynamic array formulas.
 
Upvote 0
Try this?

Book6
CDE
40U000001U000014
41U000002U000025
42U000003
43U000004
44U000005
45U000006
46U000007
47U000008
48U000009
49U000010
50U000011
51U000012
52U000013
53U000015
54U000016
55U000017
56U000018
57U000019
58U000020
59U000021
60U000022
61U000023
62U000024
63U000026
64U000027
65U000028
66U000029
67U000030
Sheet1
Cell Formulas
RangeFormula
E40:E41E40=LET(_a,TEXT(SEQUENCE(MAX(--MID(C40:C67,2,99))),"U000000"),FILTER(_a,ISNA(XMATCH(_a,C40:C67))))
Dynamic array formulas.

I tried that - and it worked great for the information in that cell range (after adjusting for the end of the formula) ... then i tried moving it a few cells over for "year 2" and couldn't get it to work correctly - so i moved my "year 2" data into a new sheet over-righting "year 1" ... and pasted again - i changed the range and the "u" to a "v" as the tag #s changed.... but something is off - its skipping from 200 to 1100 even though 201, 202, etc. are present - any ideas? I have included the mini sheet to show what i used.

UST Population.xlsx
CDF
41V0001016/10/2020V000120
42V0001026/11/2020V000121
43V0001036/11/2020V000122
44V0001046/17/2020V000123
45V0001056/22/2020V000124
46V0001066/22/2020V000125
47V0001076/22/2020V000126
48V0001086/24/2020V000127
49V0001096/23/2020V000128
50V0001107/15/2020V000129
51V0001116/23/2020V000130
52V0001126/24/2020V000131
53V0001136/25/2020V000132
54V0001147/6/2020V000133
55V0001157/9/2020V000134
56V0001167/15/2020V000135
57V0001177/16/2020V000136
58V0001187/17/2020V000137
59V0001197/17/2020V000138
60V0001461/5/2021V000139
61V0001789/28/2020V000140
62V00017910/30/2020V000141
63V00018010/30/2020V000142
64V00018111/4/2020V000143
65V00018211/4/2020V000144
66V00018311/13/2020V000145
67V00018411/20/2020V000147
68V00018511/18/2020V000148
69V00018611/23/2020V000149
70V00018712/8/2020V000150
71V0002011/21/2020V000151
72V0002021/29/2020V000152
73V0002032/20/2020V000153
74V0002043/12/2020V000154
75V0002053/16/2020V000155
76V0002065/21/2020V000156
77V0002075/22/2020V000157
78V0002085/18/2020V000158
79V0002095/21/2020V000159
80V0002106/2/2020V000160
81V0002116/2/2020V000161
82V0002126/2/2020V000162
83V0002136/3/2020V000163
84V0002146/4/2020V000164
85V0002156/10/2020V000165
86V0002168/11/2020V000166
87V0002176/11/2020V000167
88V0002186/12/2020V000168
89V0002196/12/2020V000169
90V0002206/15/2020V000170
91V0002216/15/2020V000171
92V0002226/23/2020V000172
93V0002237/7/2020V000173
94V0002257/1/2020V000174
95V0002277/7/2020V000175
96V0002287/7/2020V000176
97V0002297/14/2020V000177
98V0002307/29/2020V000188
99V0002317/30/2020V000189
100V0002338/4/2020V000190
101V0002358/4/2020V000191
102V0002368/10/2020V000192
103V0002378/11/2020V000193
104V0002388/11/2020V000194
105V0002398/11/2020V000195
106V0002418/13/2020V000196
107V0002428/13/2020V000197
108V0002438/24/2020V000198
109V0002448/25/2020V000199
110V0002458/25/2020V001100
2022 - Sorted by Tag #
Cell Formulas
RangeFormula
F41:F5450F41=LET(_a,TEXT(SEQUENCE(MAX(--MID(C41:C2750,2,99))),"V000100"),FILTER(_a,ISNA(XMATCH(_a,C41:C2750))))
Dynamic array formulas.
 
Upvote 0
How about
Excel Formula:
=LET(d,C41:C3000,a,--REPLACE(FILTER(d,d<>""),1,1,""),t,TEXT(SEQUENCE(MAX(a)-MIN(a)+1,,MIN(a)),"V000000"),FILTER(t,ISNA(XMATCH(t,d))))
 
Upvote 0
Solution
How about
Excel Formula:
=LET(d,C41:C3000,a,--REPLACE(FILTER(d,d<>""),1,1,""),t,TEXT(SEQUENCE(MAX(a)-MIN(a)+1,,MIN(a)),"V000000"),FILTER(t,ISNA(XMATCH(t,d))))
This appears to have done it :) Thanks!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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