title: Conditionally Formatting cells in other columns based on text value of another cell
body: <p>Using Xlsx Package in R, is there a way to highlight excel cells based on specific text of another cell? i.e. if C10 = "Cat" then highlight D10 and E10. I have seen many posts surrounding numeric values. I want to format based on text value and to the next two adjacent columns.</p>
  
  <p><strong>Working Example</strong></p>
  
  <pre><code>library(xlsx)
  
  setwd('C:/Users/WORKING DIRECTORY')
  
  animals &lt;- c("Cat","Mice","Dog","Bird","Cat","Cat")
  colors &lt;- c("Grey","White","Black","Blue","Black","Orange")
  store &lt;- c("Pet Shop","Online","Pets Mart","Walmart","Online","Pets Mart")
  
  df &lt;- cbind(animals,colors,store)
  
  write.xlsx(df, file ="test_test.xlsx",row.names = FALSE, sheetName= "Data")
  </code></pre>