#VALUE returned in otherwise proper formula

immyjimmy

Active Member
Joined
May 27, 2002
Messages
257
Greeting EXCELent members;

I have a co-worker running Excel XP and she's getting a #VALUE message in a cell that has the formula =G5*1.25. The value of G5 is 62.5, so there should be no error. But the message "wrong data type" is displayed. The cells are formatted for 'general'. One other thing that seems odd: When the period key is used, a comma is displayed. Any ideas?

Thanks in advance,
Jim
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Maybe some of the cells are text and not numbers. Put 0 in a cell and copy it. Select all the cells that have numbers. Goto Edit | PasteSpecial | Add

That should make them all into numbers
 
Upvote 0
As DRJ has pointed out, sometimes you can get problems when values that look like numbers ( & are even formatted as such) are actually held as text. (a quick isnumber() check on the cell in question would tell you). The method he described is one effective way of fixing this. However, the mathematical operation in the calculation should be sufficient to perform the coercion on its own. (Indeed, it should work even if there were blanks in the cell as well...).

So - problem is indeed odd! How was the value entered originally? Is it just this cell / calculation?
 
Upvote 0
In fact, in many circumstances Excel's arithmetic operators will coerce a text representation of a numeric value and return a result other than #VALUE!. For example...

="62.5"*1.25 results in 78.125

This even works if there are leading or trailing spaces (ANSI code 32)...

=" 62.5 "*1.25 results in 78.125

The trouble arises when there are ANSI characters other than spaces which appear to be spaces (e.g., ANSI code 160)...

=("62.5"&CHAR(160))*1.25 results in #VALUE!

This can arise if you pasted your values from an html page.

Is this the case? If so, you'll need to do a Find/Replace to rid yourself of these ANSI characters.
 
Upvote 0
immyjimmy said:
...One other thing that seems odd: When the period key is used, a comma is displayed. Any ideas?...

Check her Regional Settings (Options). Make sure that it's set for English (United States) or that the Decimal symbol on the Numbers tab hasn't been changed to ",".

In some European countries (eg., Finland) commas are used for decimals.
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,341
Members
452,638
Latest member
Oluwabukunmi

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