title: How to find DataValidation list for an Excel cell using EPPlus
body: <p>I have a workbook with a number of cells that have data validation specified as a dropdown list of allowed values.  Using EPPlus, I want to be able to get for each such cell, the list of allowed values.</p>
  
  <p>So far I've got:</p>
  
  <ul>
  <li><p><code>ExcelWorkSheet.DataValidations</code> gives me an <code>ExcelDataValidationCollection</code>, which is a collection of <code>IExcelDataValidation</code> items for the worksheet.</p></li>
  <li><p>Each <code>IExcelDataValidation</code> has an Address property of type <code>ExcelAddress</code> which presumably references all cells that have that validation rule.</p></li>
  <li><p>The step I'm stuck on is finding if a given cell is one of the cells included in the <code>ExcelAddress</code></p></li>
  </ul>
  
  <p>Any takers?</p>
  
  <p>I'm currently using EPPlus 3.1.1.0, but can upgrade to a more recent version if necessary.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I didn't explain this clearly enough.  Here's my situation in more detail.</p>
  
  <ul>
  <li><p>Assume column C has some cells with list data validation.  Some cells allow, say, "A, B, C"; other cells allow "D, E, F" etc.  The range of cells for each data validation list is not contiguous, so, for example:</p>
  
  <ul>
  <li>C2, C4, C7-C10, C20 may allow "A,B,C"</li>
  <li>C3, C5-C6", C15 may allow "D,E,F"</li>
  </ul></li>
  <li><p>I'm trying to determine which cells allow "A,B,C" and which allow "D,E,F" etc.</p></li>
  <li><p>ExcelWorksheet.DataValidations contains ExcelDataValidationList items, one with values "A,B,C", one with values "D,E,F", etc.</p></li>
  <li><p>ExcelDataValidationList.Address for the list "A,B,C" contains an ExcelAddress whose Address property looks something like: "C4 C7:C10 C2 C20 ...".</p></li>
  <li><p>I want to determine if a given cell (say C6) is included in the range specified by this address "C4 C7:C10 C2 C20 ...".</p></li>
  </ul>
  
  <p>Of course, I can String.Split on whitespace, and parse each item in the resulting list.  But I was hoping there would be some more direct way of doing this, e.g.</p>
  
  <pre><code> ExcelAddress.Contains("C6")
  </code></pre>
  
  <p>or</p>
  
  <pre><code> ExcelAddress.Contains(6, 2) // row 6 col 2 = C6
  </code></pre>