How to evaluate the text formula,eg.600*600*12

leezhihong

Board Regular
Joined
Nov 1, 2009
Messages
50
I want to evaluate C5:C15 in D5:D15, to get the solutions like E5:E15.
How to do?


Excel Workbook
CDE
4=?
5600*600*124320000
6600*600*176120000
7500*600*2600000
8600*640*207680000
9700*500*207000000
10550*480*123168000
11450*480*2432000
12550*480*164224000
13350*350*151837500
14320*320*121228800
15250*250*2125000
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Perhaps someone has a more clever solution but this is one way. You could use a custom function...

  • Alt+F11 to open the VBA editor
  • From the VBA menu select Insert|Module
  • Paste the code below in the edit window
  • Back in Excel, put this formula in D5 and copy it down column D

=EVAL(C5)

Code:
Function EVAL(rng As Range)
    EVAL = Evaluate(rng.Value)
End Function
 
Upvote 0
Do it this way:

In A1 put 600
in B1 put 600
In C1 put 12
In D1 put:
=A1*B1*C1

Then you will have the correct answer. This is the way Excel works best ;) You can use the Text-To-Columns feature to break the elements into individual cells.
 
Upvote 0
If you're absolutely desperate for a one-formula/no-VBA solution, try this:-
Code:
=LEFT(C5,FIND("*",C5)-1)*LEFT(MID(C5,FIND("*",C5)+1,99),FIND("*",MID(C5,FIND("*",C5)+1,99))-1)*MID(MID(C5,FIND("*",C5)+1,99),FIND("*",MID(C5,FIND("*",C5)+1,99))+1,99)
 
Last edited:
Upvote 0
Another option (not tested).

In Sheet1:

- select D5
- create the name Eval, referring to: =EVALUATE(Sheet1!C5)
- enter in D5: =Eval

Copy down.

This named formula will always evaluate the cell to the left, if you use it in K3, it evaluates J3. To be used in Sheet1.
 
Last edited:
Upvote 0
Interesting. Why does Evaluate() work in a name but not in a cell (e.g., if you put =Evaluate(C5) in D5 it fails)?
 
Upvote 0
Thanks Andrew. This post is now using two things I've always avoided - relative references in Names, and XLM macros! It's interesting to see some smart use of them here.
ξ
 
Upvote 0
Another option (not tested).

In Sheet1:

- select D5
- create the name Eval, referring to: =EVALUATE(Sheet1!C5)
- enter in D5: =Eval

Copy down.

This named formula will always evaluate the cell to the left, if you use it in K3, it evaluates J3. To be used in Sheet1.


Thanks! It is perfect!
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top