JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I need to check if a table column contains only the counting numbers (1, 2, 3, 4, ...) and blanks.
I found the KuTools add-in that claims to be able to do this. Does anyone have experience with this add-in? It says it contains over 300 other tools. I prefer to limit add-ins as much as possible to keep Excel clean and simple.
I then created this sheet which I thought did the job with a couple of helper cells and the duplicate values test. Here it is with four test columns. The Good column has correct values. The Dup column has duplicate values which the test finds and the duplicate values test highlights. The Gap column has a missing number, which the test detects, but it is not highlighted. The Oops column shows a failure of the test where there are two errors that add up to the correct sum. (sigh)
I could write a VBA macro to load the list, sort it, and check it. I could then highlight the problem cells. But then I'd have to remember to run it.
Any comments?
I found the KuTools add-in that claims to be able to do this. Does anyone have experience with this add-in? It says it contains over 300 other tools. I prefer to limit add-ins as much as possible to keep Excel clean and simple.
I then created this sheet which I thought did the job with a couple of helper cells and the duplicate values test. Here it is with four test columns. The Good column has correct values. The Dup column has duplicate values which the test finds and the duplicate values test highlights. The Gap column has a missing number, which the test detects, but it is not highlighted. The Oops column shows a failure of the test where there are two errors that add up to the correct sum. (sigh)
Sequential Numbers.xlsx | ||||||
---|---|---|---|---|---|---|
C | D | E | F | |||
4 | Good | Dup | Gap | Oops | ||
5 | 5 | 5 | 5 | 5 | ||
6 | ||||||
7 | 2 | 2 | 2 | 3 | ||
8 | 4 | 4 | 4 | 3 | ||
9 | ||||||
10 | 1 | 1 | 1 | 1 | ||
11 | 6 | 5 | 7 | 6 | ||
12 | ||||||
13 | 3 | 3 | 3 | 3 | ||
14 | ||||||
15 | 21 | 20 | 22 | 21 | ||
16 | 6 | 5 | 7 | 6 | ||
17 | 6 | 6 | 6 | 6 | ||
18 | OK | Error | Error | OK | ||
Test |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C15 | C15 | =SUBTOTAL(109,[Good]) |
D15 | D15 | =SUBTOTAL(109,[Dup]) |
E15 | E15 | =SUBTOTAL(109,[Gap]) |
F15 | F15 | =SUBTOTAL(109,[Oops]) |
C16 | C16 | =MAX(TblSeq[Good]) |
D16 | D16 | =MAX(TblSeq[Dup]) |
E16 | E16 | =MAX(TblSeq[Gap]) |
F16 | F16 | =MAX(TblSeq[Oops]) |
C17 | C17 | =COUNT(TblSeq[Good]) |
D17 | D17 | =COUNT(TblSeq[Dup]) |
E17 | E17 | =COUNT(TblSeq[Gap]) |
F17 | F17 | =COUNT(TblSeq[Oops]) |
C18 | C18 | =IF(AND(C16=C17,TblSeq[[#Totals],[Good]]=(C16*(C16+1)/2)),"OK","Error") |
D18 | D18 | =IF(AND(D16=D17,TblSeq[[#Totals],[Dup]]=(D16*(D16+1)/2)),"OK","Error") |
E18 | E18 | =IF(AND(E16=E17,TblSeq[[#Totals],[Gap]]=(E16*(E16+1)/2)),"OK","Error") |
F18 | F18 | =IF(AND(F16=F17,TblSeq[[#Totals],[Oops]]=(F16*(F16+1)/2)),"OK","Error") |
I could write a VBA macro to load the list, sort it, and check it. I could then highlight the problem cells. But then I'd have to remember to run it.
Any comments?