| View previous topic :: View next topic |
| Author |
Message |
Dave M G Power User

Joined: 31 Oct 2005 Posts: 71 Location: Tokyo, Japan
|
Posted: Mon Nov 21, 2005 8:37 pm Post subject: How to find numbers that are missing from a sequence |
|
|
Column A consists of a sequence of numbers, going from 1 to 2042. There should be no missing numbers, which means that the row number to the left of Column A should have the exact same number.
But it does not, which is not the expected result. The list of numbers in Column A was brought in from a database of information, where the numbers designate the rows of information contained in the columns to the right of A.
The numbers should be complete, but the last number of Column A, number 2042, lines up with row 1954, indicating that 88 numbers are missing somewhere.
I need to be able to determine which numbers are missing, so that I can check against the original database to see why the rows were not imported.
Visually hunting for the missing numbers would be much too prone to human error, given that there are roughly 2000 to sort through.
So, can I do some kind of search on Column A to find the 88 missing numbers? Perhaps by highlighting or selecting the cell just above or below the missing row? |
|
| Back to top |
|
 |
Dale Super User

Joined: 21 Feb 2005 Posts: 1440 Location: Australia
|
Posted: Mon Nov 21, 2005 9:10 pm Post subject: |
|
|
Two methods come to mind: Straight out calculation or use of Conditional Formatting (or maybe combine them...)
Calculation method
In a new column (I'll use column B for example):
in B2 type =if ((A2 - A1) >1;"Got One!!!";"")
Fill down as far as you need to.
You can then use Find & Replace to search for Got (or Got One) (make sure when you open the Find dialog you click More>> and tell Calc to search in Values
Conditional formatting
Open the Stylist (see help)
Creat a cell style (call it HiLite) with say a red background, bold 18pt text (whatever works). (Select Cell Styles in the Stylist, right-click Default and select New - save as new style name - HiLite)
Select cell A2
Format > Conditional Formatting
Change Cell Value is to Formula is
Type (A2 - A1) > 1 in the Condition Box
Select HiLite for the Cell Style
Click OK
Select cell A2
Copy
Select Column A
Paste Special and uncheck everything except Formats
The errant cells should now be highlighted. It should be possible to us Find to search for styles - but that's not working on my installation (1.1.3/NT4) - don't know why not.
Edit
New (in cell style method) was Modify - you really don't want to change the default style... _________________ Dale
To err is human, but to destroy your slippers in the process takes a real son of a bitch: Me!
OOo documentation from the source
http://documentation.openoffice.org
Guides, FAQ, How Tos
Last edited by Dale on Tue Nov 22, 2005 2:16 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dave M G Power User

Joined: 31 Oct 2005 Posts: 71 Location: Tokyo, Japan
|
Posted: Mon Nov 21, 2005 11:14 pm Post subject: |
|
|
Thank you. I used a combination of both, because one was easy, and the other was an opportunity to learn how to do conditional formatting.
Also thanks for making your explanation so concise and easy to follow. _________________ LibreOffice 3.4.5
Ubuntu 11.10 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|