Harold Fuchs wrote:
2009/9/26 Wade Smart <w...@wadesmart.com>

JOE Conner wrote:

Wade Smart wrote:

I have a group of numbers in a column
265879-09-24-71-918-333-0055
and I need to take the fourth set of numbers, in this case the 71, and
subtract it from the current year to get the age of the item.

Ideas on how to do that?

Wade

Is this a spreadsheet column or is it writer?

Sorry, spreed sheet.


Wade

Assume the numbers are in column A.

   1. Copy column A to column B
   2. Select column B
   3. Go to the Find & Replace menu
   4. In the Find box enter
   "[:digit:]+-[:digit:]+-[:digit:]+-([:digit:]+)-[:digit:].*" without the
   quotes
   5. In the Replace box enter "$1" without the quotes
   6. Click More Options
   7. Check Regular expressions
   8. Check Current selection only
   9. Click Replace All
   10. The values in column B will change so that it only contains the 4th
   number in each row.
   11. In column C enter an appropriate formula such as
   "=YEAR(NOW())-(B1+1900)" assuming the "71" in your example means 1971.




Hey, thats great.
Ok. Anyway I can do this without having to add in this extra column each time I do the sheet?

Wade

--
Registered Linux User: #480675
Registered Linux Machine: #408606
Linux since June 2005

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@openoffice.org
For additional commands, e-mail: users-h...@openoffice.org

Reply via email to