A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Value function



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2009, 05:50 AM posted to microsoft.public.excel.worksheet.functions
Dave
external usenet poster
 
Posts: 2,331
Default Value function

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.
  #2  
Old April 20th, 2009, 06:29 AM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Value function

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.

  #3  
Old April 20th, 2009, 06:52 AM posted to microsoft.public.excel.worksheet.functions
Dave
external usenet poster
 
Posts: 2,331
Default Value function

Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.

  #4  
Old April 20th, 2009, 06:57 AM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Value function

The "/" in the text string do not represents a number.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.

  #5  
Old April 20th, 2009, 07:42 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Value function

No.

If A1 contains 200/7 that is a text string.

=Value(200/7)

Returns the correct result because 200 is being divided by 7 and that result
which is a number is passed to the VALUE function for further calculation.
However, using the VALUE function in this manner is redundant.

=VALUE(A1)

Retunrs a #VALUE! error because 200/7 is a rext string *and* the calculation
of 200 divided by 7 is not taking place.

VALUE returns the numeric equivalent of a text number. To see how it works
try this:

A1 = 200/7

Enter this formula in a cell, say D1:

=LEFT(A1,3)

The result is the TEXT string 200. To see that it is in fact a TEXT string
try these formulas to test it:

=ISTEXT(D1) will return TRUE
=ISNUMBER(D1) will return FALSE

Also note that the cell alignment is to the left. TEXT aligns left and
numeric numbers align right.

Now try this formula in D1:

=VALUE(LEFT(A1,3))

Notice all the changes. The cell is now aligned right and the results of
ISTEXT and ISNUMBER have reversed.

Note however, the use of the VALUE function is almost never needed. You can
convert TEXT numbers to NUMERIC numbers by using double negation. Like this:

=--LEFT(A1,3)

Also, any math operation on a TEXT number will coerce it to a numeric
number:

=LEFT(A1,3)+0
=LEFT(A1,3)*1
=LEFT(A1,3)/RIGHT(A1,1)

To get the result that you expect requires a special functon. Try this:

*Select cell B1*
Goto the menu InsertNameDefine
Name: Calculate
Refers to: =EVALUATE(A1)
OK

Now type this into cell *B1* :

=CALCULATE


--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a
fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.



  #6  
Old April 20th, 2009, 08:12 AM posted to microsoft.public.excel.worksheet.functions
Dave
external usenet poster
 
Posts: 2,331
Default Value function

Hi Bif,
Thanks for taking the time to explain that.
And putting 'Evaluate' into a named formula is completely new to me. I
couldn't find 'Evaluate' in the list of Worksheet functions, and the Help
gave no relevant hits. How do you know this stuff?

Dave.

"T. Valko" wrote:

No.

If A1 contains 200/7 that is a text string.

=Value(200/7)

Returns the correct result because 200 is being divided by 7 and that result
which is a number is passed to the VALUE function for further calculation.
However, using the VALUE function in this manner is redundant.

=VALUE(A1)

Retunrs a #VALUE! error because 200/7 is a rext string *and* the calculation
of 200 divided by 7 is not taking place.

VALUE returns the numeric equivalent of a text number. To see how it works
try this:

A1 = 200/7

Enter this formula in a cell, say D1:

=LEFT(A1,3)

The result is the TEXT string 200. To see that it is in fact a TEXT string
try these formulas to test it:

=ISTEXT(D1) will return TRUE
=ISNUMBER(D1) will return FALSE

Also note that the cell alignment is to the left. TEXT aligns left and
numeric numbers align right.

Now try this formula in D1:

=VALUE(LEFT(A1,3))

Notice all the changes. The cell is now aligned right and the results of
ISTEXT and ISNUMBER have reversed.

Note however, the use of the VALUE function is almost never needed. You can
convert TEXT numbers to NUMERIC numbers by using double negation. Like this:

=--LEFT(A1,3)

Also, any math operation on a TEXT number will coerce it to a numeric
number:

