Apply function to column of integers?

Discuss the spreadsheet application
Post Reply
NetCalc
Posts: 2
Joined: Fri Jan 25, 2008 5:04 am

Apply function to column of integers?

Post by NetCalc »

Hi,
I have about 2000 integers pasted into column "A" of the Calc app. I'd like to convert them all to binary using one of Calcs functions: DEC2BIN, and have the result show up in column 'B'.
I hit the function f(x) button, double click 'DEC2BIN', and thats as far as I get. Any ideas?
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Apply function to column of integers?

Post by kingfisher »

I never use that button. Have you looked at Help under DEC2BIN function? Your number can be the cell address so all you have to decide is the number of places you require. There seems to be a very limited range of decimal numbers which can be converted. I think your functions can be like =DEC2BIN(A1;8) then just copy it down.
Apache OpenOffice 4.1.9 on Linux
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: Apply function to column of integers?

Post by huw »

NetCalc wrote:I hit the function f(x) button, double click 'DEC2BIN', and thats as far as I get. Any ideas?
Next, make sure the cursor is in the Number box, and click in the cell you want to convert. That will enter the cell's reference in Number. Fill in Places if required, and press OK. This will give you something like

Code: Select all

=DEC2BIN(A1;10)
I use the f(x) a lot - it's a great help when using a new function, and the Structure tab helps when things go wrong. And pressing F1 while you have the Function Wizard open takes you straight to the appropriate section of Help.
NetCalc
Posts: 2
Joined: Fri Jan 25, 2008 5:04 am

Re: Apply function to column of integers?

Post by NetCalc »

Thanks for the replys.

I click the f(x) button, double click DEC2BIN, make sure the cursor is in the 'Numbers' box, and click on cell A1, which shows up in the 'Number' box as A1. I leave the 'Places' box empty. The formula =DEC2BIN(A1) shows up. I click 'Ok'. Cell A1 shows 'Error:552', and theres no binary conversion in the 'B' column. I guess I'm not there yet.
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Apply function to column of integers?

Post by kingfisher »

You have to put that formula in a cell other than A1. It could conveniently go in B1.
Apache OpenOffice 4.1.9 on Linux
Post Reply