How can I conditionally format cells to denote past/future/current dates?

I have a church rota Google Sheet. Column A shows the date of each service.

To make it more obvious at a glance, I would like cells in column A to apply formatting so that dates in the past are colored differently. Ideally, the next upcoming date would be highlighted (or at least dates in the current month or something like this).

I am somewhat familiar with conditional formatting but not using it on dates – is this feasible and if so how can I do it? In a perfect world, the entire row would be colored for past weeks but just the cell is sufficient if this is getting tricky.

Conditionally formatting duplicate values in Google sheets with exclusion criteria?

I’m currently working in a Google sheet where I use the following formula to catch duplicate values with conditional formatting:

=countif($ B:$ B,B2)>1

While this works on its own, I find that it does not account for duplicate values I do not want to be counted. In column O, I have values marking the row as “Canceled”. So I want to have Google sheets only conditionally format cells if the following criteria are met:

  • The value in column B has a duplicate


  • Neither duplicate value has the word “canceled” in column O for that row.

This is the formula I tried, but it no longer formats duplicates:

=AND((countif($ B:$ B,B2)>1=TRUE),ISNUMBER(SEARCH("Cancelled",$ O:$ O)=FALSE))

I think what this has done has told the logic to not format duplicates unless there are no instances of “canceled” in column O.

Drupal 8 Webform conditionally send results to specific emails

Hello Looking for some advice on how to deal with sending conditional emails. I did some research and it can be done in Drupal 7 with Rules but since I’m new to Drupal 8 I haven’t been able to figure it out.

Here is my scenario

I have a select list called – TOPICS

In that select list I select SPONSORSHIP

When I click submit result goes to a specific email based on that selection

OR if I select a different topic say ADVERTISING it goes to a different email based on that selection.

Thank You in advance for any help!

Conditionally format a column based on the present day of the week (calculated in another cell)

I am building a table for work with weekly tasks. I want today’s task only to appear in bold, while other weekly tasks in gray/dimmer color so to be less evident.

I created a separated, single cell where I write =NOW(), and which returns me the day of the week in 1-7 format. (let’s call this cell A1).

On the columns of interest, I tried to create a conditional formatting rule that is =A1=1. 1 would be Monday. I’d like to only format the other column if A1=1, therefore if it’s Monday. But It doesn’t work.

I also tried with =$ A$ 1=1, or =$ A1=1, unfortunately It doesn’t works also?

Can anyone help me?

Joining and resolving two paths while keeping them relative conditionally

I would like to have a function Chain-Paths to accomplish the following: given a base directory (Base) and a location, possibly relative to that given Base (Chained), output the result of joining both paths. If however Chained is already an absolute path, just return that. If both paths are relative, keep the result relative as well.

The above, reformulated in test cases (works if run from a user directory, e.g. C:\Users\ojdo):

$  testCases = @(     @{         Base = "..\..\Windows\Fonts"         Chained = "..\system32\notepad.exe"         Expected = "..\..\Windows\system32\notepad.exe"     }     @{         Base = "C:\Windows\Fonts"         Chained = "..\system32\notepad.exe"         Expected = "C:\Windows\system32\notepad.exe"     }     @{          Base = "AppData\Roaming"         Chained = "C:\Windows\system32\notepad.exe"         Expected = "C:\Windows\system32\notepad.exe"     } )  foreach ($  case in $  testCases) {     $  expectedResult = $  case.Expected     $  actualResult = (Chain-Paths $  case.Base $  case.Chained)     $  testResult = if($  actualResult -eq $  expectedResult) {"PASS"} else {"FAIL"}      Write-Host ("{0}: {1} == {2}" -f $  testResult, $  actualResult, $  expectedResult) } 

This is the function I have come up with:

function Chain-Paths($  Base, $  Chained) {     if (Split-Path $  Chained -IsAbsolute) {         return $  Chained     } else {         $  joinedPath = Join-Path $  Base $  Chained         if (Split-Path $  Base -IsAbsolute) {             return (Resolve-Path $  joinedPath).Path         } else {             return Resolve-Path $  joinedPath -Relative         }     } } 

