Showing posts with label Conditional Formatting. Show all posts
Showing posts with label Conditional Formatting. Show all posts

Saturday, 20 March 2010

Excel Picture Quiz stage 2

In stage 2 we get the quiz to mark the questions, there are several ways to do this however for this tutorial I am going to use an IF statement. This allows us to have two responses, correct and incorrect, these can be substituted for your own message.

I am going to have the answer in cell B4 and the responce in B5, so the code for B5 is

=IF(B4="Johnny Depp", "Correct", "Wrong")

the italicised parts are the ones you will have to change for each picture.

B4 - the cell reference for the answer you are checking.

"Johnny Depp" - the correct answer.

It is important to note that for the counter I am going to create later to work the 'correct' message must be the same for every picture.

Set the answer cells to change colour using conditional formatting, in Office 2007 this is to the right on the home tab.











Simply set the cell to change colour when the cell is equal to your 'correct' message.

Monday, 15 February 2010

Access and conditional formatting reports

This isn't the important, in-depth blog post I'd hoped to start with, but is a subject which has come up in discussions a couple of times recently, so thought it worth posting.
Access 2007 allows you to apply conditional formatting to reports.  This means you can highlight one field, either because of it's value, or the values within in other fields.  You do this by right clicking the relevant field and selecting ‘Conditional Formatting’.
ConditionalFormatting1 The next step is to choose which field(s) you want the formatting to rely upon.  To do this choose either ‘Field Value Is’ or ‘Expression Is’.  The first choice makes the conditional format dependant on the selected field, the second allows you to enter a formula which can then look at other fields.
ConditionalFormatting2 In the example that follows I have chosen to highlight the ‘Product’ field where the ‘Quantity’ is higher then 2 using ‘Expression Is’.
ConditionalFormatting3When using IF statements, Access, unlike Excel wants to see IIF.
And now for the reason I’m posting this.  When choosing to change the back colour you need to ensure that the control’s (Label, TextBox etc) back style is set to ‘Normal’.  When creating a report the default back style is ‘Transparent’, this means the back colour format is not shown. 
ConditionalFormatting4
Below are two pics, the first where the control’s back style is ‘Transparent’.
ConditionalFormatting5And the  second after changing the back style to ‘Normal.
ConditionalFormatting4
Well, I hope that proves useful to someone, if you have any comments or questions let us know.