title: Spreadsheet::WriteExcel - data_validation
body: <pre><code>#! /usr/bin/env perl
  use warnings;
  use 5.012;
  use Spreadsheet::WriteExcel;
  my $workbook = Spreadsheet::WriteExcel-&gt;new( 'test_test.xls' ) or die $!;
  my $sheet = $workbook-&gt;add_worksheet();
  my $format_in = $workbook-&gt;add_format( align =&gt; 'center', valign =&gt; 'vcenter' );
  my $format_st = $workbook-&gt;add_format( align =&gt; 'center', valign =&gt; 'vcenter' );
  $format_in-&gt;set_num_format ( 'hh:mm' );
  $format_st-&gt;set_num_format ( '[h]:mm' );
  $sheet-&gt;set_row( 0, 22 );
  $sheet-&gt;set_row( 1, 22 );
  $sheet-&gt;set_column( 'A:D', 20, $format_in );
  $sheet-&gt;set_column( 'E:E', 20, $format_st );
  $sheet-&gt;write( 'A1', 'begin am' );
  $sheet-&gt;write( 'B1', 'end am' );
  $sheet-&gt;write( 'C1', 'begin pm' );
  $sheet-&gt;write( 'D1', 'end pm' );
  $sheet-&gt;write( 'E1', 'time' );
  
  $sheet-&gt;data_validation( 'A2:D2', {
      validate        =&gt; 'time',
      criteria        =&gt; 'between',
      minimum         =&gt; 'T06:00',
      maximum         =&gt; 'T20:00',
  });
  
  $sheet-&gt;write_formula( 'E2', '=(B2-A2)+(D2-C2)' );
  
  $workbook-&gt;close() or die $!;
  </code></pre>
  
  <p>Which kind of data_validation would check if the "end am"-value is greater than the "begin am"-value (and "end pm" grater then "begin pm")?<br>
  I tried this, but it didn't work:</p>
  
  <pre><code>$sheet-&gt;data_validation( 'B2', {
      validate        =&gt; 'time',
      criteria        =&gt; '&gt;=',
      value           =&gt; '=A2',
  });
  $sheet-&gt;data_validation( 'D2', {
      validate        =&gt; 'time',
      criteria        =&gt; '&gt;=',
      value           =&gt; '=C2',
  });
  </code></pre>
  
  <p><a href="http://search.cpan.org/perldoc?Spreadsheet%3a%3aWriteExcel" rel="nofollow">Spreadsheet::WriteExcel</a></p>