ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula Help (https://www.excelbanter.com/excel-discussion-misc-queries/251069-formula-help.html)

Nikki

Formula Help
 
=IF(ISERROR(V2/U2),"0.00"%,V2/U2)

In the above formula, where can I add the Round to round to 4 digits for the
result?

Thanks
nikki

Mike H

Formula Help
 
Nikki,

=IF(ISERROR(V2/U2),"0.00"%,ROUND(V2/U2,4))

Mike

"Nikki" wrote:

=IF(ISERROR(V2/U2),"0.00"%,V2/U2)

In the above formula, where can I add the Round to round to 4 digits for the
result?

Thanks
nikki


Joe User[_2_]

Formula Help
 
"Nikki" wrote:
=IF(ISERROR(V2/U2),"0.00"%,V2/U2)
In the above formula, where can I add the Round to round to
4 digits for the result?


First, the formula should be:

=IF(ISERROR(V2/U2), 0, V2/U2)

formatted as Percentage. Return the __number__ 0.00%, not the text "0.00%".

Second, it is unclear what you want rounded to 4 digits. My guess: you
want the __percentage__ rounded to 4 decimal places.

Two ways, depending on your intent:

1. Format the cell with Percentage with 4 decimal places. Note: that
changes the appearance, but not the actual value.

2. Explicitly round the expression __and__ change the cell format (#1).
That changes the actual value as well as the appearance.

The trick is: percentage units already represent 2 decimal places of a
decimal fraction. So you need to do:

=IF(ISERROR(V2/U2), 0, ROUND(V2/U2, 6))

Note the use of 6 instead of 4.

Finally, if you are only trying to avoid a divide-by-zero error, you could
write:

=IF(U2=0, 0, ROUND(V2/U2,6))





All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com