I need to append the UOM, "hrs" to a list of value columns in the pivot table without affecting the summation that is being carried out. For this I've used the custom format cell option ##" hrs" which works great but some of the values in the column contain decimals (o.5, 8.3 and so on). I don't want to change these values.. Instead I want to append the "hrs" text to each of these values, example: 1 hrs, 8.3 hrs, 10.5 hrs..

Is there any way for me to achieve this using the custom format cell option?

P.S. Apologies if it's a very simple solution m(_ _)m

有帮助吗?

解决方案

You would need conditional formatting.

In this example, the numbers will range from A1 down.

Highlight the cells, starting at A1
Go to Home, Conditional Formatting, New Rule, and then Use a Formula to Determine Which Cells to Format.

For whole numbers:
For the formula, use =MOD(A1,1)=0
For the format, select number, go to custom, and type #" hrs"

For decimals:
For the formula, use =MOD(A1,1)<>0
For the format, select number, go to custom, and type #.#" hrs"

if you want commas, then the first format would be #,#" hrs" and the second would be #,#.#" hrs"

其他提示

use 0,00" hrs" as custom format cell option

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top