Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

number display in Excel

Jun 2, 2004 12:03AM PDT

I am trying to create a feature (non-macro) in which I perform a function, sum of numbers, however I want the decimals reported to be determined by another cell, i.e. if N8=1 then the sum function reports to one decimal, if N8=2 the function reports to two decimals.
I cannot get the function to round as I wish. The cell which the sum resides will be locked and the user will be unable to format the decimals manually.
Currently I have a simple "IF" statement to sum the array, or leave cell blank - I need to add the rounding segment.
If anyone can help I appreciate the interest.
Thanks
Bridget

Discussion is locked

- Collapse -
Re:number display in Excel
Jun 2, 2004 7:16AM PDT

Bridget,

Use fixed-function to format with 1 or 2 decimals.
Use if-function to chose between the 2 results, depending on the contents of N8.
This seems to work perfectly.


Kees

- Collapse -
(NT) Even more simpel: =fixed (expression, N8, 1)
Jun 2, 2004 8:27PM PDT

.