Access Report Conditional Format based on If

afs24

Board Regular
Joined
Sep 26, 2002
Messages
237
I'm trying to conditional format in a report. Below is what I'm trying to do:

=IF([Work Function]="CARTPICK",[MaxOfCARTONS]/[SumOfHours],[MaxTRANS]/[SumOfHours]))

I'm sorting my report by the header Work Function. Why doesn't this work? thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I haven't tested your formula but it looks like there are a couple of syntax problems. Try using IIF instead of IF and it looks like there is an extra bracket at the end of the formula. A couple of other things to check is that the field names are correct (you have MaxOfCartons and MaxTrans - are these names correct?) and the formats of the fields match what it is you are trying to do (the formats in the underlying query and table). BTW, you could calculate this field in the underlying query rather than the report and I would suggest you do that anyway.
HTH, Andrew. :)
 
Upvote 0
Are you actually using conditional formatting? Or are you trying to calculate a value in depending on the value of a field?

Conditional formatting requires a TRUE/FALSE value.

Your IF will return a number which will probably be regarded as true.
 
Upvote 0
I actually didn't do this correctly. I want to write an if statement in the conditional formating like the following example:

=IIF([Work Function]="CARTPICK",<50,0)

I have 4 work functions I need to format and include in this formatting:
PUTAWAY <25
LOADING <25
RECEIVING <20

I need my if statement to look for all four work functions? thanks
 
Upvote 0
Hi, the latest example is very different to your first and I'm confused as to what you are trying to achieve.

Are you wanting 4 conditional formatting tests, with 2 conditions for each? In plain English, test 1 is if the [Work Function] equals "CARTPICK" and if the value of something else is less than 50, then you want to apply a conditional format, using the Format -> Conditional Formatting in the report design? But if [Work Function] = "PUTAWAY" and something else is less than 25 then use another format? And so forth for test 3 and 4? Is this what you want?

Andrew :)
 
Upvote 0
Yes, I have 4 diffenet conditions but only 1 test. Example

if CARTPICK <50 then I want it to turn yellow but if it's eqaul or greater then I want it to stay as is. It only lets you do 3 conditions but I have 4. I know I can write a formula in one conditions for all four but I'm not sure how. thanks
 
Upvote 0

Forum statistics

Threads
1,221,893
Messages
6,162,662
Members
451,781
Latest member
DylantheD

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