OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Converting Values

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
gvblack
Newbie
Newbie


Joined: 11 Jun 2005
Posts: 1

PostPosted: Sat Jun 11, 2005 12:11 pm    Post subject: Converting Values Reply with quote

I get input from another source that contains several numbers in one cell. I would like to seperate these numbers out so I can work with them.

For example, a cell might be:

Gold 2,835,581

I want just the 2,835,581 returned as a number.

Or, 0 1,500 0 4,000

I'd want to be able to get each of those 4 values returned as a number.

TIA
Back to top
View user's profile Send private message
carl
Super User
Super User


Joined: 21 Apr 2003
Posts: 920
Location: Germany

PostPosted: Sun Jun 12, 2005 11:18 pm    Post subject: Reply with quote

Try playing around with LEFT MID RIGHT and FIND

Gold 2,835,581

B1 =LEFT(A1;(FIND(" ";A1))) returns everything before the first space :Gold

C1 =MID(A1;5;6) returns digits 5 to 11 :2,835

D1 =RIGHT(A1;3) returns last three digits :581
_________________
carl
Using OpenOffice.org 2 on XP sp2
Back to top
View user's profile Send private message
8daysaweek.co.uk
Super User
Super User


Joined: 29 Nov 2003
Posts: 2130
Location: UK

PostPosted: Sun Jun 12, 2005 11:21 pm    Post subject: Reply with quote

Hi gvblack,

You may also find some useful tips here:
http://www.oooforum.org/forum/viewtopic.phtml?t=20709

BFN Smile,
_________________
James
www.8daysaweek.co.uk - A User-Focused OOo site
Back to top
View user's profile Send private message Visit poster's website AIM Address
David
Super User
Super User


Joined: 24 Oct 2003
Posts: 5668
Location: Canada

PostPosted: Mon Jun 13, 2005 4:01 am    Post subject: Re: Converting Values Reply with quote

gvblack wrote:
I get input from another source that contains several numbers in one cell. I would like to seperate these numbers out so I can work with them.

For example, a cell might be:

Gold 2,835,581

I want just the 2,835,581 returned as a number.

Or, 0 1,500 0 4,000

I'd want to be able to get each of those 4 values returned as a number.

TIA


Try this on a small simulation file with the same format as you describe:

1. Assuming the file as a text file, using a program like Metapad, find and replace all spaces by semi-colons ...be sure you don't have a space after the last entry in each line.

2. There is a program called CSVEd I've mentioned before to do wonderful things with CSV files. There, set the delimiter to a semi colon, then load the file. It will [should] appear with items in separate columns. Change the delimiter to a comma, then resave as a CSV file, which should then load into Calc as you want it to.

I had some success with this with a small sample:

0 1,500 0 4,000
1 2 3 4
5 6 7 8

became ....

0;1,500;0;4,000
1;2;3;4
5;6;7;8
and I saved that with a .csv extension

I used the semi-colon because you had a comma in your numbers. Calc seemed to handle that OK, but formatting was lost. However, the values were separated into individual columns.

David.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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