Formating Percentage on Report

OasisUnknown

New Member
Joined
Oct 15, 2015
Messages
46
Hello All,

I need some assistance.

I have a calculated field on a query that reads as follows.

Code:
ASGSL1%: Format(IIf([AUTHSL1]=0,[ASGSL1],IIf([ASGSL1]>0,[ASGSL1]/[AUTHSL1],"0")),"0%")


Note: I have also tried this following line
Code:
ASGSL1%: FormatPercent(IIf([AUTHSL1]=0,[ASGSL1],IIf([ASGSL1]>0,[ASGSL1]/[AUTHSL1],"0")),0)

The skipping over the theory of my iif statements end result of the field is a percentage that is displayed

examples would be
75%, 85%, 125%, 0%
depending on the variables.



The specific problem that I am having is getting those fields to conditionally format based on the percentage.

on my report I click on my field

ASGSL1% > go to format tab > conditional format

and I am doing a conditional format the same as if I would do it in excel.


So I have a statement as follows in the conditional format.

Field value is | Less than or equal to | .75

if the value check meets that criteria I am just trying to highlight the text red.

but its not actually highlighting anything. Sometime if I change things around to try a different conditional format it will highlight all the 0%'s but not any 25%



From my research it may be because when I use the Format() on my calculated field that is converting the number to a string and in my mind you cant check a string for a percent.

but I have no idea how to proceed forward.

can anyone see where I am going wrong in this process?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
As you have rightly guessed the format() function will convert the value into string. Remove the Format function from the IIF() function and get the result in decimal format. Set the Query Column/Report Field Format Property with the "percent" format to display in percentage format.

For conditional formatting criteria you can use decimal value for comparison. Since the value remains as decimal internally, setting the format property of the field will not change the type of value of the field.
 
Last edited:
Upvote 0
Thank you Apr Pillai,

you have solved my issue. I knew it was something simple but I just needed another perspective to solve it.
 
Upvote 0

Forum statistics

Threads
1,223,593
Messages
6,173,237
Members
452,505
Latest member
Neeraj1990

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top