Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

decimal places calculation

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Decimal Places in Calculation

Decimal Places in Calculation

ResolvedVersion 2013

Joshua has attended:
Excel Advanced course

Decimal Places in Calculation

Hi Richard,

Hope you are well.

I am currently creating a profit and loss calculation spreadsheet for my company and have encountered a potential issue with decimal places.

To simplify my query, lets say that A1 has a number of 100.012 and B1 has a number of 100.01 and in C1 I've added the two together and Excel says: 200.022. This is fine.

My issue is that in my profit and loss calculation A1 is actually generated from a calculation so the figure in reality could actually be 100.01256755 (etc.) and B1 is a fixed figure that could have a changeable decimal place (e.g. could be between 2-4 decimal places). When C1 is calculated it will only show me the decimal place that I select for the cell - but the issue is that I want the cell to only go to the decimal place that is reflected by B1. This becomes an issue when you have a table of data as B1 might be to 2 decimal places but B2 might be to 3 decimal places.

I want some kind of formula that will restrict the amount of decimal places used in column C based on whatever the maximum decimal place in column B. Remember that the cell in column C is worked out by adding together column A and B.

Can you take a look at this and let me know what you can come up with?

Cheers

Josh

RE: Decimal Places in Calculation

Hi Josh,

Great question.
We have the =ROUND(number,decimal places) we could use.
If you wanted to count the decimal place in column B you can use this
=LEN(B1)-FIND(".",B1)

You can ROUND the SUM by using the number of Decimals in B as follows
=ROUND(SUM(A1:B1),LEN(B1)-FIND(".",B1))

Does that help?


Kind regards

Richard Bailey
Microsoft Certified Trainer

Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Decimal Places in Calculation

Absolutely brilliant, thank you Richard!!

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Move to edge of data block

When data is held in a block, however large, use the Ctrl key with your cursors to move quickly to the far edge of the block. Works with all 4 direction keys.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.15 secs.