My questions:

  • Am I overcomplicating things?
  • Is there a way to simplify things by using a .net function?
  • Is the (...).Path really required?
  • Any stylistic recommendations (apart from missing docstring)?

Magento 2 – display custom product details tab conditionally & as an URL

I want to create a custom product detail tab “Q&A” and only display the tab when there is an Q&A questions exist for the product, and the tab will be the hyperlink to the FAQ page ( for example:[SKU])

For magento 2, I only know we can create the custom product tab using catalog_product_view.xml, i’m not sure how to implement this.

below is how it’s currently done in magento 1, using view.phtml

    <div class="details">         <ul class="tabs">             <?php { ?>             <li id="show-all" class="current"><a href="javascript:;">Overview</a></li>             <?php } ?>             <?php if( $  _product->getFeatures() || $  _product->getSpecifications() ){ ?>             <li id="specifications"><a href="javascript:;">Specifications</a></li>             <?php } ?>              <?php                  $  query = $  _helper->productAttribute($  _product, $  _product->getsku(), 'sku');                 $  object = Mage::getModel("kbase/article")->getCollection()->addSearchFilter($  query);                 if(count($  object)>0) {             ?>             <li id="q_and_a"><a href='/kbase/search/query/<?php echo $  _helper->productAttribute($  _product, $  _product->getsku(), 'sku'); ?>/' target='_blank'>Q&A</a></li>             <?php } ?>         </ul>          <div class="text" id="div_q_and_a">         <?php if( $  _product->getQAndA() ){ ?>             <div style="float:left; clear:both; padding-bottom:20px; width:100%;">                 <?php echo $  this->getChildHtml('q_and_a') ?>             </div>         <?php } ?>         </div>      </div> 

Conditionally format rows with partial matches

I have a Google Sheets table that looks like this:

(col a)    (col b)   (col c)          (col d) Company    Cohort    Session Count    Group -------------------------------------------- Acme       Jan2019   4                Foo Acme       Jan2019   3                Bar Fairview   Jan2019   3                Baz Fairview   Jan2019   3                Buzz Warner     Feb2019   2                Buzz  

I want to highlight rows were A and B are the same but C is not. Bonus points if it can highlight only the row with the lower number, but not necessary.


Company    Cohort    Session Count    Group -------------------------------------------- Acme       Jan2019   4                Foo Acme       Jan2019   3                Bar (this row gets highlighted) Fairview   Jan2019   3                Baz Fairview   Jan2019   3                Buzz Warner     Feb2019   2                Buzz  

Can I accomplish this with Conditional Formatting, or do I need to write some JS to process this? I am not savvy with conditional formatting and would love some help. I can, of course, solve it with JS but would prefer not to if possible.

Webform 5.1: how do I conditionally change the value of a field depending on the value chosen in another?

This was so easy in webform 4.x. However, I cannot seem to find it in webform 5.x.

I am creating a form using webform 5.1, and I need to set the value of the fees for a particular grade for an instrument, using conditional values (see attached screenshot for webform 4.x). So a person chooses the instrument, the grade in which he/she is to appear for examination, and then chooses whether it’s a performance (practical) or grade (theory) exam. The fees value for the exam is programmatically chosen from a list of choices in the ‘fees’ field, using conditionals.

screenshot of the conditionals in webform 4.x

Now, for the life of me, I cannot figure out a way to do the same thing using the latest version of the module on drupal 8. Have the developers of webform changed things so that it is now impossible to do it in version 5 or is there a way that I am not aware of?

Any and all help is greatly appreciated…

Load CSS/Javascript in frontend conditionally if block is used

Assuming I have no unfinite scroll or anything else going on in my theme: Is there a way to enqueue my custom Gutenberg block styles and scripts so they are only (lazy) loaded in the frontend when the block is really used? Something like is_active_widget, just for blocks? If I enqueue them inside a enqueue_block_assets function they’re added to any site.

On github, I found this , but it sounds like it’s more on bundling than conditional load, so I still hope they didn’t leave that optimization opportunity out – otherwise any other site will soon be junked with 20 additional scripts from numerous Gutenberg block plugins people install and only use once on a page (think of large image gallery block scripts for example).

Thanks & Regards!