Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Value shown isnt value used in formula...

Status
Not open for further replies.

tektipsFriend

Programmer
Dec 2, 2006
7
US
I am dividing two numbers in a cell and then using the result of the division in another formula in another cell. The problem I'm having is that I am formatting the cell to only show 2 decimal places, however when i reference the cell from another cell I get the unformatted version.

For example let's say the result is 6.7568852 and the format i apply to the cell shows 6.76. I want to use 6.76 in the formula in another cell and not 6.7568852. Why doesnt the formatting of the cell carry over?

I hope I wasnt too unclear about what I was asking.
 
Formatting a cell only changes how the number is DISPLAYED, not how it is stored.

If you want the formula in another cell to only consider two decimal places, you need to tell it that.

So use the ROUND function - either in the original cell or in the formula in another cell. ROUND(A1,2)

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
If you want the result to be 2 decimal places then round it using =ROUND(num1/num2,2)

Formatting just affects how a number looks and not how many decimal places there really are. If on the other hand you always want calculations to only use what is showing in the formatting you can set Tools/Options/Calculation/Precision As Displayed option on.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
If you only want 2 decimal places it may be a plan to 'round' the calculation then you'll not have the formatting issue.

=round(c2/b2,2) would probably give youthe answer you look for.

Formatting doesn't change the number - it only changes the view you see of the number.

Fee

The question should be [red]Is it worth trying to do?[/red] not [blue] Can it be done?[/blue]
 
Wow - three responses in the same minute.... I don't see that very often.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
(And we all agreed! Must be a record) [wink]

Fee

The question should be [red]Is it worth trying to do?[/red] not [blue] Can it be done?[/blue]
 



Where was I??? [dazed]

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
(helping everyone else. It's rare the rest of us get a look-in! [wink])

Fee

The question should be [red]Is it worth trying to do?[/red] not [blue] Can it be done?[/blue]
 
Skip said:
Where was I???
I assumed you were finally taking a nap. [wink]

More likely what Fee said.

[small]*grumble grumble* Skip and his #$*&ing nimble fingers *grumble grumble*[/small]

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
I get round that by using as few words as possible and no tgml ;-)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top