# Custom Field Format Percentage and Round?

### Diskusi Umum

• Hi all,

I´m using Project Proffessional for office 365.

I´ve set up 3 Custom Fields (Total, Done & Percentage).

In the Percentage field my formula is:

Format(Done/Total)*100 & "%"

The formula works fine but the result has too many decimal places -> my result is for instance 83,8235294117647% instead of ex. 84 or 83,8 would be just fine!

I´ve tried other versions of this formula to get my desired result, unfortunately it doesn´t work, for example I tried this one:

Format(Done/Total)*100, "0%" & "%"

Any ideas?

Regards

Rabu, 19 September 2018 12.50

### Semua Balasan

• I had something similar once, and I took the value and converted it to text.

Converts float;     #99.0000000000 to 99.00

Mid([Text1],8,len([Text1])-18)

See how you go with this, however if you wait a while I expect John will jump in and give you the exact formula you require!

Ben Howard [MVP] | web | blog | book | downloads | P2O

Rabu, 19 September 2018 13.35
• Hi again,now with this it just works fine:

Round(Format(Zahl2/Zahl1)*100) & "%" ...... but!

Now ofc I have another problem, I have some rows where Total and/or Done are 0 --> ofc in these rows i get an #error. Anybody knows the Iif statement to only show results for "above 0" rows?

Rabu, 19 September 2018 13.37
• Since you are already using the Format function, you could go ahead and supply an argument (the Round function is redundant).  This should work:

IIf([Number1]>0,Format(Number2/Number1,"0.00")*100 & "%",0)

Add extra zeros to "0.00" for increased precision.

Good luck, tom

Rabu, 19 September 2018 13.42
• That worked perfectly!

Thx very much!

Kamis, 20 September 2018 07.48