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