View all newsletters
Sign up for our free email newsletters

Fighting for quality news media in the digital age.

  1. Comment
April 17, 2013

Adventures in spreadsheet journalism lesson five: More fun with conditional formatting

My first instalment on conditional formatting broached the standard, by-the-book protocol for applying conditions to cells: selecting the cells you want to subject to the potential formats, and then specifying those conditions that when realized would put the formats in play.

Part two takes up a subtler contingency: formatting cells on the basis of conditions met in a different set of cells.

For example, let’s return to that complement of students and their test scores, as positioned in cells A6:B16:

In instalment one we conditionally formatted the scores themselves, such that scores equal to or greater than 90 were hued blue, and scores in the 70-89 span turned green. Here, we want to apply those formats to the student names – such that Sally will turn blue, so to speak, instead of her score.

In order to make that happen, we need to select cells A7:A16, the name-bearing cells. Then click Home tab > Conditional Formatting > New Rule > Use a formula to determine which cells to format (beneath the Select a Rule Type heading). Then enter:

Content from our partners
Free journalism awards for journalists under 30: Deadline today
MHP Group's 30 To Watch awards for young journalists open for entries
How PA Media is helping newspapers make the digital transition

Note that the reference denotes B7, the cell alongside A7. We want the name in A7 to turn green provided that B7, its companion test score cell, equals or exceeds 70. And because we initiated the process by selecting A7:A16, each of those cells will receive the conditional format should its associated cell in the B column match or better 70. The reference to B7, then, will be copied down through B8:B16, as well.

After entering the formula click the Format button you see above and select a green Fill format. Click OK and you'll be delivered here:

Then click New Rule in the Manager’s upper-left corner and click back on Use a formula…and enter:

Click Format and select a blue (or any other colour) fill to characterize those scores equalling or topping 90, and click OK twice (and recall my caution in the previous post requiring that the stricter condition appear first in the Conditional Formatting Rules Manager).

Now the student names, as opposed to their scores, are duly colour coded:

Note that Bob, Ed, and Quentin’s scores satisfy neither conditional format, thus restraining their cells in their default, colour-free status.

Of course as is generally the case with Excel’s enormous grab-bag of capabilities, there are more parts to conditional format formulas than the ones we’ve inventoried here, but once you nail down the basics detailed above you can start to do real work with the feature.

Topics in this article : ,

Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog

Select and enter your email address Weekly insight into the big strategic issues affecting the future of the news industry. Essential reading for media leaders every Thursday. Your morning brew of news about the world of news from Press Gazette and elsewhere in the media. Sent at around 10am UK time. Our weekly does of strategic insight about the future of news media aimed at US readers. A fortnightly update from the front-line of news and advertising. Aimed at marketers and those involved in the advertising industry.
  • Business owner/co-owner
  • CEO
  • COO
  • CFO
  • CTO
  • Chairperson
  • Non-Exec Director
  • Other C-Suite
  • Managing Director
  • President/Partner
  • Senior Executive/SVP or Corporate VP or equivalent
  • Director or equivalent
  • Group or Senior Manager
  • Head of Department/Function
  • Manager
  • Non-manager
  • Retired
  • Other
Visit our privacy Policy for more information about our services, how New Statesman Media Group may use, process and share your personal data, including information on your rights in respect of your personal data and how you can unsubscribe from future marketing communications.
Thank you

Thanks for subscribing.

Websites in our network