7 Replies Latest reply: Feb 19, 2013 3:05 PM by Somolian
Level 1 (0 points)

Hello, I want to make a calculation using values from another cell but it gives the error "expected number but found chain".

content of B2: 5*2*3

content of B3: =B2

How can I make it compute B2 ?

iMac, Mac OS X (10.6.8)
• Level 7 (29,955 points)

I'm a bit suspicious that this may not be a question about Numbers. Chain is not term that I've ever seen used with respect to Numbers.

Could you tell us more about what you are trying to calculate?

Jerry

• Level 1 (0 points)

Well in French it said "chaine", it might be string in your version.

B3 should show the volume and B2 should show each dimensions (basic multiplication)

• Level 7 (29,955 points)

OK then, it would be a good idea to expand your calculation:

You could do this:

Jerry

• Level 1 (0 points)

That's what I wanted to avoid having to do. Isn't there another way ?

• Level 7 (29,955 points)

You could write: =5*2*3 in any cell.

Jerry

• Level 6 (11,525 points)

You are trying to convert a string that looks like a formula (contained in cell B2) and have the result of the formula  be calculated in cell B3, right?

Two ideas:

Idea 1: If you format B2 as text then enter the text =5*2*3 then change the cell format to Automatic, it will do the calculation in cell B2. You can convert it back to text to see the formula again.

Idea 2: Use an Applescript. The Applescript would copy the string from B2, put the "=" at the beginning and put it into B3. B3 will calculate the result. You can design the script to do this for multiple sets of cells. An example is below for you to try out. If you like it we can make it so it can be started with a keyboard command. Not quite sure how we'll stop it with a keyboard command, though

1. Open the Applescript Editor application
2. Copy the entire script from below
3. Paste it into Applescript Editor
4. Open a new Numbers document
5. Put a formula into cell B2
6. Run the script
7. When you are done testing it out, stop the script. Otherwise it will run forever.

tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1

set vold to ""

repeat

set vnew to ("=" & value of cell "B2")

if voldvnew then

set value of cell "b3" to vnew

set vold to vnew

end if

end repeat

end tell

• Level 1 (0 points)

I'll choose idea 1, thanks. (done)