=LEFT(A1,3)+0
=LEFT(A1,3)*1
=LEFT(A1,3)/RIGHT(A1,1)

To get the result that you expect requires a special functon. Try this:

*Select cell B1*
Goto the menu InsertNameDefine
Name: Calculate
Refers to: =EVALUATE(A1)
OK

Now type this into cell *B1* :

=CALCULATE


--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a
fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.




  #7  
Old April 20th, 2009, 09:00 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_]
external usenet poster
 
Posts: 2,297
Default Value function

Hi Dave
You could get round it with a named formula
InsertNameDefine
Name Eval
Refers to =EVALUATE($A1)

In B1 enter =Eval and you will see the result 28.57143
Because the formula is locked to column A but relative for rows, as you copy
down it will give the corresponding results for A2, A3 etc.

--
Regards
Roger Govier

"Dave" wrote in message
...
Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a
fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.


  #8  
Old April 20th, 2009, 05:54 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Value function

How do you know this stuff?

Through experience.

EVALUATE is an Excel macro function, it's not a regular worksheet function.
In fact, you can't use it directly on a worksheet and that's why you need to
create the defined name in order to use it.

Macro functions were used in older versions of Excel until they were
replaced with VBA, an extended version of the Visual Basic programming
language. The macro functions are still supported but not documented in
newer versions of Excel.


--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
Hi Bif,
Thanks for taking the time to explain that.
And putting 'Evaluate' into a named formula is completely new to me. I
couldn't find 'Evaluate' in the list of Worksheet functions, and the Help
gave no relevant hits. How do you know this stuff?

Dave.

"T. Valko" wrote:

No.

If A1 contains 200/7 that is a text string.

=Value(200/7)

Returns the correct result because 200 is being divided by 7 and that
result
which is a number is passed to the VALUE function for further
calculation.
However, using the VALUE function in this manner is redundant.

=VALUE(A1)

Retunrs a #VALUE! error because 200/7 is a rext string *and* the
calculation
of 200 divided by 7 is not taking place.

VALUE returns the numeric equivalent of a text number. To see how it
works
try this:

A1 = 200/7

Enter this formula in a cell, say D1:

=LEFT(A1,3)

The result is the TEXT string 200. To see that it is in fact a TEXT
string
try these formulas to test it:

=ISTEXT(D1) will return TRUE
=ISNUMBER(D1) will return FALSE

Also note that the cell alignment is to the left. TEXT aligns left and
numeric numbers align right.

Now try this formula in D1:

=VALUE(LEFT(A1,3))

Notice all the changes. The cell is now aligned right and the results of
ISTEXT and ISNUMBER have reversed.

Note however, the use of the VALUE function is almost never needed. You
can
convert TEXT numbers to NUMERIC numbers by using double negation. Like
this:

=--LEFT(A1,3)

Also, any math operation on a TEXT number will coerce it to a numeric
number:

=LEFT(A1,3)+0
=LEFT(A1,3)*1
=LEFT(A1,3)/RIGHT(A1,1)

To get the result that you expect requires a special functon. Try this:

*Select cell B1*
Goto the menu InsertNameDefine
Name: Calculate
Refers to: =EVALUATE(A1)
OK

Now type this into cell *B1* :

=CALCULATE


--
Biff
Microsoft Excel MVP


"Dave" wrote in message
...
Yeah, but the description of Value is:
Converts a text string that represents a number to a number.
So it shouldn't matter that xl identifies 200/7 as text.
Dave.

"Jacob Skaria" wrote:

This is similar to =VALUE("200/7"). Excel do not identify 200/7 as a
fraction
but as a text string; and hence returns error.

If this post helps click Yes
---------------
Jacob Skaria


"Dave" wrote:

Hi all,
XL2003.
I have a fraction, say 200/7, in A1.
In B1, I have: =Value(200/7), which returns the right answer.
In C1, I have: =Value(A1), which returns a #Value! error.
What am I doing wrong?
Thanks in advance.
Dave.






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:14 PM.


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