Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default turning text into a calculated result:

Hello all

I have a spreat sheet that looks something like this:

Cases Total cigarettes
13*10*20 2,600
13*10 130
12*10*20 2,400

with col A as "Cases" & column b "total ciggies"

basically I want a formula to calculate the sum in col A to display the
result in col B

without having to manually into the calculation each time & without using
"Text to Columns" if possible

any help please?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default turning text into a calculated result:

You could set up this user-defined function:

Function Eval(Rng As Range) As Variant
Application.Volatile True
Eval = Evaluate(Rng.Text)
End Function

and then you can use this in B2:

=Eval(A2)

and copy down.

Hope this helps.

Pete

On Apr 14, 3:43*pm, Wayne C <Wayne
wrote:
Hello all

I have a spreat sheet that looks something like this:

Cases * * * Total cigarettes
13*10*20 * * * * * *2,600
13*10 * * * 130
12*10*20 * * * * * *2,400

with col A as "Cases" & column b "total ciggies"

basically I want a formula to calculate the sum in col A to display the
result in col B

without having to manually into the calculation each time & without using
"Text to Columns" if possible

any help please?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 563
Default turning text into a calculated result:

While Pete has given an excellent VBA solution, you may not be familiar with
VBA and need a 'quick fix'
Here is a one way
I will assume the data is in A2:A100; that the most you have is 4 numbers
separated by asterisk, and there is nothing in columns B thru E
Select A2:A100;
Use Data | Text to Columns with Delimited option and in the Other box enter
a *
Now you numbers will be in 2,3 or 4 columns (A to D)
In E2 enter =PRODUCT(A2:D2) and copy down the column - the fast way it to
double click the fill handle (small solid square in lower right corner) of
the active cell.
PRODUCT wins here over =A2*B2*C2*D2 in that it PRODUCT ignores empty cells
while the formula treats them as zero
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Wayne C" <Wayne wrote in message
...
Hello all

I have a spreat sheet that looks something like this:

Cases Total cigarettes
13*10*20 2,600
13*10 130
12*10*20 2,400

with col A as "Cases" & column b "total ciggies"

basically I want a formula to calculate the sum in col A to display the
result in col B

without having to manually into the calculation each time & without using
"Text to Columns" if possible

any help please?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default turning text into a calculated result:

Try this UDF (User Defined function). From workbook launch VBE using Alt+F11.
From menu Insert a Module and paste the below function.Close and get back to
workbook and try the below formula.

=getcalculation(A2)

Function GetCalculation(strTemp As String) As Variant
GetCalculation = Application.Evaluate("=" & strTemp)
End Function

--
Jacob (MVP - Excel)


"Wayne C" wrote:

Hello all

I have a spreat sheet that looks something like this:

Cases Total cigarettes
13*10*20 2,600
13*10 130
12*10*20 2,400

with col A as "Cases" & column b "total ciggies"

basically I want a formula to calculate the sum in col A to display the
result in col B

without having to manually into the calculation each time & without using
"Text to Columns" if possible

any help please?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula, not the result is displayed in calculated cells - why? Michelle Excel Worksheet Functions 2 October 28th 07 04:17 PM
Pivot Table: How do I hide calculated items that result in zero? David ML Charts and Charting in Excel 1 December 19th 06 05:50 PM
PivotTable:Using a calculated field result in another calculated f Alice Excel Worksheet Functions 0 June 8th 06 05:21 PM
Shifting Calculated Result - Re-Issued sony654 Excel Worksheet Functions 6 January 15th 06 10:08 AM
Shifting Calculated Result sony654 Excel Worksheet Functions 0 January 1st 06 02:36 AM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"