ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Number custom formatting (https://www.excelbanter.com/excel-discussion-misc-queries/95858-number-custom-formatting.html)

Don

Number custom formatting
 
Hi all,

I am trying to format a number that can be in the range + or - xxxxxx.
I have formatted such that it reads:
[<1000000]0.00,"Kbps";[=1000000]0.00,,"Mbps";General
The formatting works for all positive values (eg 9394000 is output as
9.39Mbps, 128000 is output as 128.00Kbps). I cannot however get the negative
values formatted correctly? -192000 is output as -192Kbps which is correct,
but -1344000 is output as -1344.00Kbps instead of -1.34Mbps?

I suspect the issue is very trivial - but cannot locate : (
Help really appreciated!

Thx,

Don

JLatham

Number custom formatting
 
Your format statement says that if any number is less than 1,000,000 then
display as Kbps. All negative numbers are going to meet that criteria. You
need to be looking at the ABSOLUTE value of the cell without sign to get the
results you want. so then the absolute, unsigned value of -1344000 would
become 1344000 and would display as you want it to be.

"Don" wrote:

Hi all,

I am trying to format a number that can be in the range + or - xxxxxx.
I have formatted such that it reads:
[<1000000]0.00,"Kbps";[=1000000]0.00,,"Mbps";General
The formatting works for all positive values (eg 9394000 is output as
9.39Mbps, 128000 is output as 128.00Kbps). I cannot however get the negative
values formatted correctly? -192000 is output as -192Kbps which is correct,
but -1344000 is output as -1344.00Kbps instead of -1.34Mbps?

I suspect the issue is very trivial - but cannot locate : (
Help really appreciated!

Thx,

Don



All times are GMT +1. The time now is 06:32 AM.

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