# GrapeCity.Spreadsheet.IRange.Group

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_IRange_Group_" data-uid="GrapeCity.Spreadsheet.IRange.Group*">Group Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_IRange_Group_" data-uid="GrapeCity.Spreadsheet.IRange.Group*"></a>
<h4 id="GrapeCity_Spreadsheet_IRange_Group" data-uid="GrapeCity.Spreadsheet.IRange.Group">Group()</h4>
<div class="markdown level1 summary"><p>Demotes a range in an outline (that is, increases its outline level). The specified range must be a row or column, or a range of rows or columns.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">bool Group()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Group() As Boolean</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><code>true</code> if the specified range is grouped, <code>false</code> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_IRange_Group_" data-uid="GrapeCity.Spreadsheet.IRange.Group*"></a>
<h4 id="GrapeCity_Spreadsheet_IRange_Group_System_Nullable_System_Double__System_Nullable_System_Double__System_Nullable_System_Double__GrapeCity_Spreadsheet_PivotTables_PivotGroupPeriods___" data-uid="GrapeCity.Spreadsheet.IRange.Group(System.Nullable{System.Double},System.Nullable{System.Double},System.Nullable{System.Double},GrapeCity.Spreadsheet.PivotTables.PivotGroupPeriods[])">Group(double?, double?, double?, PivotGroupPeriods[])</h4>
<div class="markdown level1 summary"><p>When <a class="xref" href="GrapeCity.Spreadsheet.IRange.html">IRange</a> object represents a single cell in a PivotTable field's data range, this method performs numeric or date-based grouping in that field.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">bool Group(double? start, double? end, double? by, PivotGroupPeriods[] periods = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Group(start As Double?, [end] As Double?, by As Double?, Optional periods As PivotGroupPeriods() = Nothing) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>?</td>
      <td><span class="parametername">start</span></td>
      <td><p>The first value to be grouped. If this argument is omitted, the first value in the field is used.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>?</td>
      <td><span class="parametername">end</span></td>
      <td><p>The last value to be grouped. If this argument is omitted, the last value in the field is used.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>?</td>
      <td><span class="parametername">by</span></td>
      <td><p>If the field is numeric, this argument specifies the size of each group. If the field is a date, this argument specifies the number of days in each group if only have element <a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotGroupPeriods.html#GrapeCity_Spreadsheet_PivotTables_PivotGroupPeriods_Days">Days</a> in the <code class="paramref">periods</code> array. Otherwise, this argument is ignored. If this argument is omitted, Spread automatically chooses a default group size.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.PivotTables.PivotGroupPeriods.html">PivotGroupPeriods</a>[]</td>
      <td><span class="parametername">periods</span></td>
      <td><p>An array of values that specify the period for the group. If an element in the array, a group is created for the corresponding time. If the field isn't a date field, this argument is ignored.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><code>true</code> if the specified range is grouped, <code>false</code> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
